diff options
-rw-r--r-- | src/nautilus-freedesktop-dbus.c | 81 |
1 files changed, 3 insertions, 78 deletions
diff --git a/src/nautilus-freedesktop-dbus.c b/src/nautilus-freedesktop-dbus.c index 2eaebcc29..c75678399 100644 --- a/src/nautilus-freedesktop-dbus.c +++ b/src/nautilus-freedesktop-dbus.c @@ -40,11 +40,6 @@ struct _NautilusFreedesktopDBus /* Our DBus implementation skeleton */ NautilusFreedesktopFileManager1 *skeleton; - - GStrv pending_open_locations; - GVariant *pending_open_windows_with_locations; - - gboolean name_lost; }; G_DEFINE_TYPE (NautilusFreedesktopDBus, nautilus_freedesktop_dbus, G_TYPE_OBJECT); @@ -162,24 +157,6 @@ bus_acquired_cb (GDBusConnection *conn, G_CALLBACK (skeleton_handle_show_item_properties_cb), fdb); g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (fdb->skeleton), conn, NAUTILUS_FDO_DBUS_PATH, NULL); - - if (G_UNLIKELY (fdb->pending_open_locations != NULL)) - { - g_auto (GStrv) locations = NULL; - - locations = g_steal_pointer (&fdb->pending_open_locations); - - nautilus_freedesktop_dbus_set_open_locations (fdb, (const gchar **) locations); - } - - if (G_UNLIKELY (fdb->pending_open_windows_with_locations != NULL)) - { - g_autoptr (GVariant) locations = NULL; - - locations = g_steal_pointer (&fdb->pending_open_windows_with_locations); - - nautilus_freedesktop_dbus_set_open_windows_with_locations (fdb, locations); - } } static void @@ -195,13 +172,7 @@ name_lost_cb (GDBusConnection *connection, const gchar *name, gpointer user_data) { - NautilusFreedesktopDBus *fdb; - DEBUG ("Lost (or failed to acquire) the name %s on the session message bus\n", name); - - fdb = NAUTILUS_FREEDESKTOP_DBUS (user_data); - - fdb->name_lost = TRUE; } static void @@ -226,25 +197,11 @@ nautilus_freedesktop_dbus_dispose (GObject *object) } static void -nautilus_freedesktop_dbus_finalize (GObject *object) -{ - NautilusFreedesktopDBus *fdb; - - fdb = NAUTILUS_FREEDESKTOP_DBUS (object); - - g_clear_pointer (&fdb->pending_open_locations, g_strfreev); - g_clear_pointer (&fdb->pending_open_windows_with_locations, g_variant_unref); - - G_OBJECT_CLASS (nautilus_freedesktop_dbus_parent_class)->finalize (object); -} - -static void nautilus_freedesktop_dbus_class_init (NautilusFreedesktopDBusClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); object_class->dispose = nautilus_freedesktop_dbus_dispose; - object_class->finalize = nautilus_freedesktop_dbus_finalize; } static void @@ -258,10 +215,6 @@ nautilus_freedesktop_dbus_init (NautilusFreedesktopDBus *fdb) name_lost_cb, fdb, NULL); - fdb->skeleton = NULL; - fdb->pending_open_locations = NULL; - fdb->pending_open_windows_with_locations = NULL; - fdb->name_lost = FALSE; } void @@ -270,21 +223,7 @@ nautilus_freedesktop_dbus_set_open_locations (NautilusFreedesktopDBus *fdb, { g_return_if_fail (NAUTILUS_IS_FREEDESKTOP_DBUS (fdb)); - if (G_UNLIKELY (fdb->skeleton == NULL)) - { - if (G_LIKELY (fdb->name_lost)) - { - return; - } - - g_clear_pointer (&fdb->pending_open_locations, g_strfreev); - - fdb->pending_open_locations = g_strdupv ((gchar **) locations); - } - else - { - nautilus_freedesktop_file_manager1_set_open_locations (fdb->skeleton, locations); - } + nautilus_freedesktop_file_manager1_set_open_locations (fdb->skeleton, locations); } /** @@ -303,22 +242,8 @@ nautilus_freedesktop_dbus_set_open_windows_with_locations (NautilusFreedesktopDB { g_return_if_fail (NAUTILUS_IS_FREEDESKTOP_DBUS (fdb)); - if (G_UNLIKELY (fdb->skeleton == NULL)) - { - if (G_LIKELY (fdb->name_lost)) - { - return; - } - - g_clear_pointer (&fdb->pending_open_windows_with_locations, g_variant_unref); - - fdb->pending_open_windows_with_locations = g_variant_ref (locations); - } - else - { - nautilus_freedesktop_file_manager1_set_open_windows_with_locations (fdb->skeleton, - locations); - } + nautilus_freedesktop_file_manager1_set_open_windows_with_locations (fdb->skeleton, + locations); } /* Tries to own the org.freedesktop.FileManager1 service name */ |