Properly unref a pair of GSources in the unix-fd mainloop test.
valgrind was reporting these as 'still reachable' before (possibly due
to some residual pointers somewhere in memory), but when running with
G_DEBUG=cleanup they were properly reported as leaked.
Instead of having lots of 'if NULL then allocate' code segments for the
global GRand instance, move it to a single getter function that everyone
calls.
We were using g_mutex_init() to initialise a pair of mutexes in static
storage, but we should only do that for mutexes that are part of
allocated structures.
Include unistd.h only on *NIX and define items as necessary on Windows,
also replace instances of ssize_t with the GLib-equivilant gssize so to fix
the build on platforms that do not have ssize_t, such as Visual C++.
https://bugzilla.gnome.org/show_bug.cgi?id=711047
Include unistd.h only when G_OS_UNIX is defined (or when G_OS_WIN32 is not
defined). This will avoid including unistd.h unconditionally and/or
unecessarily, which may cause problems in certain scenarios, such as when
building the tests on Visual C++, which does not come with a unistd.h and
MinGW, where unistd.h is essentially a wrapper for io.h and process.h.
https://bugzilla.gnome.org/show_bug.cgi?id=711047
...and fix the test on non-English Windows, as gettext on Windows does
not honor LC_ALL = "C" (the default CRT behavior) but requires using
SetThreadLocale() to set the locale as it picks up the user's environment
and the thread's locale. Without doing so the g_format_size_for_display()
et al will display the translated message if the gettext translations have
been installed before, causing the test_format_size_for_display tests to
fail.
https://bugzilla.gnome.org/show_bug.cgi?id=711047
Visual C++ does not like function declarations being different from
their prototypes, so make the prototypes match the declarations by
decorating them with G_MODULE_EXPORT.
https://bugzilla.gnome.org/show_bug.cgi?id=711047
We need to use g_content_type_get_mime_type() to look up the mime type of
the file from the registry on the content type that was acquired on
Windows, as g_file_info_get_content_type() does not acquire the
file mime type (unlike on *NIX).
g_content_type_get_mime_type() on *NIX is more or less an no-op as it
simply returns the g_strdup()-ed version of the passed-in content type.
This will enable the resources test to pass on Windows.
https://bugzilla.gnome.org/show_bug.cgi?id=711047
g_source_add_child_source() releases the context lock before attaching
child_source to context. And this causes trouble if parent source is
blocked and g_main_dispatch() manages to lock the context mutex and call
unblock_source() before child_source gets attached to context.
To fix this we call g_source_attach_unlocked() before releasing the
context mutex.
https://bugzilla.gnome.org/show_bug.cgi?id=711064
The overridden implementation of the skip method for
GLocalFileInputStream allows skipping past the end of the file which is
inconsistent with the documentation. Prevent this by first seeking to
the end of the file and then seeking backwards from there as much as
is necessary.
https://bugzilla.gnome.org/show_bug.cgi?id=711048
G_STRFUNC was checking __STDC_VERSION__ against the wrong value
(though it didn't actually matter, since __STDC_VERSION__ wasn't
defined in C90, so the check still only matched C99 and above anyway).
If the goal is to make sure we don't have a dbus connection, it has
to call g_test_dbus_unset() instead which is much more complete.
In this case, g_test_dbus_unset() is called already, so it should be
fine.
https://bugzilla.gnome.org/show_bug.cgi?id=697348
This is to avoid having again the subtil bug in dbus-appinfo.c:
session_bus_down() was called before g_test_run() so the test was
running on the user's dbus session.
https://bugzilla.gnome.org/show_bug.cgi?id=697348
Make sure that if we ignore a tag then we also clear the attributes that
we already collected so that they don't end up on the next unignored tag
opening.
Also add some extra brackets for clarity (it doesn't make any difference
-- I just think it reads nicer this way).
https://bugzilla.gnome.org/show_bug.cgi?id=665634
A reference to the session bus is now stored in GNotificationBackend.
Remove the extraneous one in the gtk backend and stop using it in
withdraw_notification.
https://bugzilla.gnome.org/show_bug.cgi?id=711051
Don't hold the lock when calling the user's callback during
g_cancellable_connect() for the case that the cancellable has already
fired.
Taken from a patch by Alex Larsson.
Doc updates from Colin Walters.
https://bugzilla.gnome.org/show_bug.cgi?id=705395
If someone calls org.gtk.Actions.Describe on a non-existent action then
return an exception instead of a trivial description (disabled, no
state, etc.).
https://bugzilla.gnome.org/show_bug.cgi?id=687185
If someone calls org.gtk.Actions.Describe on a non-existent action then
return an exception instead of a trivial description (disabled, no
state, etc.).
https://bugzilla.gnome.org/show_bug.cgi?id=687185
g_object_set() allowed us to bypass the usual checks that the state
doesn't change type and also leaked.
Fix that up by turning the state into a construct property (so that it
always gets set once during construction, even if only to NULL) and
then route the further sets through the C API so that they are subject
to the same checks.
https://bugzilla.gnome.org/show_bug.cgi?id=696424
Ignore qualified (in the XML namespace sense) tags and attributes when
compiling GSettings schemas.
This will allow people to add custom tags and attributes to their schemas
without tripping up the compiler.
https://bugzilla.gnome.org/show_bug.cgi?id=635641
Ignore qualified (in the XML namespace sense) tags and attributes when
parsing D-Bus introspection XML.
This will allow people to add custom tags and attributes to their D-Bus
interfaces without tripping up GDBus.
https://bugzilla.gnome.org/show_bug.cgi?id=665634
Add a flag to GMarkupParserFlags to ignore qualified tags (along with
their contents) and attributes.
This will provide a nice way for some of our parsers (GDBus
introspection, GSettings schema, etc) to ignore additional tags that
users have added to their files, under a different namespace.
https://bugzilla.gnome.org/show_bug.cgi?id=665634
The code for dealing with </foo> and the second half of <foo/> was
largely duplicated. We can share a lot of it by using a common
function.
This slightly changes the behaviour of the parser under error
circumstances: previously the parser would deal with '<foo/}' by first
issuing the end_element callback and then flagging the error due to the
unexpected character. Now we will flag the unexpected character error
first, skipping the callback.
This behaviour change required modifying the testsuite.
https://bugzilla.gnome.org/show_bug.cgi?id=665634
Debug messages are meant to give insight into how a process is
proceeding, and are unpredictable in nature. They also often have
line numbers in them.
This patch ignores debug messages in g_test_assert_expected_messages().
https://bugzilla.gnome.org/show_bug.cgi?id=710991
Stop using the recently-deprecated GSettings APIs.
Use the GSettingsSchema-based APIs instead.
This fixes a number of bugs and also a net reduction of code. In
particular, list-schemas will now work in context of a given --schemadir
argument.
https://bugzilla.gnome.org/show_bug.cgi?id=695558
The number of arguments passed to each function is about to increase, so
just use global variables instead.
This is a commandline tool, after all...
https://bugzilla.gnome.org/show_bug.cgi?id=695558
Add g_settings_schema_has_key() and _get_range(), _range_check(),
_get_value_type(), _get_default_value() methods on GSettingsSchemaKey.
Deprecate the equivalent APIs on GSettings.
https://bugzilla.gnome.org/show_bug.cgi?id=683017
Add two new APIs: g_settings_get_user_value() and
g_settings_get_default_value(). Together, these should allow the
inspection of all interesting cases of "is this key set?" and "what
would happen if I reset this key?"
https://bugzilla.gnome.org/show_bug.cgi?id=668233
Add two boolean parameters to our internal getter utility function in
anticipation of the coming addition of g_settings_get_user_value() and
g_settings_get_default_value() APIs.
https://bugzilla.gnome.org/show_bug.cgi?id=668233
This will get the 'user' value from the database (ie: the one that the user has
control over).
Provide a default implementation that chains to ->read(). That will work for
all of our internal backends which don't have a concept of layering or
lockdown.
The delayed backend implments "user value" by returning anything that's
in the changeset (incuding an explicit NULL) or chaining up otherwise.
We will use this for g_settings_get_user_value().
https://bugzilla.gnome.org/show_bug.cgi?id=668233