platform/upstream/glib.git
10 years agosignals: Fix leak in test
Stef Walter [Sun, 10 Nov 2013 14:56:59 +0000 (15:56 +0100)]
signals: Fix leak in test

https://bugzilla.gnome.org/show_bug.cgi?id=711779

10 years agoparamspec-test: Fix leaks in tests
Stef Walter [Sun, 10 Nov 2013 14:56:32 +0000 (15:56 +0100)]
paramspec-test: Fix leaks in tests

https://bugzilla.gnome.org/show_bug.cgi?id=711779

10 years agooverride: Fix leaks in test
Stef Walter [Sun, 10 Nov 2013 14:56:17 +0000 (15:56 +0100)]
override: Fix leaks in test

https://bugzilla.gnome.org/show_bug.cgi?id=711779

10 years agogvalue-test: Fix leaks in test
Stef Walter [Sun, 10 Nov 2013 14:55:56 +0000 (15:55 +0100)]
gvalue-test: Fix leaks in test

https://bugzilla.gnome.org/show_bug.cgi?id=711779

10 years agoaccumulator: Fix leak in test
Stef Walter [Sun, 10 Nov 2013 14:55:35 +0000 (15:55 +0100)]
accumulator: Fix leak in test

https://bugzilla.gnome.org/show_bug.cgi?id=711779

10 years agothreadtests: Fix leaks in tests
Stef Walter [Thu, 7 Nov 2013 21:57:27 +0000 (22:57 +0100)]
threadtests: Fix leaks in tests

https://bugzilla.gnome.org/show_bug.cgi?id=711779

10 years agoenums: Fix leaks in tests
Stef Walter [Thu, 7 Nov 2013 21:57:13 +0000 (22:57 +0100)]
enums: Fix leaks in tests

https://bugzilla.gnome.org/show_bug.cgi?id=711779

10 years agogiomodule: Fix leaks in module loading
Stef Walter [Thu, 7 Nov 2013 22:00:28 +0000 (23:00 +0100)]
giomodule: Fix leaks in module loading

https://bugzilla.gnome.org/show_bug.cgi?id=711798

10 years agoboxed: Fix double free in boxed unit tests
Stef Walter [Sun, 10 Nov 2013 13:48:36 +0000 (14:48 +0100)]
boxed: Fix double free in boxed unit tests

https://bugzilla.gnome.org/show_bug.cgi?id=711782

10 years agogdbus-connection: Fix leaks in tests
Stef Walter [Sat, 9 Nov 2013 19:21:44 +0000 (20:21 +0100)]
gdbus-connection: Fix leaks in tests

https://bugzilla.gnome.org/show_bug.cgi?id=711802

10 years agogdbus-connection-slow: Fix leak in tests
Stef Walter [Sat, 9 Nov 2013 19:21:16 +0000 (20:21 +0100)]
gdbus-connection-slow: Fix leak in tests

https://bugzilla.gnome.org/show_bug.cgi?id=711802

10 years agogdbus-connection: Fix use after free in test
Stef Walter [Sat, 9 Nov 2013 19:28:41 +0000 (20:28 +0100)]
gdbus-connection: Fix use after free in test

https://bugzilla.gnome.org/show_bug.cgi?id=711802

10 years agogsubprocess: Fix leaks in tests
Stef Walter [Sat, 9 Nov 2013 07:54:28 +0000 (08:54 +0100)]
gsubprocess: Fix leaks in tests

https://bugzilla.gnome.org/show_bug.cgi?id=711802

10 years agogsubprocess: Fix error detection logic in tests
Stef Walter [Sat, 9 Nov 2013 07:53:13 +0000 (08:53 +0100)]
gsubprocess: Fix error detection logic in tests

Various tests were depending on local_error being set by a callback
when it could never have been the case. Simplify async error detection
logic in those cases, and fix leak of GError.

https://bugzilla.gnome.org/show_bug.cgi?id=711802

10 years agog-icon: Fix memory leak in test
Stef Walter [Fri, 8 Nov 2013 13:28:55 +0000 (14:28 +0100)]
g-icon: Fix memory leak in test

