Commit Graph

2919 Commits

Author SHA1 Message Date
Ryan Lortie
d683c201f9 tests for GSettings action binding
https://bugzilla.gnome.org/show_bug.cgi?id=668279
2012-01-19 10:50:29 -05:00
Ryan Lortie
1d98d18f64 add a way to create a GAction from GSettings
g_settings_create_action() will create a GAction for the named key,
allowing it to be added to the action group of the application (so that
the setting can be directly manipulated from menus, for example).

https://bugzilla.gnome.org/show_bug.cgi?id=668279
2012-01-19 10:50:29 -05:00
Murray Cumming
41fbf42c3c gioenums.h: Remove a trailing comma. 2012-01-19 16:18:05 +01:00
Ryan Lortie
c95e908529 GSettingsSchema: ignore empty schema caches
glib-compile-schemas used to generate these.  They're harmless and they
mean that no schemas are installed in a particular directory, so just
ignore them.

https://bugzilla.gnome.org/show_bug.cgi?id=656301
2012-01-18 22:16:23 -05:00
Christian Persch
d8b295abb3 resources: Plug mem leaks in resource compiler
==13007== 173 bytes in 1 blocks are definitely lost in loss record 90 of 106
==13007==    at 0x402AD89: malloc (vg_replace_malloc.c:236)
==13007==    by 0x407DDBA: standard_malloc (gmem.c:85)
==13007==    by 0x407E318: g_try_malloc (gmem.c:271)
==13007==    by 0x40654DE: g_file_get_contents (gfileutils.c:756)
==13007==    by 0x804A531: main (glib-compile-resources.c:580)

==13007== 521 (56 direct, 465 indirect) bytes in 1 blocks are definitely lost in loss record 100 of 106
==13007==    at 0x402AD89: malloc (vg_replace_malloc.c:236)
==13007==    by 0x407DDBA: standard_malloc (gmem.c:85)
==13007==    by 0x407E160: g_malloc (gmem.c:159)
==13007==    by 0x4091D8D: g_slice_alloc (gslice.c:1003)
==13007==    by 0x40674A1: g_hash_table_new_full (ghash.c:676)
==13007==    by 0x804B252: gvdb_hash_table_new (gvdb-builder.c:76)
==13007==    by 0x43C66B2: (below main) (libc-start.c:226)
2012-01-18 19:43:17 +01:00
Ryan Lortie
54b986d918 GApplication: drop support for appmenu/menubars
This has been moved over to GtkApplication now.

https://bugzilla.gnome.org/show_bug.cgi?id=668118
2012-01-18 13:39:22 -05:00
Dan Winship
7a2e6ab791 update .gitignores 2012-01-18 13:28:00 -05:00
Dan Winship
da9d98728d Fix glib-compile-resources usage when cross-compiling
Copy the behavior of glib-genmarshal: require an installed copy of it,
and use that rather than the built copy.
2012-01-18 12:07:11 -05:00
Will Thompson
7a0bddd768 GDBusConnection: note that exit-on-close is sometimes TRUE
g_bus_get_finish() and g_bus_get_sync() both document that the returned
object will usually have exit-on-close set to TRUE, but the property's
documentation specified that its default is FALSE. While that's
technically true from a GObject perspective, it's not accurate from the
API user's perspective.

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

Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: David Zeuthen <zeuthen@gmail.com>
2012-01-18 16:16:58 +00:00
Xavier Claessens
d077b66ee9 GUnixConnection: add async variant for send/receive_credentials()
https://bugzilla.gnome.org/show_bug.cgi?id=629503
2012-01-18 15:21:56 +01:00
Dan Winship
08036ce303 gsocket: make this compile on Windows again
https://bugzilla.gnome.org/show_bug.cgi?id=668071
2012-01-17 19:46:57 -05:00
Alexander Larsson
d825828b7b resources: Skip initial underscores in resource section names
Initial underscores are used in c identifier to make them private,
for instance in Gtk+. However, we don't want to have this in the
resource section name, that just looks ugly.
2012-01-17 12:32:37 +01:00
Dan Winship
7dfbe5aa30 gsocket: Use alternate IPv6 multicast group sockopt names
Apparently IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP are more portable than
IPV6_ADD_MEMBERSHIP and IPV6_DROP_MEMBERSHIP. (Windows and Linux have
both, but OS X only has the latter.)
2012-01-16 17:16:40 -05:00
Dan Winship
bf7408c30b GInetSocketAddress: add IPv6 flowinfo and scope_id fields
struct sin6_addr has two additional fields that struct sin_addr
doesn't. Add support for those to GInetSocketAddress, and make sure
they don't get lost when converting between glib and native types.

