summaryrefslogtreecommitdiff
path: root/monitor
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2012-09-23 14:51:32 -0400
committerCosimo Cecchi <cosimoc@gnome.org>2012-09-25 10:44:53 -0400
commitca7743a63721c3dd1c166006539e356412466dcc (patch)
tree902617eff137be8269660b9812497e48f6abf629 /monitor
parent7c0308fdd096efa7fd946cd3a7fc32f3d33f5b1c (diff)
downloadgvfs-ca7743a63721c3dd1c166006539e356412466dcc.tar.gz
proxy: don't emit connected/added signals at object creation
It's unnecessary to emit those signals when the object is created, and it can cause weird side-effects if applications e.g. play a sound on signal emission. https://bugzilla.gnome.org/show_bug.cgi?id=684677
Diffstat (limited to 'monitor')
-rw-r--r--monitor/proxy/gproxyvolumemonitor.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/monitor/proxy/gproxyvolumemonitor.c b/monitor/proxy/gproxyvolumemonitor.c
index 1af6c346..37fc7885 100644
--- a/monitor/proxy/gproxyvolumemonitor.c
+++ b/monitor/proxy/gproxyvolumemonitor.c
@@ -955,6 +955,7 @@ g_proxy_volume_monitor_constructor (GType type,
GObjectClass *parent_class;
GError *error;
const char *dbus_name;
+ gchar *name_owner;
G_LOCK (proxy_vm);
@@ -1018,7 +1019,12 @@ g_proxy_volume_monitor_constructor (GType type,
/* listen to when the owner of the service appears/disappears */
g_signal_connect (monitor->proxy, "notify::g-name-owner", G_CALLBACK (name_owner_changed), monitor);
/* initially seed drives/volumes/mounts if we have an owner */
- name_owner_changed (G_OBJECT (monitor->proxy), NULL, monitor);
+ name_owner = g_dbus_proxy_get_name_owner (G_DBUS_PROXY (monitor->proxy));
+ if (name_owner != NULL)
+ {
+ seed_monitor (monitor);
+ g_free (name_owner);
+ }
g_hash_table_insert (the_volume_monitors, (gpointer) type, object);