https://bugzilla.gnome.org/show_bug.cgi?id=711802

10 years agocontexts: Fix memory leak in test
Stef Walter [Fri, 8 Nov 2013 13:28:23 +0000 (14:28 +0100)]
contexts: Fix memory leak in test

https://bugzilla.gnome.org/show_bug.cgi?id=711802

10 years agodata-output-stream: Fix some access after free
Stef Walter [Sun, 10 Nov 2013 15:39:45 +0000 (16:39 +0100)]
data-output-stream: Fix some access after free

The memory pointed to by a GMemoryOutputStream can be realloc'd

https://bugzilla.gnome.org/show_bug.cgi?id=711802

10 years agobuffered-output-stream: Fix some access after free
Stef Walter [Sun, 10 Nov 2013 15:39:28 +0000 (16:39 +0100)]
buffered-output-stream: Fix some access after free

The memory pointed to by a GMemoryOutputStream can be realloc'd

https://bugzilla.gnome.org/show_bug.cgi?id=711802

10 years agogtestdbus: Fix leak of GMainLoop
Stef Walter [Sat, 9 Nov 2013 19:19:44 +0000 (20:19 +0100)]
gtestdbus: Fix leak of GMainLoop

https://bugzilla.gnome.org/show_bug.cgi?id=711808

10 years agomodule-test: Fix leaks in test
Stef Walter [Sun, 10 Nov 2013 09:54:47 +0000 (10:54 +0100)]
module-test: Fix leaks in test

https://bugzilla.gnome.org/show_bug.cgi?id=711768

10 years agoutils: Don't free memory owned by glib in test
Stef Walter [Sun, 10 Nov 2013 13:32:17 +0000 (14:32 +0100)]
utils: Don't free memory owned by glib in test

https://bugzilla.gnome.org/show_bug.cgi?id=711775

10 years agoiochannel-test: Fix leaks in test
Stef Walter [Sun, 10 Nov 2013 09:54:26 +0000 (10:54 +0100)]
iochannel-test: Fix leaks in test

https://bugzilla.gnome.org/show_bug.cgi?id=711751

10 years agounicode-encoding: Fix leaks in test
Stef Walter [Sat, 9 Nov 2013 19:52:42 +0000 (20:52 +0100)]
unicode-encoding: Fix leaks in test

https://bugzilla.gnome.org/show_bug.cgi?id=711751

10 years agothread-test: Fix leaks in tests
Stef Walter [Sat, 9 Nov 2013 19:51:18 +0000 (20:51 +0100)]
thread-test: Fix leaks in tests

This is a test of deprecated functionality and its age is
showing. Doesn't actually do what it says. But fix leaks anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=711751

10 years agomainloop-test: Fix leaks in tests
Stef Walter [Sat, 9 Nov 2013 19:30:11 +0000 (20:30 +0100)]
mainloop-test: Fix leaks in tests

https://bugzilla.gnome.org/show_bug.cgi?id=711751

10 years agodatetime: Fix leak in test
Stef Walter [Sat, 9 Nov 2013 19:29:04 +0000 (20:29 +0100)]
datetime: Fix leak in test

https://bugzilla.gnome.org/show_bug.cgi?id=711751

10 years agomapping-test: Fix leaks in tests
Stef Walter [Sat, 9 Nov 2013 19:26:57 +0000 (20:26 +0100)]
mapping-test: Fix leaks in tests

https://bugzilla.gnome.org/show_bug.cgi?id=711751

10 years agogio-test: Fix leaks in tests
Stef Walter [Sat, 9 Nov 2013 19:26:15 +0000 (20:26 +0100)]
gio-test: Fix leaks in tests

https://bugzilla.gnome.org/show_bug.cgi?id=711751

10 years agocompletion-test: Fix leaks in tests
Stef Walter [Sat, 9 Nov 2013 19:25:39 +0000 (20:25 +0100)]
completion-test: Fix leaks in tests