https://bugzilla.gnome.org/show_bug.cgi?id=635554
2012-01-16 13:37:02 -05:00
Dan Winship
c71fc7477e ginetaddress.c: fix an incorrect enum name in the docs 2012-01-16 13:37:02 -05:00
Sebastian Dröge
76f46b4f33 GSocket: Use correct type for SO_BROADCAST parameter 2012-01-16 19:22:28 +01:00
Sebastian Dröge
d44bb6ef64 GSocket: Reset the timeout in the GSocket GSource after it was triggered
https://bugzilla.gnome.org/show_bug.cgi?id=667989
2012-01-16 18:41:40 +01:00
Ole André Vadla Ravnås
fbdb8128dc GSocket: Add function to get the currently available bytes for reading
https://bugzilla.gnome.org/show_bug.cgi?id=668009
2012-01-16 18:41:40 +01:00
Sebastian Dröge
ffb5f8b101 GSocket: Add function to set/get the broadcast setting on a socket
https://bugzilla.gnome.org/show_bug.cgi?id=623187
2012-01-16 18:41:40 +01:00
Sebastian Dröge
5560d9b880 GSocket: Add function for setting unicast TTL 2012-01-16 18:41:40 +01:00
Sebastian Dröge
03b40522df GSocket: Add support for source-specific multicast (RFC 4604) 2012-01-16 18:41:40 +01:00
Sebastian Dröge
97f25892ea GSocket: Add possibility to join a multicast group only on a specific interface 2012-01-16 18:41:40 +01:00
Dan Winship
a62d1bb747 GSocket: Add multicast-related functions
Add APIs for sending and receiving multicast datagrams with GSocket.

Based on an earlier patch from Olivier Chalouhi.

