Add support for serialising a GIcon to a GVariant and deserialising the
result back to a GIcon.
This solves a number of problems suffered by the existing to_string()
API, primarily these:
- not forcing the icon to be a utf8 string means that we can
efficiently encode a PNG (ie: just give the array of bytes)
- there is no need to ensure that proper types are loaded before using
the deserialisation interface. 'Foreign' icon types will probably
emit a serialised format the deserialises to a GBytesIcon.
We additionally clearly document what is required for being a consumer
or implementation of #GIcon.
Further patches will be required to GdkPixbuf and GVfsIcon to bring
their implementations in line with the new rules (essentially: introduce
implementations of the new serialize() API).
https://bugzilla.gnome.org/show_bug.cgi?id=688820
GBytesIcon is an icon that has a GBytes inside of it where the GBytes
contains some sort of encoded image in a widely-recognised file format.
Ideally this will be a PNG.
It implements GLoadableIcon, so GTK will already understand how to use
it, but we will add another patch there to make things more efficient.
https://bugzilla.gnome.org/show_bug.cgi?id=688820
Split out the 'simple string format' cases of URIs, file paths and
themed icons to a separate function.
This function will be shared by g_icon_deserialize().
https://bugzilla.gnome.org/show_bug.cgi?id=688820
Lots of people have variously asked for APIs like
g_variant_new_string_printf() in order to avoid having to use
g_strdup_printf(), create a GVariant using g_variant_new_string(), then
free the temporary string.
Instead of supporting that, plus a million other potential cases,
introduce g_variant_new_take_string() as a compromise.
It's not possible to write:
v = g_variant_new_take_string (g_strdup_printf (....));
to get the desired result and avoid the extra copies. In addition, it
works with many other functions.
https://bugzilla.gnome.org/show_bug.cgi?id=698455
In the *_async_thread() functions, call the corresponding synchronous
function instead of calling the interface vfunc, which can be NULL.
In some cases the check for the vfunc == NULL was done, but to be
consistent it is better to always call the synchronous version (and the
code is simpler).
https://bugzilla.gnome.org/show_bug.cgi?id=548353
Parsing wrongly-typed GVariant text format data is a well-defined
operation and it ought to result in a GError. We do that for most
cases, but 'v' and 'ay' were being treated differently. Fix those as
well.
set/endpwent are only required for iterating through passwd entries
using getpwent(). Since we are explicitly requesting a passwd entry
for a uid then the set/endpwent calls are redundant.
Removing these redundant calls is required for building on Android
since their C library doesn't implement these.
https://bugzilla.gnome.org/show_bug.cgi?id=645881
When unreffing a context with sources still attached, it would end up
unlocking an already-unlocked context, causing crashes on platforms
that (unlike Linux) actually check for that.
https://bugzilla.gnome.org/show_bug.cgi?id=697595
This feature is intended for clients that want to signal a desktop shell
their busy state, for instance because a long-running operation is
pending.
The API works in a similar way to g_application_hold and
g_application_release: applications can call g_application_mark_busy()
to increase a counter that will keep the application marked as busy
until the counter reaches zero again.
The busy state is exported read-only on the org.gtk.Application interface
for clients to use.
https://bugzilla.gnome.org/show_bug.cgi?id=672018
gtk# also has a problem with the new interface-after-init restriction
that nobody noticed until now. Add an exception for them as well so
that they have a cycle or so to sort things out.
https://bugzilla.gnome.org/show_bug.cgi?id=687659
glibmm has a pretty difficult-to-solve problem caused by our recent
change to deny addition of interfaces to classes after initialisation.
They're looking for a long-term workaround for the problem, but in the
meantime we can allow the registration to succeed (with warning) if the
class looks like it's being defined by gtkmm.
https://bugzilla.gnome.org/show_bug.cgi?id=697229
Flags being used in the G_DEFINE_TYPE_EXTENDED sample was "0", so it
should expand to 0 as well, otherwise the compiler would bark with:
maman-bar.c: In function ‘maman_bar_get_type’:
maman-bar.c:36:53: error: ‘flags’ undeclared (first use in this function)
maman-bar.c:36:53: note: each undeclared identifier is reported only once for each function it appears in
https://bugzilla.gnome.org/show_bug.cgi?id=697250
RHEL6 ships with GCC 4.4 by default, which doesn't understand the
nicer deprecated attribute that takes a message. However, we can at
least fall back to the old G_DEPRECATED, rather than silently doing
nothing.
This gives me warning messages when building OSTree on RHEL6 when I
accidentally added a usage of g_unix_fd_source_new().
https://bugzilla.gnome.org/show_bug.cgi?id=697160
It is possible that the upstream servers return something, but
we then filter all results because they are of the wrong type.
In that case the API and subsequent GTask calls expect a GError
to be set.
https://bugzilla.gnome.org/show_bug.cgi?id=696857
to avoid warnings when built with -Wredundant-decls:
sessionmanager-presence-generated.c:316:1: warning: redundant redeclaration of ‘session_manager_presence_default_init’ [-Wredundant-decls]
sessionmanager-presence-generated.c:281:1: note: previous definition of ‘session_manager_presence_default_init’ was here
sessionmanager-presence-generated.c:1273:1: warning: redundant redeclaration of ‘object_default_init’ [-Wredundant-decls]
sessionmanager-presence-generated.c:1259:1: note: previous definition of ‘object_default_init’ was here
https://bugzilla.gnome.org/show_bug.cgi?id=696108