[gnome-photos] thumbnailer: Instantiate the skeleton only when registering on D-Bus



commit 2eac7d8d26387b6de3c595172b7f4b3a3cc3f6a7
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Jun 8 15:33:47 2017 +0200

    thumbnailer: Instantiate the skeleton only when registering on D-Bus
    
    Unless the application spawned the thumbnailer incorrectly, which would
    be a programmer error, D-Bus communication is inevitable. So this is
    purely for consistency with PhotosApplication.

 src/photos-thumbnailer.c |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)
---
diff --git a/src/photos-thumbnailer.c b/src/photos-thumbnailer.c
index 74d9246..e7dbcbb 100644
--- a/src/photos-thumbnailer.c
+++ b/src/photos-thumbnailer.c
@@ -692,6 +692,16 @@ photos_thumbnailer_dbus_register (GApplication *application,
   if (self->connection == NULL)
     goto out;
 
+  self->skeleton = photos_thumbnailer_dbus_skeleton_new ();
+  g_signal_connect_swapped (self->skeleton,
+                            "handle-cancel",
+                            G_CALLBACK (photos_thumbnailer_handle_cancel),
+                            self);
+  g_signal_connect_swapped (self->skeleton,
+                            "handle-generate-thumbnail",
+                            G_CALLBACK (photos_thumbnailer_handle_generate_thumbnail),
+                            self);
+
   if (!g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (self->skeleton),
                                          self->connection,
                                          THUMBNAILER_PATH,
@@ -799,17 +809,6 @@ photos_thumbnailer_init (PhotosThumbnailer *self)
   photos_gegl_ensure_builtins ();
 
   self->cancellables = g_hash_table_new_full (g_direct_hash, g_direct_equal, g_object_unref, g_object_unref);
-
-  self->skeleton = photos_thumbnailer_dbus_skeleton_new ();
-  g_signal_connect_swapped (self->skeleton,
-                            "handle-cancel",
-                            G_CALLBACK (photos_thumbnailer_handle_cancel),
-                            self);
-  g_signal_connect_swapped (self->skeleton,
-                            "handle-generate-thumbnail",
-                            G_CALLBACK (photos_thumbnailer_handle_generate_thumbnail),
-                            self);
-
   g_application_add_main_option_entries (G_APPLICATION (self), COMMAND_LINE_OPTIONS);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]