https://bugzilla.gnome.org/show_bug.cgi?id=626589
2012-01-16 18:41:40 +01:00
Dan Winship
afe7a2d136 GAsyncInitable: fix subclassibility
If a class implements GAsyncInitable, and its parent also implements
it, then the subclass needs to call its parent's init_async() before
running its own. This was made more complicated by the fact that the
default init_finish() behavior was handled by the wrapper method
(which can't be used when making the super call) rather than the
default implementation itself. Fix that.

https://bugzilla.gnome.org/show_bug.cgi?id=667375
2012-01-16 09:42:50 -05:00
Alexander Larsson
feb120eb40 Fix typo
registred_resources -> registered_resources
2012-01-16 10:38:35 +01:00
Christian Persch
87dc862408 Ensure to generate a flags GType for empty Flags enums
When the flags enum only has the default NONE = 0 entry, glib-mkenums
creates an enum type for it, not a flags type. Add an annotation to the
enum to ensure the correct GType is created.

Bug #667938.
2012-01-15 13:03:16 +01:00
Christian Persch
b717ef86ad resources: Use g_set_error_literal where appropriate 2012-01-15 13:03:09 +01:00
Christian Persch
870fc484d9 Add missing Since: docs 2012-01-15 13:02:59 +01:00
Rico Tzschichholz
0fd61489e5 gio/tests: Fix out-of-source build and use uninstalled libraries 2012-01-14 11:18:07 +01:00
Rico Tzschichholz
86cd3018e0 gio/tests: add some missing files to EXTRA_DIST 2012-01-13 23:48:12 +01:00
Rico Tzschichholz
e3fe256692 gio: Fix for -Wformat-security 2012-01-13 23:18:01 +01:00
Rico Tzschichholz
8735f53ae4 tests: Fix build failure of resources by linking against libgmodule-2.0.la 2012-01-13 22:35:44 +01:00
Alexander Larsson
056cec779a Add GResource functions to gio.symbols 2012-01-13 17:12:57 +01:00
Alexander Larsson
e041843b3e Support resource:/// uris 2012-01-13 17:12:57 +01:00
Alexander Larsson
75439298f8 Add tests for GResource 2012-01-13 17:12:53 +01:00
Alexander Larsson
827657491d Initial version of glib-compile-resources
This is the basic utility to create resource files, either binary
versions or source files that can be compiled into your app.
2012-01-13 17:12:50 +01:00
Alexander Larsson
b87cf49163 Initial version of GResource
GResource is a bundle of files combined into a single binary blog.
The API lets you access the files the resource contains by
using resource paths. You can also register resources with a
global list and access these globally in a merged resource namespace.

The normal way this is used is to link in the resources into your
application/library and have it be automatically registred.

Resources are compiled from an xml description using
glib-compile-resources.
2012-01-13 17:12:45 +01:00
Alexander Larsson
d85b722734 Merge remote-tracking branch 'gvdb/master' 2012-01-13 16:12:56 +01:00
Evan Nemerson
c3d6595f5a GIO: add lots of annotations for Vala bindings
https://bugzilla.gnome.org/show_bug.cgi?id=667447
2012-01-11 15:50:08 -05:00
Philip Withnall
e98f17e5cf Bug 666700 — Add some missing (allow-none) annotations
Add some missing (allow-none) annotations to GContentType, GIcon and
GHashTable methods.

Closes: bgo#666700
2012-01-11 20:48:29 +00:00
Matthias Clasen
00c00e2f3f Add G_FILE_ATTRIBUTE_FILESYSTEM_USED to get exact used space
This is implemented by with statfs_buffer.f_bavail (free blocks
for unprivileged users) as a default way to retrieve real free space.
Based on a patch by Marcus Carlson, bug 625751.
2012-01-09 21:49:08 -05:00
Matthias Clasen
31960257a6 Make glocalfile.c more readable
The many nested ifdefs here really deserve some annotations.
Based on a patch by Marcus Carlson, bug 625751.
2012-01-09 21:35:13 -05:00
Ravi Sankar Guntur
0ed2cdb0d9 Use g_queue_free_full() convenience function.
https://bugzilla.gnome.org/show_bug.cgi?id=667331

Signed-off-by: Ravi Sankar Guntur <ravi.g@samsung.com>
2012-01-09 19:27:39 -05:00
Nguyễn Thái Ngọc Duy
b87f6f9f8c gio/gsocks5proxy: typo fix 2012-01-06 16:58:57 +07:00
Dan Winship
0da8db52cd Remove some cruft from an older version of the code 2012-01-05 12:57:18 -05:00
Michael Terry
382341dd99 gdesktopappinfo: Fix gtk-doc to mention Keywords not X-GNOME-Keywords
https://bugzilla.gnome.org/show_bug.cgi?id=667285
2012-01-05 11:19:22 -05:00
Javier Jardón
c735b54a63 gio/*: Use g_slist_free_full() convenience function 2012-01-05 04:57:47 +01:00
Michael Terry
31c3082e19 gdesktopappinfo: Avoid crash by NULL-ing data.pid_envvar before launch
https://bugzilla.gnome.org/show_bug.cgi?id=667279
2012-01-04 13:08:56 -05:00
Claudio Saavedra
8b96fb3761 GSocket: fix a couple of return values
g_socket_receive_with_blocking() and g_socket_send_with_blocking claim
to return -1 in error, their return type is gssize, and yet they
return FALSE if the initial g_return_val_if_fail() call fails.

https://bugzilla.gnome.org/show_bug.cgi?id=667226
2012-01-04 18:14:00 +02:00
Claudio Saavedra
f38a1dbca7 GSocket: add some more g_return_if_fail()s
https://bugzilla.gnome.org/show_bug.cgi?id=667225
2012-01-04 18:13:10 +02:00
Javier Jardón
928d2cea61 gio/*: Use g_list_free_full() convenience function 2012-01-03 16:53:47 +01:00
Javier Jardón
dde3401122 gio/gdbus-2.0/codegen/codegen.py: Use g_list_free_full() 2012-01-03 16:53:47 +01:00
Javier Jardón
ee044fd839 gio/tests: Use g_list_free_full() convenience function 2012-01-02 23:18:22 +01:00
Simon McVittie
34e3881f2f Add test for GDBusConnection singleton access racing with destruction
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=665211
2012-01-02 12:29:57 -05:00
Simon McVittie
1e09bfc77c GDBusConnection: use GWeakRef to make the singletons thread-safe
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=665211

https://bugzilla.gnome.org/show_bug.cgi?id=548954
2012-01-02 12:23:24 -05:00
William Hua
a07e9a5fb2 nextstep gsettings backend: whitespace police 2012-01-01 22:01:47 -05:00
William Hua
edd2aff575 thread-safe nextstep gsettings backend
simplified key reset logic
2012-01-01 21:59:39 -05:00
William Hua
9c10083844 GSettings: nextstep settings backend 2012-01-01 19:40:56 -05:00
Xan Lopez
00f43b22e5 ginetaddressmask: plug leak
==24706== 52 bytes in 1 blocks are definitely lost in loss record 7,248 of 13,092
==24706==    at 0x4A074CD: malloc (vg_replace_malloc.c:236)
==24706==    by 0x70E9F5F: standard_malloc (gmem.c:85)
==24706==    by 0x70E9FE8: g_malloc (gmem.c:159)
==24706==    by 0x71018EC: g_slice_alloc (gslice.c:1003)
==24706==    by 0x710192B: g_slice_alloc0 (gslice.c:1029)
==24706==    by 0x7068526: g_type_create_instance (gtype.c:1872)
==24706==    by 0x705067B: g_object_constructor (gobject.c:1835)
==24706==    by 0x704FE47: g_object_newv (gobject.c:1699)
==24706==    by 0x7050612: g_object_new_valist (gobject.c:1816)
==24706==    by 0x704F894: g_object_new (gobject.c:1531)
==24706==    by 0x6F0F2F0: g_inet_address_new_from_bytes (ginetaddress.c:459)
==24706==    by 0x6F5D703: remove_network (gnetworkmonitornetlink.c:256)
==24706==    by 0x6F5DD80: read_netlink_messages (gnetworkmonitornetlink.c:386)
==24706==    by 0x6F2D5CA: socket_source_dispatch (gsocket.c:2505)
==24706==    by 0x70E1D45: g_main_dispatch (gmain.c:2513)
==24706==    by 0x70E2A06: g_main_context_dispatch (gmain.c:3050)
==24706==    by 0x70E2BE9: g_main_context_iterate (gmain.c:3121)
==24706==    by 0x70E2CAD: g_main_context_iteration (gmain.c:3182)
==24706==    by 0x6F60A05: g_application_run (gapplication.c:1599)
==24706==    by 0x42D011: main (ephy-main.c:472)

https://bugzilla.gnome.org/show_bug.cgi?id=667098
2012-01-01 19:01:14 +01:00
Simon McVittie
fa4792c35e various tests: do not provoke SIGTRAP with -m no-undefined
Some of the GLib tests deliberately provoke warnings (or even fatal
errors) in a forked child. Normally, this is fine, but under valgrind
it's somewhat undesirable. We do want to follow fork(), so we can check
for leaks in child processes that exit gracefully; but we don't want to
be told about "leaks" in processes that are crashing, because there'd
be no point in cleaning those up anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=666116
2011-12-27 17:51:09 -05:00
Matthias Clasen
cc03b3cdea Don't leak references to the menus 2011-12-24 23:01:17 -05:00
Matthias Clasen
f077127d01 Add a test for ids on submenu and section elements
The test checks that menus which are created via
<submenu id=...> or <section id=...> end up in the objects
hash table.
2011-12-24 22:59:10 -05:00
Matthias Clasen
37efbf4354 Menu markup: Support ids on submenu and section elements
This was supposed to work, but didn't.
Bug 666595.
2011-12-24 22:58:16 -05:00
Dan Winship
3f3e141ec8 Add GSocketClient::event, for tracking socket client status
This can be used for debugging, or for progress UIs ("Connecting to
example.com..."), or to do low-level tweaking on the connection at
various points in the process.

https://bugzilla.gnome.org/show_bug.cgi?id=665805
2011-12-22 15:44:24 -05:00
Dan Winship
57f279988c Add g_socket_connection_connect(), etc
Previously it was more or less assumed that GSocketConnections were
always connected, although this was not enforced. Make it explicit
that they don't need to be, and add methods to connect them, and
simplify GSocketClient by using those methods.

https://bugzilla.gnome.org/show_bug.cgi?id=665805
2011-12-22 13:22:25 -05:00
Ryan Lortie
6e7da987b4 GSettingsBackend: allow floating refs from read()
Use g_variant_take_ref() to allow for backends to return floating
GVariant instances from their read() implementations.
2011-12-22 00:24:20 -05:00
Cosimo Cecchi
adff60ed63 menu: documentation fixes
g_menu_new_section() does not exist, the comment meant
g_menu_item_new_section().
2011-12-21 12:36:19 +01:00
Ryan Lortie
ab0da3c282 GSimpleAction: fix some whitespace fail 2011-12-20 19:12:56 -05:00
Ryan Lortie
342e2faa29 GSimpleAction: tweak property flags
There's no need for 'enabled' and 'state' to be marked construct-only.
These properties are writable at all times.
2011-12-20 19:12:00 -05:00
Ryan Lortie
ebf572cdd8 GAction: back out changes to property flags
41e5ba86a7 introduced some changes to the
property flags of GAction.  These changes were not a reflection of the
actual interface of GAction but were necessary due to GObject being
overly-sensitive to flag changes on property overrides.

Now that the GObject bug is fixed, we can restore the GAction flags to
their correct values.

https://bugzilla.gnome.org/show_bug.cgi?id=666615
2011-12-20 14:58:38 -05:00
Matthias Clasen
68706bfa2b Add references to the dbus interface docs on the wiki
And strip out the (now) redundant copy of that information
from the sources.
2011-12-20 12:15:05 -05:00
Dan Winship
8f558d8010 gnetworkmonitornetlink.c: Fix a gsize->gssize
https://bugzilla.gnome.org/show_bug.cgi?id=666422
2011-12-19 15:20:08 -05:00
Ryan Lortie
5e8a10daf1 gitignore 2011-12-19 13:38:09 -05:00
Ryan Lortie
0a22f63ebe Drop public menu APIs from GApplication
This is moving to Gtk, but we don't want to do it all right now.
2011-12-19 12:34:16 -05:00
Ryan Lortie
0c094d6607 Drop the GApplication menu test 2011-12-19 12:34:16 -05:00
Giovanni Campagna
466432830c gsettings-tool: allow specifying custom schema dirs
It happens that one wants to customize settings for plugins or
shell extensions, that installing schemas in nonstandard locations.
This patch adds the --schemadir option to gsettings, and ensure
that the appropriate schema is found.

https://bugzilla.gnome.org/show_bug.cgi?id=666415
2011-12-19 10:33:55 -05:00
Florian Müllner
f59acb55c1 gdesktopappinfo: Use "Keywords" instead of "X-GNOME-Keywords"
The field has now been standardized, so drop the prefix.
2011-12-19 15:26:30 +01:00
Ryan Lortie
0971d36e4b GApplication: receiving end of GRemoteActionGroup
Use the fact that the action group exporter now speaks to
GRemoteActionGroup to get the platform data into GApplicion without
hacks.

https://bugzilla.gnome.org/show_bug.cgi?id=665737
2011-12-17 12:54:02 -05:00
Ryan Lortie
1807ef336a action group exporter: kill GApplication hackery
Use the GRemoteActionGroup interface, if available, instead.

https://bugzilla.gnome.org/show_bug.cgi?id=665737
2011-12-17 12:54:02 -05:00
Ryan Lortie
eefd08996f introduce GRemoteActionGroup
This interfaceifies the extra functions that were on GDBusActionGroup
for dealing with platform data.

The two main benefits of doing this:

  - no longer have to do a silly song and dance in GApplication to avoid
    calling GDBusActionGroup API from non-dbus-aware code

  - the interface can be reused by the action group exporter to avoid
    ugly and unbindable hook callbacks

https://bugzilla.gnome.org/show_bug.cgi?id=665737
2011-12-17 12:54:02 -05:00
Ryan Lortie
ee9f104432 GApplication: send platform data for actions again
Use the _full variants of the GDBusActionGroup API to send platform data
for action invocations once again.
2011-12-16 22:24:03 -05:00
Ryan Lortie
f58df66d4d GDBusActionGroup: add _full variants of activation
This allows the platform_data to be explicitly specified.
2011-12-16 22:23:30 -05:00
Ryan Lortie
e5ed11bcf8 Revert "GDBusActionGroup: add static platform registration"
This reverts commit fcc9902e98.
2011-12-16 21:25:57 -05:00
Ryan Lortie
e370631f46 GApplication: emit signals on action changes
Now that we're a GActionMap the story about propagating signals from our
(now-constant) internal action group is vastly simplified.  If someone
calls g_application_set_action_group() then signals will stop working --
but this function is deprecated and they never worked before, so no big
loss there.

https://bugzilla.gnome.org/show_bug.cgi?id=643736
2011-12-16 11:43:59 -05:00
Ryan Lortie
fcc9902e98 GDBusActionGroup: add static platform registration
We provide a mechanism by which a 'platform' (eg: Gtk) can register some
hook functions to be called to collect platform-data at the point of
sending an outgoing action activation request and also to inform the
platform of this data on incoming requests (before and after dispatching
the actual request).

This can be used for forwarding timestamp and startup-notification
information (as is presently done in GApplication) but the before/after
hook could also be used for acquiring/releasing the Gdk lock or other
similar things.

https://bugzilla.gnome.org/show_bug.cgi?id=665737
2011-12-16 10:54:42 -05:00
Colin Walters
63e69b4958 GDBusActionGroup: Fix a typo in docs 2011-12-15 09:47:37 -05:00
Chris Coulson
162bafee37 Initialize service_loop before running the service thread
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666129
2011-12-14 21:15:35 -05:00
Matthias Clasen
a6eda97d8e menu markup: tolerate not having a hash table of objects
Various places in the code were assuming that the hash table was always
available. Fix this, and also avoid leaking strings now that the hash
table may be NULL.

Based on a patch by Simon McVittie, bug 666167
2011-12-14 21:05:38 -05:00
Simon McVittie
a1bd6e0717 tls-interaction test: use a weak pointer instead of a deliberate use-after-free
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666115
Reviewed-by: Dan Winship <danw@gnome.org>
2011-12-14 15:59:29 +00:00
Ryan Lortie
0a7930d048 gdbus tests: remove buggy use of GMainLoop
g_main_loop_quit() only quits mainloops that are currently running --
not ones that may run in the future.  The way the gdbus-threading tests
are written can possibly result in a call to g_main_loop_quit() before
g_main_loop_run() has started.

The mainloops aren't actually used for anything other than signalling
the completion of the threads, so just use g_thread_join() for that.

https://bugzilla.gnome.org/show_bug.cgi?id=666129
2011-12-14 09:33:30 -05:00
Simon McVittie
995a2eb50b Plug some leaks in the GIO tests
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>
2011-12-14 12:41:15 +00:00
Simon McVittie
fedc0cff51 Revert "g_menu_markup_start_element: tolerate not having a hash table of objects"
This reverts commit bcdb606411,
accidentally pushed before it was reviewed.
2011-12-14 12:39:06 +00:00
Simon McVittie
bcdb606411 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.
2011-12-14 12:31:31 +00:00
Simon McVittie
a48edddc19 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>
2011-12-14 12:26:17 +00:00
Simon McVittie
fbab468da5 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>
2011-12-14 12:26:16 +00:00
Matthias Clasen
b386d9ffb7 Add another menu parser test
This one concerns itself with objects.
2011-12-14 00:10:34 -05:00
Matthias Clasen
b153e38ff0 GMenuModel: Flesh out the docs some more 2011-12-13 23:16:25 -05:00
Matthias Clasen
c14a3b3e9c GMenu: purge references to GMenuProxy from the docs 2011-12-13 23:06:16 -05:00
Christophe Fergeau
f3dde2d405 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💯 error: 'struct sockaddr_nl' has no member named 'nl_pid'
gnetworkmonitornetlink.c💯 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
2011-12-13 16:40:34 +01:00
Ryan Lortie
93f17967e4 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.
2011-12-12 13:33:54 -05:00
Ryan Lortie
bbae5fe941 GMenuMarkup parser: small typo fix in docs 2011-12-12 13:13:42 -05:00
Ryan Lortie
b8cde0b507 More clearly define 'named menu' in the XML parser
This is when menus have id='' attributes.
2011-12-12 13:08:48 -05:00
Ryan Lortie
60bcb36783 GMenu parser: use G_MARKUP_COLLECT_BOOLEAN
...instead of trying to parse the boolean for ourselves.
2011-12-12 13:07:04 -05:00
Matthias Clasen
4f5732f721 GApplication: fix a copy-paste error
Activating an action must not turn into a change-state request.
2011-12-12 01:44:41 -05:00
Matthias Clasen
dec7ed8aba Rearrange GApplication long desc a bit 2011-12-12 00:01:20 -05:00
Matthias Clasen
e242413847 Expand actiongroup docs a bit more 2011-12-12 00:00:16 -05:00
Matthias Clasen
840482658a 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
2011-12-11 12:05:23 -05:00
Matthias Clasen
f40de4b152 Add some more since tags 2011-12-10 22:14:34 -05:00
Matthias Clasen
f0eb58075a Add a since tag 2011-12-10 21:55:11 -05:00
Matthias Clasen
2d6d127c96 Whitespace fixes
And add some missing since tags.
2011-12-10 21:46:39 -05:00
Matthias Clasen
f109415d95 Add since tags 2011-12-10 20:47:22 -05:00
Ryan Lortie
829b4dfb43 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.
2011-12-10 17:23:28 -05:00
Colin Walters
4eeac41d7d gfile: Don't use C++ keyword "template" as variable name
This breaks autotestkeyword.cc from gtk+.
2011-12-09 11:13:23 -05:00
Aleksander Morgado
8fcb73b0a9 gdbus-codegen: fix typo in generated documentation
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=665858
2011-12-09 15:18:25 +01:00
Thomas Hindoe Paaboel Andersen
721667399a 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
2011-12-09 08:58:05 -05:00
Matthias Clasen
8d428e3cc4 GApplication: Make ::startup run-first
https://bugzilla.gnome.org/show_bug.cgi?id=665817
2011-12-08 23:46:32 -05:00
Ryan Lortie
a65429cf44 gio.symbols fixes 2011-12-08 18:07:50 -05:00
Ryan Lortie
a6366dc289 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.
2011-12-08 18:07:47 -05:00
Ryan Lortie
0fdd9985bb GDBusActionGroup: drop ability to 'inject'
Also drop the GDBusActionGroupFlags that were only meant to facilitate
injection-based usage.
2011-12-08 18:05:15 -05:00
Matthias Clasen
caa6287f39 More documentation fixes 2011-12-08 18:05:15 -05:00
Matthias Clasen
04aab0cd46 Fix up docs 2011-12-08 18:05:15 -05:00
Matthias Clasen
39bebbed82 Don't use deprecated GApplication api in examples 2011-12-08 18:05:15 -05:00
Ryan Lortie
13e084437b 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.
2011-12-08 18:05:15 -05:00
Ryan Lortie
25ffde957c 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'.
2011-12-08 18:05:15 -05:00
Ryan Lortie
1c036cb9f5 Rename GMenuProxy to GDBusMenuModel
This improves consistency with GDBusActionGroup.
2011-12-08 18:05:15 -05:00
Ryan Lortie
14900d37f4 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.
2011-12-08 18:05:15 -05:00
Ryan Lortie
7af08e1fc0 action exporter: use GSource* instead of source id
Keep track of the GSource* of our event dispatch idle instead of using
source ID.
2011-12-08 18:05:15 -05:00
Ryan Lortie
64e3e10c98 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.
2011-12-08 18:05:15 -05:00
Ryan Lortie
21aca44ee1 GMenuModel exporter: remove workaround
With Bug 665733 fixed, we can remove the workaround (which was causing
thread safety problems).
2011-12-08 18:05:15 -05:00
Matthias Clasen
328bf4616a Add testcase for threaded menu exporter use
This currently fails
2011-12-08 18:05:14 -05:00
Matthias Clasen
f1a403e809 Add a test for multithreaded action group exporter use 2011-12-08 18:05:14 -05:00
Ryan Lortie
77f6e6a97f GApplication dbus: publish the menus again 2011-12-08 18:05:14 -05:00
Matthias Clasen
690596e9fb Fully implement app-menu and menubar properties 2011-12-08 18:05:14 -05:00
Ryan Lortie
ac8bc3d407 GApplication: make menu properties readwrite
Otherwise the notify signals won't be emitted.
2011-12-08 18:05:14 -05:00
Ryan Lortie
ef8c443092 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.
2011-12-08 18:05:14 -05:00
Ryan Lortie
4f2c207745 menu/action exporter docs fixup 2011-12-08 18:05:14 -05:00
Ryan Lortie
46e3dca2e4 gio symbol cleanups 2011-12-08 18:05:14 -05:00
Ryan Lortie
cfbc1b5a4b 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...
2011-12-08 18:05:14 -05:00
Ryan Lortie
a9f03596fa 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.
2011-12-08 18:05:14 -05:00
Ryan Lortie
f7886d6adb 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.
2011-12-08 18:05:14 -05:00
Ryan Lortie
5a32769300 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.
2011-12-08 18:05:14 -05:00
Ryan Lortie
03d894d81f 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.
2011-12-08 18:05:14 -05:00
Ryan Lortie
088682d860 GApplication: implement GActionMap
and deprecate g_application_set_action_group().
2011-12-08 18:05:14 -05:00
Ryan Lortie
75f1802a1c Fix some GMenu and GMenuItem leaking 2011-12-08 18:05:14 -05:00
Ryan Lortie
3821627366 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.
2011-12-08 18:05:14 -05:00
Colin Walters
8777b08a5a gsimpleaction: Ensure actions are enabled 2011-12-08 18:05:14 -05:00
Matthias Clasen
a8a8633cef Include gactionmap.h in gio.h 2011-12-08 18:05:14 -05:00
Matthias Clasen
eb09099f65 Minor doc improvements 2011-12-08 18:05:14 -05:00
Matthias Clasen
c8e76fdda2 Add GActionMap to the docs 2011-12-08 18:05:14 -05:00
Colin Walters
41e5ba86a7 GSimpleAction: Fix to comply with constructor rules
foo_new_*() must be pure wrappers around g_object_new(), otherwise
their functionality is inaccessible to bindings.
2011-12-08 18:05:14 -05:00
Ryan Lortie
76527e5cd5 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).
2011-12-08 18:05:14 -05:00
Ryan Lortie
02b001f8f6 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.
2011-12-08 18:05:13 -05:00
Ryan Lortie
a0a94cd6c6 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.
2011-12-08 18:05:13 -05:00
Matthias Clasen
d6f2281329 Shorten a variable name 2011-12-08 18:05:13 -05:00
Matthias Clasen
ad09498fa7 Expand dbus action group tests
The new tests check that activation and state changes propagate
back.
2011-12-08 18:05:13 -05:00
Matthias Clasen
5718804e58 Some more assertions 2011-12-08 18:05:13 -05:00
Matthias Clasen
22c9d20b7a Add some dbus action group tests 2011-12-08 18:05:13 -05:00
Matthias Clasen
7ef3e27255 Fix the dbus action group query_action implementation 2011-12-08 18:05:13 -05:00
Matthias Clasen
5002cb2935 Make stopping an action group export work 2011-12-08 18:05:13 -05:00
Ryan Lortie
7a0faf66fe 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.
2011-12-08 18:05:13 -05:00
Ryan Lortie
2c4ded15e5 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.
2011-12-08 18:05:13 -05:00
Matthias Clasen
1bb0a89de6 Add debug code
This adds a dump method to show the entire tree of proxies.
2011-12-08 18:05:13 -05:00
Matthias Clasen
2cf4866e33 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.
2011-12-08 18:05:13 -05:00
Matthias Clasen
39ce59f955 Typo fix 2011-12-08 18:05:13 -05:00
Matthias Clasen
ff833ccac9 Remove unused variable 2011-12-08 18:05:13 -05:00
Matthias Clasen
500f8fbac5 Add a test for menu subscriptions 2011-12-08 18:05:13 -05:00
Matthias Clasen
efd23e23c6 Take out excessive width 2011-12-08 18:05:13 -05:00
Matthias Clasen
381b23fc85 Reduce excessive width 2011-12-08 18:05:13 -05:00
Matthias Clasen
f9f0ef19d7 whitespace fix 2011-12-08 18:05:13 -05:00
Matthias Clasen
0f88b7af33 Add some tests for links 2011-12-08 18:05:13 -05:00
Matthias Clasen
0760bf5850 Add parser roundtrip tests 2011-12-08 18:05:13 -05:00
Matthias Clasen
a2aeea7acd 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.
2011-12-08 18:05:13 -05:00
Matthias Clasen
d5a1b674f5 Improve docs
Specify that g_menu_item_set_attribute_value consumes floating
@values.
2011-12-08 18:05:13 -05:00
Matthias Clasen
41c19c7df8 GApplication: Add a menu example to the docs 2011-12-08 18:05:13 -05:00
Matthias Clasen
8d96e68eeb 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 '-'.
2011-12-08 18:05:13 -05:00
Matthias Clasen
9bebf15077 Reduce excessive width of gmenu.h 2011-12-08 18:05:12 -05:00
Matthias Clasen
58a8c02dfb Match up a parameter name 2011-12-08 18:05:12 -05:00
Matthias Clasen
60ab57c4b0 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.
2011-12-08 18:05:12 -05:00
Matthias Clasen
cd22e1967d 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.
2011-12-08 18:05:12 -05:00
Matthias Clasen
db34b1aebe 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
2011-12-08 18:05:12 -05:00
Matthias Clasen
435b2418da GActionGroup: Mention GMenuModel in the docs 2011-12-08 18:05:12 -05:00
Matthias Clasen
ae0bd032ca Add g_application_set_menu
This adds ane asy way to export menu information alongside
the actions that are already exported by GApplication.
2011-12-08 18:05:12 -05:00
Ryan Lortie
6dfb9d583f Add GMenuModel testcases 2011-12-08 18:05:12 -05:00
Ryan Lortie
d110fd9202 Add GMenuProxy
GMenuProxy can be used as a client-side wrapper
for the a menu model that has been exported on D-Bus.
2011-12-08 18:05:12 -05:00
Matthias Clasen
66e089f086 Add GMenuModel D-Bus exporter 2011-12-08 18:05:12 -05:00
Matthias Clasen
6b40d4eb6b Add GMenu markup
These functions serialize and deserialize a GMenuModel
to and from XML.
2011-12-08 18:05:12 -05:00
Matthias Clasen
13f5977735 Add GMenu 2011-12-08 18:05:12 -05:00
Matthias Clasen
12a39a05d3 Add GMenuModel 2011-12-08 18:05:12 -05:00
Matthias Clasen
df4cd241e5 GApplication: use GDBusActionGroup
instead of the internal version of the same
2011-12-08 18:05:12 -05:00
Ryan Lortie
c249e10d11 Add GDBusActionGroup
GDBusActionGroup can be used as a client-side wrapper
for the an action group that has been exported on D-Bus.
2011-12-08 18:05:12 -05:00
Ryan Lortie
bc5fe41dec GApplication: port action client to new D-Bus API
for compatibility with GActionGroup exporter
2011-12-08 18:05:12 -05:00
Ryan Lortie
20d1de3a1b GApplication: use GActionGroup exporter
instead of home-grown internal implementation of the same
2011-12-08 18:05:12 -05:00
Ryan Lortie
940ec94f0a Add GActionGroup D-Bus exporter 2011-12-08 18:05:12 -05:00
Ryan Lortie
8d1cc7f463 Revert "Use an XML blob for gapplication interface info"
This reverts commit 8013401f6e.
2011-12-08 18:05:12 -05:00
Ryan Lortie
45818762d3 Revert "Forgot one interface..."
This reverts commit 30580bdca7.
2011-12-08 18:05:12 -05:00
Matthias Clasen
3d686e3d8f 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
2011-12-07 14:38:37 -05:00
David Zeuthen
70dacf83d2 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>
2011-12-07 10:30:42 -05:00
David Zeuthen
990af4b372 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>
2011-12-06 13:41:53 -05:00
David Zeuthen
74e131551d GDBus: fix link to D-Bus spec
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-12-06 13:41:53 -05:00
Benjamin Otte
482f226270 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.
2011-12-05 22:40:18 +01:00