https://bugzilla.gnome.org/show_bug.cgi?id=711751

10 years agochild-test: Fix leak in test
Stef Walter [Sat, 9 Nov 2013 19:25:23 +0000 (20:25 +0100)]
child-test: Fix leak in test

https://bugzilla.gnome.org/show_bug.cgi?id=711751

10 years agoasyncqueue-test: Fix leaks in tests
Stef Walter [Sat, 9 Nov 2013 19:25:07 +0000 (20:25 +0100)]
asyncqueue-test: Fix leaks in tests

https://bugzilla.gnome.org/show_bug.cgi?id=711751

10 years agounix: Fix memory leak in unix test
Stef Walter [Thu, 7 Nov 2013 21:40:59 +0000 (22:40 +0100)]
unix: Fix memory leak in unix test

https://bugzilla.gnome.org/show_bug.cgi?id=711751

10 years agogerror: Don't leak memory when overwrite warning
Dan Winship [Thu, 7 Nov 2013 21:38:52 +0000 (22:38 +0100)]
gerror: Don't leak memory when overwrite warning

Even though we can't always make no-leak guarantees when g_warning()
in this case we're testing this behavior in tests, and it would be
good to be able to valgrind this.

https://bugzilla.gnome.org/show_bug.cgi?id=711751

10 years agoprivate: Fix memory leak in tests
Stef Walter [Thu, 31 Oct 2013 13:41:34 +0000 (14:41 +0100)]
private: Fix memory leak in tests

Don't use g_private_new(), it's deprecated, and leaks by definition.

https://bugzilla.gnome.org/show_bug.cgi?id=711751

10 years agogiomodule: small typo in documentation
Michael Catanzaro [Sat, 9 Nov 2013 15:33:42 +0000 (09:33 -0600)]
giomodule: small typo in documentation

10 years agoSmall documentation improvement
Matthias Clasen [Sat, 9 Nov 2013 01:57:04 +0000 (20:57 -0500)]
Small documentation improvement

10 years agoAdd an index for new api in glib docs
Matthias Clasen [Sat, 9 Nov 2013 01:45:54 +0000 (20:45 -0500)]
Add an index for new api in glib docs

10 years agoRevert "gio/Makefile: make sure to dist gappinfoprivate.h"
Rico Tzschichholz [Fri, 8 Nov 2013 07:15:43 +0000 (08:15 +0100)]
Revert "gio/Makefile: make sure to dist gappinfoprivate.h"

This reverts commit c45b26d61f6539dbf4e202aded08d9614b441f81.

10 years agogstrfuncs: fix small typo in documentation
Michael Catanzaro [Fri, 8 Nov 2013 00:39:59 +0000 (18:39 -0600)]
gstrfuncs: fix small typo in documentation

10 years agoGAppInfoMonitor: don't try to use NULL hash table
Ryan Lortie [Thu, 7 Nov 2013 18:56:56 +0000 (13:56 -0500)]
GAppInfoMonitor: don't try to use NULL hash table

Don't g_hash_table_iter_init() on a NULL table if we see the app info
monitoring but no monitors have been created yet.

https://bugzilla.gnome.org/show_bug.cgi?id=711632

10 years agoGApplication: fix bogus testcase
Ryan Lortie [Tue, 29 Oct 2013 19:02:44 +0000 (12:02 -0700)]
GApplication: fix bogus testcase

We had a GApplication testcase that handled both open and commandline.
This only way that this worked was by implementing the commandline
handler without actually setting the HANDLES_COMMAND_LINE flag.

This behaviour is now invalid, so just rip out the offending part of the
test.

https://bugzilla.gnome.org/show_bug.cgi?id=711099

10 years agoappinfo: Add some testcases for searching
Ryan Lortie [Thu, 10 Oct 2013 13:28:30 +0000 (09:28 -0400)]
appinfo: Add some testcases for searching

https://bugzilla.gnome.org/show_bug.cgi?id=711557

10 years agoAdd g_desktop_app_info_search()
Ryan Lortie [Wed, 6 Nov 2013 03:51:48 +0000 (22:51 -0500)]
Add g_desktop_app_info_search()

