[epiphany/wip/ephy-sync] ephy-shell: Create the sync service in startup rather than init



commit 179a6d3bfb7167e8ef3655ecc0553fc28ec7c166
Author: Gabriel Ivascu <ivascu gabriel59 gmail com>
Date:   Tue Aug 30 16:00:54 2016 +0300

    ephy-shell: Create the sync service in startup rather than init

 src/ephy-shell.c |   43 ++++++++++++++++++++++---------------------
 1 files changed, 22 insertions(+), 21 deletions(-)
---
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 8d3301c..6a3e2c9 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -302,6 +302,7 @@ ephy_shell_startup (GApplication *application)
   mode = ephy_embed_shell_get_mode (embed_shell);
 
   if (mode != EPHY_EMBED_SHELL_MODE_APPLICATION) {
+    EphySyncService *service;
     GtkBuilder *builder;
 
     g_action_map_add_action_entries (G_ACTION_MAP (application),
@@ -320,6 +321,11 @@ ephy_shell_startup (GApplication *application)
                               G_BINDING_SYNC_CREATE);
     }
 
+    /* Start the periodical sync now. */
+    service = ephy_sync_service_new ();
+    ephy_sync_service_start_periodical_sync (service, TRUE);
+    ephy_shell->sync_service = service;
+
     builder = gtk_builder_new ();
     gtk_builder_add_from_resource (builder,
                                    "/org/gnome/epiphany/epiphany-application-menu.ui",
@@ -555,18 +561,12 @@ static void
 ephy_shell_init (EphyShell *shell)
 {
   EphyShell **ptr = &ephy_shell;
-  EphySyncService *service;
 
   /* globally accessible singleton */
   g_assert (ephy_shell == NULL);
   ephy_shell = shell;
   g_object_add_weak_pointer (G_OBJECT (ephy_shell),
                              (gpointer *)ptr);
-
-  /* Start the periodical sync now. */
-  service = ephy_sync_service_new ();
-  ephy_sync_service_start_periodical_sync (service, TRUE);
-  ephy_shell->sync_service = service;
 }
 
 static void
@@ -611,21 +611,6 @@ ephy_shell_finalize (GObject *object)
 }
 
 /**
- * ephy_shell_get_sync_service:
- *
- * Retrieve the default #EphySyncService object
- *
- * Return value: (transfer none): the default #EphySyncService
- **/
-EphySyncService *
-ephy_shell_get_sync_service (EphyShell *shell)
-{
-  g_return_val_if_fail (EPHY_IS_SHELL (shell), NULL);
-
-  return shell->sync_service;
-}
-
-/**
  * ephy_shell_get_default:
  *
  * Retrieve the default #EphyShell object
@@ -753,6 +738,22 @@ ephy_shell_get_session (EphyShell *shell)
 }
 
 /**
+ * ephy_shell_get_sync_service:
+ * @shell: the #EphyShell
+ *
+ * Returns the sync service.
+ *
+ * Return value: (transfer none): the global #EphySyncService
+ **/
+EphySyncService *
+ephy_shell_get_sync_service (EphyShell *shell)
+{
+  g_return_val_if_fail (EPHY_IS_SHELL (shell), NULL);
+
+  return shell->sync_service;
+}
+
+/**
  * ephy_shell_get_bookmarks:
  *
  * Return value: (transfer none):


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