For g_file_set_contents() we fsync() before renaming the file over the
original in order to ensure that we don't end up with an invalid file.
btrfs provides this guarantee for us without the fsync() so skip it
there.
We want to be compatible with the following situation:
- there's no explicit default set in mimeapps.list
- we add support for a content type to a specific application, and that
list is empty
- the default should be picked from the system list, not overridden by
the user-added application.
So we make the default explicit in this case, by adding it to the
relevant section in mimeapps.list.
https://bugzilla.gnome.org/show_bug.cgi?id=637675
This commit also changes (maintaining compatibility) the way
user-specified default applications are stored (as in, those for which
g_app_info_set_as_default_for_type() has been called.
We now store the default application for a content type in a new group
in the mimeapps.list keyfile, and "Added Associations" tracks only the
applications that have been added by the user, following a
most-recently-used first order.
This is useful in GtkAppChooser-like widgets to pre-select the last used
application when constructing a widget.
https://bugzilla.gnome.org/show_bug.cgi?id=636311
Hiding the object/class structs in the source file makes this class not
subclassable.
Move them to the public header, and add a property for the icon, so that
subclasses can just use
g_object_new (DERIVED_TYPE,
"gicon", icon,
NULL);
to create an emblemed icon.
https://bugzilla.gnome.org/show_bug.cgi?id=636892
I couldn't tell from reading the documentation whether I had to pass in
an uninitialized value, or a value initialized to the exact type, or
something else. It turns out (from reading the source) that you have to
pass in an initialized value, but you can use any type to which the
property's actual type can be transformed.
So, let's document this.
The necessary review and integration work has not happened, and
we don't want to enshrine it in this unproven state.
It will be back when the world is ready for it.
Also add some test cases to test/hostutils for that and a few other
things, and make the test program just act as an ASCII/unicode
hostname converter rather than a test program if it's run with an
argument.
https://bugzilla.gnome.org/show_bug.cgi?id=633350