Simon McVittie [Tue, 13 Dec 2011 19:01:42 +0000 (19:01 +0000)]
various GLib tests: plug memory leaks
These don't really matter, since it's test code, but they do obscure
real leaks in the library.
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666115
Acked-by: Matthias Clasen <mclasen@redhat.com>
Simon McVittie [Mon, 12 Dec 2011 15:55:59 +0000 (15:55 +0000)]
testglib: test_file_functions: don't close fd if it's -1
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666115
Reviewed-by: Matthias Clasen <mclasen@redhat.com>
Simon McVittie [Wed, 14 Dec 2011 12:39:06 +0000 (12:39 +0000)]
Revert "g_menu_markup_start_element: tolerate not having a hash table of objects"
This reverts commit
bcdb60641196f98482b5e17fcc96a92589deba35,
accidentally pushed before it was reviewed.
Simon McVittie [Wed, 14 Dec 2011 12:31:31 +0000 (12:31 +0000)]
g_menu_markup_start_element: tolerate not having a hash table of objects
I don't know whether this is the right fix, but gio/tests/gmenumodel
crashes out, which can't be right.
Simon McVittie [Mon, 12 Dec 2011 18:58:03 +0000 (18:58 +0000)]
g_variant_byteswap: don't leak serialised.data
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Matthias Clasen <mclasen@redhat.com>
Simon McVittie [Tue, 13 Dec 2011 18:16:55 +0000 (18:16 +0000)]
GDBusActionGroup: don't leak param_str
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Matthias Clasen <mclasen@redhat.com>
Simon McVittie [Tue, 13 Dec 2011 14:44:18 +0000 (14:44 +0000)]
g_data_set_internal: avoid use-after-free if datalist is in dataset
Removing the last thing in a dataset frees the dataset, and if the
datalist was in a dataset, we can't safely unlock it after the dataset
has been freed. Unlock it sooner.
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Matthias Clasen <mclasen@redhat.com>
Simon McVittie [Mon, 12 Dec 2011 18:37:10 +0000 (18:37 +0000)]
g_strcompress: check that source is non-NULL rather than just crashing
Calling this function with a NULL argument is considered to be invalid,
but one of the regression tests does it anyway (to watch it crash), which
seems a good indication that it's expected to be somewhat common.
Let's check it rather than segfaulting.
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
Reviewed-by: Matthias Clasen <mclasen@redhat.com>
Simon McVittie [Tue, 13 Dec 2011 18:17:13 +0000 (18:17 +0000)]
g_dbus_action_group_changed: don't leak iterator and its contents
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
Simon McVittie [Mon, 12 Dec 2011 18:35:14 +0000 (18:35 +0000)]
GKeyFile: free group comments when the group is removed
These were leaked. Valgrind was sad.
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
Simon McVittie [Mon, 12 Dec 2011 18:34:47 +0000 (18:34 +0000)]
g_hmac_get_string: don't allocate and leak an unused buffer
Also document why we're not actually using the buffer for anything.
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
Simon McVittie [Mon, 12 Dec 2011 15:54:50 +0000 (15:54 +0000)]
g_hmac_copy: initialize the refcount
In practice, the uninitialized refcount will typically mean that the copy is
never freed, and leaks.
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
Matthias Clasen [Wed, 14 Dec 2011 12:16:04 +0000 (07:16 -0500)]
Add an explicit deprecation note to g_thread_init
https://bugzilla.gnome.org/show_bug.cgi?id=666145
Matthias Clasen [Wed, 14 Dec 2011 05:10:34 +0000 (00:10 -0500)]
Add another menu parser test
This one concerns itself with objects.
Matthias Clasen [Wed, 14 Dec 2011 04:16:25 +0000 (23:16 -0500)]
GMenuModel: Flesh out the docs some more
Matthias Clasen [Wed, 14 Dec 2011 04:06:16 +0000 (23:06 -0500)]
GMenu: purge references to GMenuProxy from the docs
Stef Walter [Wed, 14 Dec 2011 04:00:16 +0000 (23:00 -0500)]
documentation fixes
Fixes for gtk-doc warnings.
http://bugzilla.gnome.org/show_bug.cgi?id=66469
https://bugzilla.gnome.org/show_bug.cgi?id=664699
Matthias Clasen [Tue, 13 Dec 2011 17:56:20 +0000 (12:56 -0500)]
Improve GNetworkMonitor docs
Make sure we get signal and property docs, and mention
the extension point in the overview.
Christophe Fergeau [Mon, 12 Dec 2011 14:06:41 +0000 (15:06 +0100)]
gnetworkmonitornetlink.c: Fix compilation on RHEL 6.2
When trying to compile glib master on a RHEL 6.2 system, it fails with:
make[4]: Entering directory `/home/teuf/gnome/src/glib/gio'
CC libgio_2_0_la-gnetworkmonitornetlink.lo
In file included from gnetworkmonitornetlink.c:25:
/usr/include/linux/netlink.h:35: error: expected specifier-qualifier-list before 'sa_family_t'
gnetworkmonitornetlink.c: In function 'g_network_monitor_netlink_initable_init':
gnetworkmonitornetlink.c:99: error: 'struct sockaddr_nl' has no member named 'nl_family'
gnetworkmonitornetlink.c:100: error: 'struct sockaddr_nl' has no member named 'nl_pid'
gnetworkmonitornetlink.c:100: error: 'struct sockaddr_nl' has no member named 'nl_pad'
gnetworkmonitornetlink.c:101: error: 'struct sockaddr_nl' has no member named 'nl_groups'
make[4]: *** [libgio_2_0_la-gnetworkmonitornetlink.lo] Error 1
sa_family_t is defined in sys/socket.h, this commit makes sure this header is included before netlink.h
This fixes bgo bug #666001
Ryan Lortie [Tue, 13 Dec 2011 14:16:51 +0000 (09:16 -0500)]
bump version
Chun-wei Fan [Tue, 13 Dec 2011 04:12:48 +0000 (12:12 +0800)]
Update VS property sheets
"Install" the newly-added public headers in GLib and GIO, such as the ones
for GMenuModel, etc.
Alexandre Franke [Mon, 12 Dec 2011 19:36:29 +0000 (20:36 +0100)]
Fix wording
délai épuisé has been replaced with délai dépassé
Ryan Lortie [Mon, 12 Dec 2011 18:28:24 +0000 (13:28 -0500)]
glib 2.31.4
Ryan Lortie [Mon, 12 Dec 2011 18:28:09 +0000 (13:28 -0500)]
GActionGroupExporter: stop using signal IDs
GDBusConnection recently changed to dispatching its GDestroyNotify calls
from an idle instead of on-the-spot. Under the previous regime, we
would destroy-notify the action group export of a GtkApplicationWindow
at the point it was removed from the application (ie: slightly before
being disposed).
With the destroy notify now deferred to an idle, the window has already
been disposed, so the signal handlers have already been disconnected.
Avoid the problem by dropping our use of signal IDs and just do
g_signal_handlers_disconnect_by_func(), which doesn't complain if there
is no connection.
Ryan Lortie [Mon, 12 Dec 2011 18:13:42 +0000 (13:13 -0500)]
GMenuMarkup parser: small typo fix in docs
Ryan Lortie [Mon, 12 Dec 2011 18:08:48 +0000 (13:08 -0500)]
More clearly define 'named menu' in the XML parser
This is when menus have id='' attributes.
Ryan Lortie [Mon, 12 Dec 2011 18:07:04 +0000 (13:07 -0500)]
GMenu parser: use G_MARKUP_COLLECT_BOOLEAN
...instead of trying to parse the boolean for ourselves.
Ryan Lortie [Mon, 12 Dec 2011 15:43:54 +0000 (10:43 -0500)]
update maintainers in glib.doap
(at request of sysadmin team)
Matthias Clasen [Mon, 12 Dec 2011 06:44:41 +0000 (01:44 -0500)]
GApplication: fix a copy-paste error
Activating an action must not turn into a change-state request.
Matthias Clasen [Mon, 12 Dec 2011 05:01:20 +0000 (00:01 -0500)]
Rearrange GApplication long desc a bit
Matthias Clasen [Mon, 12 Dec 2011 05:00:16 +0000 (00:00 -0500)]
Expand actiongroup docs a bit more
Matthias Clasen [Sun, 11 Dec 2011 17:05:23 +0000 (12:05 -0500)]
Fix an assertion when activating apps a second time
This was causing the following critical when running bloatpad twice:
GLib-CRITICAL **: g_hash_table_insert_internal: assertion `hash_table != NULL' failed
Matthias Clasen [Sun, 11 Dec 2011 03:14:34 +0000 (22:14 -0500)]
Add some more since tags
Matthias Clasen [Sun, 11 Dec 2011 02:55:11 +0000 (21:55 -0500)]
Add a since tag
Matthias Clasen [Sun, 11 Dec 2011 02:49:10 +0000 (21:49 -0500)]
Fix since tag
Matthias Clasen [Sun, 11 Dec 2011 02:46:13 +0000 (21:46 -0500)]
Whitespace fixes
And add some missing since tags.
Matthias Clasen [Sun, 11 Dec 2011 02:42:49 +0000 (21:42 -0500)]
Add g_application_set/get_default to the docs
Matthias Clasen [Sun, 11 Dec 2011 01:47:22 +0000 (20:47 -0500)]
Add since tags
Ryan Lortie [Sat, 10 Dec 2011 22:21:53 +0000 (17:21 -0500)]
Clean up GApplication docs
Clean up the docs for GApplication and related classes.
I'm no longer writing documentation for the structure type of classes
and interfaces. See https://bugzilla.gnome.org/show_bug.cgi?id=665926
for discussin on the correct way forward on this point.
Also: stop putting gtk-doc comments in installed headers.
Ryan Lortie [Sat, 10 Dec 2011 19:06:18 +0000 (14:06 -0500)]
GDate: gtk-doc fixup
Seong-ho, Cho [Sat, 10 Dec 2011 14:32:23 +0000 (23:32 +0900)]
Updated Korean translation
Yaron Shahrabani [Sat, 10 Dec 2011 09:03:08 +0000 (11:03 +0200)]
Updated Hebrew translation.
Colin Walters [Fri, 9 Dec 2011 16:13:23 +0000 (11:13 -0500)]
gfile: Don't use C++ keyword "template" as variable name
This breaks autotestkeyword.cc from gtk+.
Aleksander Morgado [Fri, 9 Dec 2011 11:11:53 +0000 (12:11 +0100)]
gdbus-codegen: fix typo in generated documentation
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=665858
Thomas Hindoe Paaboel Andersen [Thu, 8 Dec 2011 22:17:07 +0000 (23:17 +0100)]
GFile: add g_file_new_temp
A convenience function that creates a temporary file and returns
a GFile and GFileIOStream for it.
The file is created using g_file_open_tmp.
https://bugzilla.gnome.org/show_bug.cgi?id=657085
Matthias Clasen [Fri, 9 Dec 2011 13:01:12 +0000 (08:01 -0500)]
Cosmetic doc change
Piotr Drąg [Fri, 9 Dec 2011 11:55:40 +0000 (12:55 +0100)]
Updated POTFILES.in
Matthias Clasen [Fri, 9 Dec 2011 04:44:30 +0000 (23:44 -0500)]
GApplication: Make ::startup run-first
https://bugzilla.gnome.org/show_bug.cgi?id=665817
Matthias Clasen [Fri, 9 Dec 2011 03:00:24 +0000 (22:00 -0500)]
Updates
Ryan Lortie [Thu, 8 Dec 2011 22:52:10 +0000 (17:52 -0500)]
gio.symbols fixes
Ryan Lortie [Thu, 8 Dec 2011 22:49:01 +0000 (17:49 -0500)]
GDBusActionGroup: make API just like GDBusMenuModel
Have one simple _get() API that returns the group immediately, in an
empty state. The group is initialised on the first attempt to interact
with it.
Leave a secret 'back door' for GApplication to do a blocking
initialisation.
Ryan Lortie [Thu, 8 Dec 2011 21:06:01 +0000 (16:06 -0500)]
GDBusActionGroup: drop ability to 'inject'
Also drop the GDBusActionGroupFlags that were only meant to facilitate
injection-based usage.
Matthias Clasen [Thu, 8 Dec 2011 05:46:03 +0000 (00:46 -0500)]
More documentation fixes
Matthias Clasen [Thu, 8 Dec 2011 05:31:23 +0000 (00:31 -0500)]
Fix up docs
Matthias Clasen [Thu, 8 Dec 2011 03:31:10 +0000 (22:31 -0500)]
Don't use deprecated GApplication api in examples
Ryan Lortie [Thu, 8 Dec 2011 02:22:51 +0000 (21:22 -0500)]
GDBusMenuModel: become thread-aware
Allow imports of the same menu on multiple different main contexts at
the same time by creating a separate object for each context.
Ryan Lortie [Thu, 8 Dec 2011 02:10:18 +0000 (21:10 -0500)]
menu threaded test: run the mainloop after export
GDBusConnection now dispatches GDestroyNotify calls back to the
mainloop. Adding an idle to the mainloop is O(n) in the number of idles
already there. We therefore need to periodically empty the mainloop to
avoid quadratic behaviour with a very large 'n'.
Ryan Lortie [Thu, 8 Dec 2011 02:05:38 +0000 (21:05 -0500)]
Rename GMenuProxy to GDBusMenuModel
This improves consistency with GDBusActionGroup.
Ryan Lortie [Thu, 8 Dec 2011 01:39:23 +0000 (20:39 -0500)]
action exporter: clarify threading situation
Exporting can only be done relative to a particular given main context
and all interaction with the action group must be on that same context.
Fix up the implementation so that the user can specify that context with
the normal (thread default) mechanism and document the limitation on the
API.
Adjust the testcase to adhere to the documentation limitations. It
passes now.
Ryan Lortie [Thu, 8 Dec 2011 01:23:41 +0000 (20:23 -0500)]
action exporter: use GSource* instead of source id
Keep track of the GSource* of our event dispatch idle instead of using
source ID.
Ryan Lortie [Wed, 7 Dec 2011 19:43:50 +0000 (14:43 -0500)]
action exporter: cancel pending events on unexport
If there are events pending when we unexport the action group, free them
and cancel the pending idle.
Ryan Lortie [Wed, 7 Dec 2011 15:35:29 +0000 (10:35 -0500)]
GMenuModel exporter: remove workaround
With Bug 665733 fixed, we can remove the workaround (which was causing
thread safety problems).
Matthias Clasen [Wed, 7 Dec 2011 05:58:01 +0000 (00:58 -0500)]
Add testcase for threaded menu exporter use
This currently fails
Matthias Clasen [Wed, 7 Dec 2011 05:43:49 +0000 (00:43 -0500)]
Add a test for multithreaded action group exporter use
Ryan Lortie [Mon, 5 Dec 2011 02:33:55 +0000 (21:33 -0500)]
GApplication dbus: publish the menus again
Matthias Clasen [Sun, 4 Dec 2011 03:26:59 +0000 (22:26 -0500)]
Fully implement app-menu and menubar properties
Ryan Lortie [Sat, 3 Dec 2011 22:17:13 +0000 (17:17 -0500)]
GApplication: make menu properties readwrite
Otherwise the notify signals won't be emitted.
Ryan Lortie [Fri, 2 Dec 2011 22:47:34 +0000 (17:47 -0500)]
menumodel test: don't get stuck in a loop
Sometimes randa and randb end up having the same state, causing them to
return the same stream of 'random numbers'. This is a problem for the
testcase that is looping to find unequal menus.
If we find ourselves in this state, throw one of the random generators
away and recreate it so we have a better chance of getting some unequal
menus.
Ryan Lortie [Fri, 2 Dec 2011 21:50:09 +0000 (16:50 -0500)]
menu/action exporter docs fixup
Ryan Lortie [Fri, 2 Dec 2011 21:29:28 +0000 (16:29 -0500)]
gio symbol cleanups
Ryan Lortie [Fri, 2 Dec 2011 20:36:15 +0000 (15:36 -0500)]
Menu model exporter: clean up the API
Give it the same treatment as the exporter for GActionGroup just got.
There is a wart here: the exporter attempt to re-enter GDBusConnection
when it is freed in order to cancel outstanding name watches.
GDBusConnection holds its own lock while calling the destroy notify, so
the attempt at reentrancy results in a deadlock.
We have a workaround to deal with that for now...
Ryan Lortie [Fri, 2 Dec 2011 20:17:56 +0000 (15:17 -0500)]
GApplication: menu can change after registration
Allow the menu to be changed after registration. This is quite useful
for setting up the menus from the ::startup handler instead of having to
do it before registration because it lets you skip the work if you're
not the primary instance.
Ryan Lortie [Fri, 2 Dec 2011 20:04:53 +0000 (15:04 -0500)]
Action group exporter: clean up the API
Make it look more like a typical GDBusConnection API with integer
registration ID and corresponding unexport call. Kill the 'query' call.
Ryan Lortie [Fri, 2 Dec 2011 19:24:17 +0000 (14:24 -0500)]
GApplication: simplify dbus impl
The error handling on register() was just totally out of hand before.
Clean that mess up.
Take out the menu export for now as well. It will be added back again
later.
Ryan Lortie [Fri, 2 Dec 2011 16:19:18 +0000 (11:19 -0500)]
GApplication dbus: use XML for introspection
The hand-written structures are hard to read and cause quite a lot of
relocations at library load time. Avoid that.
Ryan Lortie [Fri, 2 Dec 2011 15:32:28 +0000 (10:32 -0500)]
GApplication: implement GActionMap
and deprecate g_application_set_action_group().
Ryan Lortie [Fri, 2 Dec 2011 03:53:07 +0000 (22:53 -0500)]
Fix some GMenu and GMenuItem leaking
Ryan Lortie [Thu, 1 Dec 2011 17:14:04 +0000 (12:14 -0500)]
GApplication: make distinction about menus
Rename g_application_set_menu to g_application_set_app_menu and make a
couple of fixups. Clarify the documentation about exactly what this
menu is meant to be.
Add g_application_set_menubar and document that as well.
Colin Walters [Thu, 1 Dec 2011 14:38:04 +0000 (09:38 -0500)]
gsimpleaction: Ensure actions are enabled
Matthias Clasen [Thu, 1 Dec 2011 04:19:35 +0000 (23:19 -0500)]
Include gactionmap.h in gio.h
Matthias Clasen [Thu, 1 Dec 2011 00:04:08 +0000 (19:04 -0500)]
Minor doc improvements
Matthias Clasen [Thu, 1 Dec 2011 00:03:41 +0000 (19:03 -0500)]
Add GActionMap to the docs
Colin Walters [Wed, 30 Nov 2011 22:26:59 +0000 (17:26 -0500)]
GSimpleAction: Fix to comply with constructor rules
foo_new_*() must be pure wrappers around g_object_new(), otherwise
their functionality is inaccessible to bindings.
Ryan Lortie [Wed, 30 Nov 2011 16:36:08 +0000 (11:36 -0500)]
add GActionMap interface
This is an interface to represent GSimpleActionGroup-like objects (ie:
those GActionGroups that operate by containing a number of named GAction
instances).
Ryan Lortie [Tue, 29 Nov 2011 13:18:38 +0000 (08:18 -0500)]
gmenu exporter: put submenus in separate groups
Keep sections in the same subscription group as the parent (since they
will be needed immediately) but put submenus in a separate group.
Ryan Lortie [Tue, 29 Nov 2011 13:16:19 +0000 (08:16 -0500)]
menu tests: keep mirror of proxy
Create a 'mirror' model of the proxy for the testcase. In addition to
testing that the proxy model emits the proper signals this also keeps
the proxy alive (by holding references to it from the mirror).
The previous code would create the submenu proxies and destroy them
right away (from the recursive step in the equality comparison
functions). This means that the subscription would go out over D-Bus
and the proxy would be destroyed before it returned. Keeping the model
alive allows it to be actually updated.
Matthias Clasen [Tue, 29 Nov 2011 01:37:07 +0000 (20:37 -0500)]
Shorten a variable name
Matthias Clasen [Mon, 28 Nov 2011 23:34:08 +0000 (18:34 -0500)]
Expand dbus action group tests
The new tests check that activation and state changes propagate
back.
Matthias Clasen [Mon, 28 Nov 2011 23:13:16 +0000 (18:13 -0500)]
Some more assertions
Matthias Clasen [Mon, 28 Nov 2011 23:12:46 +0000 (18:12 -0500)]
Add some dbus action group tests
Matthias Clasen [Mon, 28 Nov 2011 23:12:17 +0000 (18:12 -0500)]
Fix the dbus action group query_action implementation
Matthias Clasen [Mon, 28 Nov 2011 23:11:25 +0000 (18:11 -0500)]
Make stopping an action group export work
Ryan Lortie [Mon, 28 Nov 2011 16:45:20 +0000 (11:45 -0500)]
rework GMenuProxy links
Only resolve the link at the point that we pull it through the API
rather than at the point that we first are told about it. This reduces
the lifespan of subscriptions and, more importantly, avoids a tricky
reference cycle issue.
Ryan Lortie [Mon, 28 Nov 2011 16:44:25 +0000 (11:44 -0500)]
g_menu_model_get_item_link: be careful with refs
Don't unref the hashtable until after we already take the ref on the
value that was contained in the hashtable, otherwise we may kill the
value.
Matthias Clasen [Mon, 28 Nov 2011 15:22:25 +0000 (10:22 -0500)]
Add debug code
This adds a dump method to show the entire tree of proxies.
Matthias Clasen [Mon, 28 Nov 2011 12:51:57 +0000 (07:51 -0500)]
Avoid cross-talk between tests
Each test needs to remove the sources that it attaches
to the default main context, or else things will work
fine in isolation, but go bad in a full test run.
Matthias Clasen [Mon, 28 Nov 2011 12:40:55 +0000 (07:40 -0500)]
Typo fix
Matthias Clasen [Mon, 28 Nov 2011 05:18:39 +0000 (00:18 -0500)]
Remove unused variable
Matthias Clasen [Mon, 28 Nov 2011 04:28:53 +0000 (23:28 -0500)]
Add a test for menu subscriptions
Matthias Clasen [Sun, 27 Nov 2011 23:52:15 +0000 (18:52 -0500)]
Take out excessive width