Commit Graph

2715 Commits

Author SHA1 Message Date
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