The first time this function is called we load all of the keyfiles in
the directory, ignoring the 'Hidden' ones and build an index out of the
interesting fields using g_str_tokenize_and_fold().

We do prefix matching on the tokens to find relevent desktop files.

Right now this is implemented as a hashtable that we iterate over,
checking prefixes on each token.  This could possibly be sped up by
creating an array, but it's already pretty fast...

https://bugzilla.gnome.org/show_bug.cgi?id=711557

10 years agogio/Makefile: make sure to dist gappinfoprivate.h
Ryan Lortie [Thu, 7 Nov 2013 17:11:55 +0000 (12:11 -0500)]
gio/Makefile: make sure to dist gappinfoprivate.h

10 years agogio: Add gappinfoprivate.h to Makefile.am
Rico Tzschichholz [Thu, 7 Nov 2013 16:37:13 +0000 (17:37 +0100)]
gio: Add gappinfoprivate.h to Makefile.am

In addition to e55d33edc1336ddc6d5cdfa0e3003a69a5812d26

10 years agoUpdated Greek translation
Dimitris Spingos [Thu, 7 Nov 2013 15:19:09 +0000 (17:19 +0200)]
Updated Greek translation

10 years agoconfigure: test(1) uses = to test for string equality
Patrick Welche [Thu, 7 Nov 2013 10:58:46 +0000 (10:58 +0000)]
configure: test(1) uses = to test for string equality

https://bugzilla.gnome.org/show_bug.cgi?id=711600

10 years agocodegen.py: Rearrange GLib Version Check
Chun-wei Fan [Tue, 29 Oct 2013 06:55:27 +0000 (14:55 +0800)]
codegen.py: Rearrange GLib Version Check

...so that the generated code will build on all platforms, as compilers
like Visual C++ does not like #ifdef checks during a definition/use of
a macro.

https://bugzilla.gnome.org/show_bug.cgi?id=711049

10 years agoAdd GAppInfoMonitor
Ryan Lortie [Wed, 25 Sep 2013 13:19:43 +0000 (09:19 -0400)]
Add GAppInfoMonitor

This is a simple object that emits a "change" signal when the installed
applications may have changed in some way.

https://bugzilla.gnome.org/show_bug.cgi?id=711556

10 years agogdesktopappinfo: keep a list of files in the dirs
Ryan Lortie [Sat, 27 Jul 2013 20:04:56 +0000 (16:04 -0400)]
gdesktopappinfo: keep a list of files in the dirs

In each DesktopFileDir, store a list of desktop files for that
directory.  This speeds up opening desktop files by name because we can
skip statting in directories that we know don't have the file and also
speeds up _get_all() because we can avoid enumeration.

This also improves our support for dealing with names like
'kde4/kate.desktop' (equivalent to kde4-kate.desktop) since we find out
about all of these files are the start and don't need to guess about
which '-' to change to a '/'.  It also means that we can easily deal
with more than one level of such prefixes.

We use a file monitor to watch for changes, invalidating our lists when
we notice them.

https://bugzilla.gnome.org/show_bug.cgi?id=711520

10 years agosignals: Fix memory leaks in signals unit tests
Stef Walter [Thu, 31 Oct 2013 22:07:10 +0000 (23:07 +0100)]
signals: Fix memory leaks in signals unit tests

https://bugzilla.gnome.org/show_bug.cgi?id=627423

10 years agoqdata: Fix leak in qdata unit tests
Stef Walter [Thu, 31 Oct 2013 22:06:27 +0000 (23:06 +0100)]
qdata: Fix leak in qdata unit tests

https://bugzilla.gnome.org/show_bug.cgi?id=627423

10 years agogerror: Don't leak when warning about overwriting an error
Stef Walter [Thu, 31 Oct 2013 13:39:05 +0000 (14:39 +0100)]
gerror: Don't leak when warning about overwriting an error

While not strictly necessary, this fixes a false positive
leak in the tests.

