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
Matthias Clasen [Sun, 27 Nov 2011 23:50:04 +0000 (18:50 -0500)]
Reduce excessive width
Matthias Clasen [Sun, 27 Nov 2011 23:46:57 +0000 (18:46 -0500)]
whitespace fix
Matthias Clasen [Sun, 27 Nov 2011 23:12:52 +0000 (18:12 -0500)]
Add some tests for links
Matthias Clasen [Sun, 27 Nov 2011 21:51:13 +0000 (16:51 -0500)]
Add parser roundtrip tests
Matthias Clasen [Sun, 27 Nov 2011 21:50:17 +0000 (16:50 -0500)]
GMenuMarkup: fixes uncovered by roundtrip testing
The print function was forgetting to emit type information for
attributes, and the parser was not handling types properly either.
Matthias Clasen [Sun, 27 Nov 2011 18:46:49 +0000 (13:46 -0500)]
Improve docs
Specify that g_menu_item_set_attribute_value consumes floating
@values.
Matthias Clasen [Sun, 27 Nov 2011 07:16:51 +0000 (02:16 -0500)]
GApplication: Add a menu example to the docs
Matthias Clasen [Sun, 27 Nov 2011 06:44:14 +0000 (01:44 -0500)]
GMenu: Enforce attribute name restrictions
The code assumes in various places that ':' does not occur
in attribute names. We are a little more strict than that,
and only allow lowercase ASCII, digits and '-'.
Matthias Clasen [Sun, 27 Nov 2011 06:16:39 +0000 (01:16 -0500)]
Reduce excessive width of gmenu.h
Matthias Clasen [Sun, 27 Nov 2011 06:06:17 +0000 (01:06 -0500)]
Match up a parameter name
Matthias Clasen [Sun, 27 Nov 2011 05:54:17 +0000 (00:54 -0500)]
Describe the org.gtk.Menus interface
Even though we consider the interface to be an implementation
detail, we should have internal documentation of the interface.
Matthias Clasen [Sun, 27 Nov 2011 05:52:51 +0000 (00:52 -0500)]
Describe the org.gtk.Actions interface
Even though we consider the interface to be an implementation
detail, we should have internal documentation for the interface.
Matthias Clasen [Sun, 27 Nov 2011 04:21:12 +0000 (23:21 -0500)]
Rename exporter APIs
There are no public 'exporter' objects, so don't allude to them
in the function names. At the same time, we want to make it clear
that these functions are D-Bus specific.
The new APIs are
g_action_group_dbus_export_start
g_action_group_dbus_export_query
g_action_group_dbus_export_stop
g_menu_model_dbus_export_start
g_menu_model_dbus_export_query
g_menu_model_dbus_export_stop
Matthias Clasen [Sun, 27 Nov 2011 02:44:46 +0000 (21:44 -0500)]
GActionGroup: Mention GMenuModel in the docs
Matthias Clasen [Sun, 27 Nov 2011 03:17:47 +0000 (22:17 -0500)]
Add g_application_set_menu
This adds ane asy way to export menu information alongside
the actions that are already exported by GApplication.
Ryan Lortie [Sat, 22 Oct 2011 03:51:48 +0000 (23:51 -0400)]
Add GMenuModel testcases
Ryan Lortie [Sat, 22 Oct 2011 02:49:54 +0000 (22:49 -0400)]
Add GMenuProxy
GMenuProxy can be used as a client-side wrapper
for the a menu model that has been exported on D-Bus.
Matthias Clasen [Sun, 27 Nov 2011 02:02:15 +0000 (21:02 -0500)]
Add GMenuModel D-Bus exporter
Matthias Clasen [Sun, 27 Nov 2011 03:00:48 +0000 (22:00 -0500)]
Add GMenu markup
These functions serialize and deserialize a GMenuModel
to and from XML.
Matthias Clasen [Sun, 27 Nov 2011 03:48:24 +0000 (22:48 -0500)]
Add GMenu
Matthias Clasen [Sun, 27 Nov 2011 03:46:51 +0000 (22:46 -0500)]
Add GMenuModel
Matthias Clasen [Sun, 27 Nov 2011 03:30:02 +0000 (22:30 -0500)]
GApplication: use GDBusActionGroup
instead of the internal version of the same
Ryan Lortie [Fri, 1 Jul 2011 01:41:30 +0000 (02:41 +0100)]
Add GDBusActionGroup
GDBusActionGroup can be used as a client-side wrapper
for the an action group that has been exported on D-Bus.
Ryan Lortie [Thu, 30 Jun 2011 09:40:51 +0000 (10:40 +0100)]
GApplication: port action client to new D-Bus API
for compatibility with GActionGroup exporter
Ryan Lortie [Thu, 30 Jun 2011 08:52:24 +0000 (09:52 +0100)]
GApplication: use GActionGroup exporter
instead of home-grown internal implementation of the same
Ryan Lortie [Wed, 29 Jun 2011 00:02:21 +0000 (01:02 +0100)]
Add GActionGroup D-Bus exporter
Ryan Lortie [Fri, 2 Dec 2011 21:22:13 +0000 (16:22 -0500)]
Revert "Use an XML blob for gapplication interface info"
This reverts commit
8013401f6e4edb01dd31b716c179806b55d4064b.
Ryan Lortie [Fri, 2 Dec 2011 21:22:01 +0000 (16:22 -0500)]
Revert "Forgot one interface..."
This reverts commit
30580bdca7764525a49899dd56dcdde25a300a21.
Matthias Clasen [Thu, 8 Dec 2011 01:41:33 +0000 (20:41 -0500)]
Updates
Matthias Clasen [Wed, 7 Dec 2011 19:36:56 +0000 (14:36 -0500)]
Clarify docs around main loop vfuncs
Mention that the vfuncs are no longer used, and tweak the
wording around what g_application_run() does.
https://bugzilla.gnome.org/show_bug.cgi?id=665391
David Zeuthen [Wed, 7 Dec 2011 15:25:24 +0000 (10:25 -0500)]
Bug 665733 – GDBusConnection holds lock while calling destroynotify
Fix this problem by always running the destroynotify from an idle.
https://bugzilla.gnome.org/show_bug.cgi?id=665733
Signed-off-by: David Zeuthen <davidz@redhat.com>
Philip Withnall [Tue, 6 Dec 2011 19:41:31 +0000 (19:41 +0000)]
unicode: Fix a few issues with G_UNICHAR_MAX_DECOMPOSITION_LENGTH
Raised by Matthias in bgo#665685 but which I didn't spot until after pushing
commit
3ac7c35656649b1d1fcf2ccaa670b854809d4cd8.
Renames G_UNICHAR_MAX_DECOMPOSITION_LEN to G_UNICHAR_MAX_DECOMPOSITION_LENGTH
and fixes a few documentation issues.
See: bgo#665685
Philip Withnall [Tue, 6 Dec 2011 18:30:43 +0000 (18:30 +0000)]
Bug 665685 — Add a #define for the max length of a Unicode decomposition
Add G_UNICHAR_MAX_DECOMPOSITION_LEN for the maximum length of the
decomposition of a single Unicode character.
Closes: bgo#665685
David Zeuthen [Tue, 6 Dec 2011 18:32:12 +0000 (13:32 -0500)]
GDBus: Note in docs that g_dbus_node_info_new_for_xml() is using GMarkup
This was discussed in bug 665634.
https://bugzilla.gnome.org/show_bug.cgi?id=665634
Signed-off-by: David Zeuthen <davidz@redhat.com>
David Zeuthen [Tue, 6 Dec 2011 18:29:01 +0000 (13:29 -0500)]
GDBus: fix link to D-Bus spec
Signed-off-by: David Zeuthen <davidz@redhat.com>
Behdad Esfahbod [Tue, 6 Dec 2011 18:20:39 +0000 (13:20 -0500)]
Minor doc fix.
Behdad Esfahbod [Tue, 6 Dec 2011 18:18:47 +0000 (13:18 -0500)]
Minor
Matthias Clasen [Tue, 6 Dec 2011 12:43:35 +0000 (07:43 -0500)]
Make the qsort_r check cross-compile friendly
Pointed out by Daniel Mack.
https://bugzilla.gnome.org/show_bug.cgi?id=665607
Benjamin Otte [Mon, 5 Dec 2011 21:40:18 +0000 (22:40 +0100)]
outputstream: Clarify docs of flush()
After questioning the semantics of flush on IRC, it seemed necessary to
clarify what flushing is supposed to do. The Linux man page for fflush()
seemed to cover it perfectly, so I just copied it.
I did not add the "via the underlying write mechanism" part as that in
my opinion is not something subclasses should need to guarantee.
Cosimo Alfarano [Wed, 19 Jan 2011 19:08:15 +0000 (19:08 +0000)]
Send CHANGES_DONE_HINT on file moves if no IN_CLOSE_WRITE is emitted
This patch makes GFileMonitor to emit EVENT_CHANGES_DONE_HINT when
EVENT_CREATED is emitted but the file is not opened for writing.
On file moves across different mounted volumes, inotify will always emit
IN_CREATE and IN_CLOSE_WRITE (plus other events).
This translates into GIO's _EVENT_CREATED and _EVENT_CHANGES_DONE_HINT.
On file moves across the same mounted volumes, inotify will emit
IN_MOVED_FROM/IN_MOVED_TO which will be translated into
_EVENT_DELETED/_EVENT_CREATED GIO's side. No _EVENT_CHANGES_DONE_HINT is
emited afterwards.
Under such circumstances a file indexer does not know when actually the
file is ready to be indexed, either waiting too much or triggering the
indexing twice. On small devices it's not advisable.
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=640077
Bug-NB: NB#219982
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Tomas Bzatek <tbzatek@redhat.com>
Simon McVittie [Mon, 28 Nov 2011 17:54:46 +0000 (17:54 +0000)]
GDBusConnection: propagate error correctly if flags are inappropriate
Previously, this would fail the assertion
"connection->initialization_error != NULL" after the label "out".
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=665067
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: David Zeuthen <davidz@redhat.com>
Sam Thursfield [Thu, 1 Dec 2011 15:48:27 +0000 (15:48 +0000)]
Link to libpcre correctly when static linking
https://bugzilla.gnome.org/show_bug.cgi?id=665298
Daniel Mustieles [Fri, 2 Dec 2011 17:27:07 +0000 (18:27 +0100)]
Updated Spanish translation
Tristan Van Berkom [Fri, 2 Dec 2011 16:20:21 +0000 (11:20 -0500)]
GDBusInterfaceSkeleton: make it possible to export on multiple connections
This is useful in peer-to-peer connections.
With minor changes by David Zeuthen <davidz@redhat.com>.
https://bugzilla.gnome.org/show_bug.cgi?id=662718
Signed-off-by: David Zeuthen <davidz@redhat.com>
Philip Withnall [Wed, 30 Nov 2011 10:20:13 +0000 (10:20 +0000)]
GVariant: add preconditions to ref. counting functions
These prevent GVariants from accidentally being brought back to life after
being freed, and should make it easier to track down ref. counting issues.
Closes: bgo#665184
Kjartan Maraas [Thu, 1 Dec 2011 17:01:02 +0000 (18:01 +0100)]
Updated Norwegian bokmål translation
Dan Winship [Thu, 1 Dec 2011 12:10:25 +0000 (13:10 +0100)]
GMemoryInputStream/GMemoryOutputStream: fix bug in previous commit
A g_input_stream_read_async() implementation can't call
g_input_stream_read() on itself directly because it will fail because
the pending flag is already set. So fix that by invoking the vmethod
directly rather than calling the wrapper. Likewise with
GMemoryOutputStream.
Add a test to gio/tests/memory-input-stream.c to catch read_async
failures in the future.
Dan Winship [Wed, 30 Nov 2011 09:32:42 +0000 (10:32 +0100)]
GMemoryInputStream/GMemoryOutputStream: make these properly subclassable
The async methods were directly invoking their own implementations of
the sync methods, making it impossible for a subclass to reimplement
them.
https://bugzilla.gnome.org/show_bug.cgi?id=664635
Matthias Clasen [Wed, 30 Nov 2011 03:53:50 +0000 (22:53 -0500)]
Don't abort if g_ascii_strtod tests fail
https://bugzilla.gnome.org/show_bug.cgi?id=652560
Geek87 [Mon, 25 Jul 2011 11:08:24 +0000 (13:08 +0200)]
Remove two useless lines of code
https://bugzilla.gnome.org/show_bug.cgi?id=648516