Commit Graph

6 Commits

Author SHA1 Message Date
Philip Withnall
42c9e8218b gio: Change content type of zero-sized files to application/x-zerosize
That’s what xdgmime uses for zero-sized files (see `XDG_MIME_TYPE_EMPTY`).

Historically, GLib explicitly used `text/plain` for empty files, to
ensure they would open in a text editor. But `text/plain` is not really
correct for an empty file: the content isn’t text because there is no
content. The file could eventually become something else when written
to.

Text editors which want to be opened for new, empty files should add
`application/x-zerosize` to their list of supported content types.

Users who want to set a handler for `application/x-zerosize` on their
desktop should use
```sh
gio mime application/x-zerosize  # to see the current handler
gio mime application/x-zerosize org.gnome.gedit.desktop  # to set it
```

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #2777
2022-11-07 13:21:28 +00:00
Marco Trevisan (Treviño)
5fc8a476c8 gosxcontenttype: Do not mix declarations with code
Fixes: #2759
2022-09-20 15:41:08 +02:00
Philip Withnall
3de1b88339 gcontenttype: Add no-op versions of {get,set}_mime_dirs() on win32/macOS
These are here to prevent linker errors, since `gcontenttype.[ch]`
aren’t compiled on Windows or macOS.

The implementations are stubs to be filled out by someone who knows each
platform, at some point in the future.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #1791
2019-07-24 14:50:53 +01:00
Xavier Claessens
ead46cdc7e Revert "Revert "Rename objective-c files from .c to .m""
This reverts commit 2e9f3a9afe.
2018-05-25 03:06:07 +00:00
Matthias Clasen
2e9f3a9afe Revert "Rename objective-c files from .c to .m"
This reverts commit e400af99d4.
2018-05-22 17:21:16 -04:00
Xavier Claessens
e400af99d4 Rename objective-c files from .c to .m
Those files got renamed to .c to work around an automake issue, but
Meson needs them to have .m extension. Better rename them at build time
in Makefile.am since that's where the workaround is needed.

https://bugzilla.gnome.org/show_bug.cgi?id=672777
2018-05-22 11:49:24 -04:00