https://bugzilla.gnome.org/show_bug.cgi?id=627423

10 years agotests: fix leak in mainloop test
Ryan Lortie [Mon, 25 Mar 2013 01:55:08 +0000 (21:55 -0400)]
tests: fix leak in mainloop test

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.

10 years agogrand: restructure a bit
Ryan Lortie [Mon, 25 Mar 2013 01:25:26 +0000 (21:25 -0400)]
grand: restructure a bit

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.

10 years agogslice: don't misuse g_mutex_init()
Ryan Lortie [Mon, 25 Mar 2013 01:18:30 +0000 (21:18 -0400)]
gslice: don't misuse g_mutex_init()

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.

10 years agogarray: Note lack of bounds checking in g_ptr_array_index() documentation
Philip Withnall [Tue, 5 Nov 2013 16:43:26 +0000 (16:43 +0000)]
garray: Note lack of bounds checking in g_ptr_array_index() documentation

10 years agogio/tests: Clean up inclusion of unistd.h
Chun-wei Fan [Mon, 4 Nov 2013 08:32:01 +0000 (16:32 +0800)]
gio/tests: Clean up inclusion of unistd.h

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

10 years agoglib/tests: Clean up inclusion of unistd.h
Chun-wei Fan [Mon, 4 Nov 2013 05:07:52 +0000 (13:07 +0800)]
glib/tests: Clean up inclusion of unistd.h

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

10 years agoglib/tests/fileutils.c: Include unistd.h on *NIX only
Chun-wei Fan [Mon, 4 Nov 2013 04:23:30 +0000 (12:23 +0800)]
glib/tests/fileutils.c: Include unistd.h on *NIX only

...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

10 years agotests/libmoduletestplugins*.c: Update Prototypes
Chun-wei Fan [Tue, 29 Oct 2013 11:12:38 +0000 (19:12 +0800)]
tests/libmoduletestplugins*.c: Update Prototypes

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

10 years agogio/test/resources.c: Fix for Windows
Chun-wei Fan [Tue, 29 Oct 2013 11:17:32 +0000 (19:17 +0800)]
gio/test/resources.c: Fix for Windows

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

10 years agogmain: make g_source_add_child_source() thread safe
Ognyan Tonchev [Tue, 29 Oct 2013 15:39:38 +0000 (16:39 +0100)]
gmain: make g_source_add_child_source() thread safe

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

10 years agogio: Don't allow skipping past the end of GLocalFileInputStream
Ross Lagerwall [Tue, 29 Oct 2013 04:02:59 +0000 (06:02 +0200)]
gio: Don't allow skipping past the end of GLocalFileInputStream

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

10 years agogmacros.h: fix C99 check
Dan Winship [Sat, 2 Nov 2013 16:18:45 +0000 (12:18 -0400)]
gmacros.h: fix C99 check

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).

10 years agoUpdated Galician translations
Fran Diéguez [Fri, 1 Nov 2013 11:52:43 +0000 (12:52 +0100)]
Updated Galician translations

10 years agoUpdated Galician translations
Fran Diéguez [Mon, 28 Oct 2013 00:13:41 +0000 (01:13 +0100)]
Updated Galician translations

10 years agoUpdated Spanish translation
Daniel Mustieles [Thu, 31 Oct 2013 13:36:50 +0000 (14:36 +0100)]
Updated Spanish translation

10 years agodocs: GDataTime: *_add_*(): Mention that you can subtract.
Murray Cumming [Thu, 31 Oct 2013 12:15:01 +0000 (13:15 +0100)]
docs: GDataTime: *_add_*(): Mention that you can subtract.

Because this was not obvious to at least one person on irc.

10 years agogio: Clean up trashinfo file if trashing fails
Ross Lagerwall [Wed, 30 Oct 2013 18:34:14 +0000 (20:34 +0200)]
gio: Clean up trashinfo file if trashing fails

https://bugzilla.gnome.org/show_bug.cgi?id=687202

10 years agoTests: It is useless to unset "DBUS_SESSION_BUS_ADDRESS" manually
Xavier Claessens [Mon, 28 Oct 2013 21:02:44 +0000 (17:02 -0400)]
Tests: It is useless to unset "DBUS_SESSION_BUS_ADDRESS" manually

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

10 years agoGTestDBus: Make sure only DBUS_SESSION_BUS_ADDRESS is set by default
Xavier Claessens [Mon, 28 Oct 2013 18:54:22 +0000 (14:54 -0400)]
GTestDBus: Make sure only DBUS_SESSION_BUS_ADDRESS is set by default

g_test_dbus_unset() now also unset DBUS_STARTER_ADDRESS and
DBUS_STARTER_BUS_TYPE.

https://bugzilla.gnome.org/show_bug.cgi?id=697348

10 years agoTests: add session_bus_run() and use it where possible
Xavier Claessens [Mon, 28 Oct 2013 21:18:54 +0000 (17:18 -0400)]
Tests: add session_bus_run() and use it where possible

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

10 years agotests/gdbus-introspection: Add a less trivial test case for _IGNORE_QUALIFIED
Colin Walters [Tue, 29 Oct 2013 13:47:34 +0000 (09:47 -0400)]
tests/gdbus-introspection: Add a less trivial test case for _IGNORE_QUALIFIED

This is distilled from PackageKit which currently aborts on startup.

https://bugzilla.gnome.org/show_bug.cgi?id=665634

10 years agoGMarkup: clear attributes on ignorned tags
Ryan Lortie [Tue, 29 Oct 2013 16:01:32 +0000 (09:01 -0700)]
GMarkup: clear attributes on ignorned tags

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

10 years agogtk-notification-backend: remove unused variable
Lars Uebernickel [Tue, 29 Oct 2013 06:55:19 +0000 (23:55 -0700)]
gtk-notification-backend: remove unused variable

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

10 years agogio: Clear error properly to prevent crash
Ross Lagerwall [Tue, 29 Oct 2013 12:53:38 +0000 (14:53 +0200)]
gio: Clear error properly to prevent crash

https://bugzilla.gnome.org/show_bug.cgi?id=711070

10 years agoGCancellable: drop lock for callback during connect()
Ryan Lortie [Mon, 28 Oct 2013 18:44:16 +0000 (11:44 -0700)]
GCancellable: drop lock for callback during connect()

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

10 years agogio/gsubprocess.c: Use g_snprintf()
Chun-wei Fan [Tue, 29 Oct 2013 06:49:13 +0000 (14:49 +0800)]
gio/gsubprocess.c: Use g_snprintf()

snprintf() is unfortunately still not universally available, so use
g_snprintf() to ensure the build works on all platforms.

https://bugzilla.gnome.org/show_bug.cgi?id=711049

10 years agogobject/gvaluetransform.c: Cleanup #ifndef _MSC_VER
Chun-wei Fan [Tue, 29 Oct 2013 04:46:32 +0000 (12:46 +0800)]
gobject/gvaluetransform.c: Cleanup #ifndef _MSC_VER

The two casts that were unsupported with Visual Studio is now properly
supported, so build this code like how the other compilers build the code.

10 years agoGSettingsSchemaSource: fix parameter name in header
Ryan Lortie [Tue, 29 Oct 2013 03:48:53 +0000 (20:48 -0700)]
GSettingsSchemaSource: fix parameter name in header

list_schemas() had the parameters called 'recursive' and 'non-recursive'
in the header instead of 'relocatable'.  Fix that.

10 years agoexporter: give error on Describe of missing action
Ryan Lortie [Mon, 28 Oct 2013 21:49:14 +0000 (14:49 -0700)]
exporter: give error on Describe of missing action

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

10 years agoexporter: give error on Describe of missing action
Ryan Lortie [Mon, 28 Oct 2013 21:49:14 +0000 (14:49 -0700)]
exporter: give error on Describe of missing action

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

10 years agoGSimpleAction: don't allow changing state type
Ryan Lortie [Mon, 28 Oct 2013 21:59:26 +0000 (14:59 -0700)]
GSimpleAction: don't allow changing state type

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

10 years agoglib-compile-schemas: ignore qualified tags/attrs
Ryan Lortie [Mon, 28 Oct 2013 22:30:25 +0000 (15:30 -0700)]
glib-compile-schemas: ignore qualified tags/attrs

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

10 years agoGDBus: ignore qualified XML tags and attributes
Ryan Lortie [Mon, 28 Oct 2013 22:27:29 +0000 (15:27 -0700)]
GDBus: ignore qualified XML tags and attributes

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

10 years agotests: add a ignore-qualified markup-collect case
Ryan Lortie [Mon, 28 Oct 2013 21:11:05 +0000 (14:11 -0700)]
tests: add a ignore-qualified markup-collect case

Add a case to markup-collect that exercises the new IGNORE_QUALIFIED
flag.

https://bugzilla.gnome.org/show_bug.cgi?id=665634

10 years agoGMarkup: add G_MARKUP_IGNORE_QUALIFIED
Ryan Lortie [Mon, 28 Oct 2013 21:05:51 +0000 (14:05 -0700)]
GMarkup: add G_MARKUP_IGNORE_QUALIFIED

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

10 years agoGMarkup: share some common code for closing tags
Ryan Lortie [Mon, 28 Oct 2013 20:56:26 +0000 (13:56 -0700)]
GMarkup: share some common code for closing tags

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

10 years agotest: g_debug messages shouldn't affect g_assert_expected_messages
Stef Walter [Mon, 28 Oct 2013 09:12:29 +0000 (10:12 +0100)]
test: g_debug messages shouldn't affect g_assert_expected_messages

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

10 years agoGSettings: fix for loop in 'extends' functionality
Ryan Lortie [Mon, 28 Oct 2013 19:10:13 +0000 (12:10 -0700)]
GSettings: fix for loop in 'extends' functionality

Obvious mistake :(

10 years agogsettings(1): stop using deprecated APIs
Ryan Lortie [Mon, 28 Oct 2013 17:54:08 +0000 (10:54 -0700)]
gsettings(1): stop using deprecated APIs

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

10 years agogsettings(1): use global variables
Ryan Lortie [Mon, 28 Oct 2013 17:23:29 +0000 (10:23 -0700)]
gsettings(1): use global variables

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

10 years agoGSettingsSchemaKey: add introspection APIs
Ryan Lortie [Mon, 28 Oct 2013 00:03:04 +0000 (17:03 -0700)]
GSettingsSchemaKey: add introspection APIs

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

10 years agobump version
Ryan Lortie [Mon, 28 Oct 2013 17:23:29 +0000 (10:23 -0700)]
bump version

dconf needs the new version with read_user_value() on the backend API.

10 years agoGSettings: add getters for user/default value
Ryan Lortie [Sun, 27 Oct 2013 17:34:01 +0000 (10:34 -0700)]
GSettings: add getters for user/default value

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

10 years agoGSettings: small internal refactor
Ryan Lortie [Sun, 27 Oct 2013 17:33:08 +0000 (10:33 -0700)]
GSettings: small internal refactor

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

10 years agoGSettingsBackend: add read_user_value() API
Ryan Lortie [Sun, 27 Oct 2013 16:42:32 +0000 (09:42 -0700)]
GSettingsBackend: add read_user_value() API

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

10 years agogio: Remove an unused variable from Makefile.am
Philip Withnall [Mon, 28 Oct 2013 17:07:49 +0000 (17:07 +0000)]
gio: Remove an unused variable from Makefile.am

RESOLVER_LIBADD was not defined anywhere (its functionality has
migrated to NETWORK_LIBS instead).

10 years agodocs: Mention that generated code should not be kept
Emmanuele Bassi [Mon, 14 Oct 2013 18:41:54 +0000 (19:41 +0100)]
docs: Mention that generated code should not be kept

Code generated by gdbus-codegen should neither be checked in into
revision control, nor should be distributed.

https://bugzilla.gnome.org/show_bug.cgi?id=710133