[epiphany/wip/sync] Remove --enable-firefox-sync flag



commit 99afa50b76791cad817098f68d035ac84c35915e
Author: Gabriel Ivascu <ivascu gabriel59 gmail com>
Date:   Thu Mar 30 19:09:47 2017 +0300

    Remove --enable-firefox-sync flag

 configure.ac                                  |   17 +-----------
 src/Makefile.am                               |   16 ++++-------
 src/bookmarks/ephy-bookmark-properties-grid.c |    9 +------
 src/bookmarks/ephy-bookmark.c                 |    9 ++----
 src/ephy-shell.c                              |   15 +-----------
 src/ephy-shell.h                              |    7 +----
 src/prefs-dialog.c                            |   32 ++----------------------
 7 files changed, 17 insertions(+), 88 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index f7976ce..83cb44d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -108,12 +108,14 @@ PKG_CHECK_MODULES([GNOME_DESKTOP], [gnome-desktop-3.0 >= 2.91.2])
 PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= $GTK_REQUIRED])
 PKG_CHECK_MODULES([GTK_UNIX_PRINT], [gtk+-unix-print-3.0 >= $GTK_REQUIRED])
 PKG_CHECK_MODULES([ICU_UC], [icu-uc >= 4.6])
+PKG_CHECK_MODULES([HOGWEED], [hogweed >= 3.2])
 PKG_CHECK_MODULES([JSON_GLIB], [json-glib-1.0 >= 1.2.0])
 PKG_CHECK_MODULES([LIBNOTIFY], [libnotify >= 0.5.1])
 PKG_CHECK_MODULES([LIBSECRET], [libsecret-1 >= 0.14])
 PKG_CHECK_MODULES([LIBSOUP], [libsoup-2.4 >= 2.48.0])
 PKG_CHECK_MODULES([LIBXML], [libxml-2.0 >= 2.6.12])
 PKG_CHECK_MODULES([LIBXSLT], [libxslt >= 1.1.7])
+PKG_CHECK_MODULES([NETTLE], [nettle >= 3.2])
 PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= 3.0])
 PKG_CHECK_MODULES([WEBKIT2GTK], [webkit2gtk-4.0 >= $WEBKITGTK_REQUIRED])
 PKG_CHECK_MODULES([WEBKIT2GTK_WEB_EXTENSION], [webkit2gtk-web-extension-4.0 >= $WEBKITGTK_REQUIRED])
@@ -133,20 +135,6 @@ AS_IF([test "x$with_libhttpseverywhere" = "xyes"],
         AC_DEFINE([HAVE_LIBHTTPSEVERYWHERE], [1], [Define if libhttpseverywhere is available])]
 )
 
-# Firefox sync is not quite ready yet either.
-AC_ARG_ENABLE([firefox-sync],
-       [AS_HELP_STRING([--enable-firefox-sync], [Enable experimental Firefox Sync support])],
-       [],
-       [enable_firefox_sync=no]
-)
-AS_IF([test "x$enable_firefox_sync" = "xyes"],
-       [PKG_CHECK_MODULES([HOGWEED], [hogweed >= 3.2])
-        PKG_CHECK_MODULES([NETTLE], [nettle >= 3.2])
-        AC_DEFINE([ENABLE_SYNC], [1], [Define if Firefox Sync support is enabled])]
-)
-
-AM_CONDITIONAL([ENABLE_SYNC], [test "x$enable_firefox_sync" = "xyes"])
-
 # ******************
 # Portability checks
 # ******************
@@ -248,5 +236,4 @@ Epiphany was configured with the following options:
        Build tests                : $enable_tests
        Code coverage              : $enable_code_coverage
        HTTPS Everywhere (unstable): $with_libhttpseverywhere
-       Firefox Sync (unstable)    : $enable_firefox_sync
 "
diff --git a/src/Makefile.am b/src/Makefile.am
index 91eda27..b6357f7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -72,14 +72,7 @@ libephymain_la_SOURCES = \
        prefs-dialog.c                          \
        prefs-dialog.h                          \
        window-commands.c                       \
-       window-commands.h
-
-if ENABLE_SYNC
-libephymain_la_SOURCES += \
-       sync/ephy-synchronizable.c              \
-       sync/ephy-synchronizable.h              \
-       sync/ephy-synchronizable-manager.c      \
-       sync/ephy-synchronizable-manager.h      \
+       window-commands.h                       \
        sync/ephy-sync-crypto.c                 \
        sync/ephy-sync-crypto.h                 \
        sync/ephy-sync-secret.c                 \
@@ -87,8 +80,11 @@ libephymain_la_SOURCES += \
        sync/ephy-sync-service.c                \
        sync/ephy-sync-service.h                \
        sync/ephy-sync-utils.c                  \
-       sync/ephy-sync-utils.h
-endif
+       sync/ephy-sync-utils.h                  \
+       sync/ephy-synchronizable.c              \
+       sync/ephy-synchronizable.h              \
+       sync/ephy-synchronizable-manager.c      \
+       sync/ephy-synchronizable-manager.h
 
 nodist_libephymain_la_SOURCES = \
        $(TYPES_SOURCE)
diff --git a/src/bookmarks/ephy-bookmark-properties-grid.c b/src/bookmarks/ephy-bookmark-properties-grid.c
index f7473d6..78fe8db 100644
--- a/src/bookmarks/ephy-bookmark-properties-grid.c
+++ b/src/bookmarks/ephy-bookmark-properties-grid.c
@@ -25,6 +25,7 @@
 #include "ephy-bookmarks-manager.h"
 #include "ephy-debug.h"
 #include "ephy-shell.h"
+#include "ephy-sync-service.h"
 #include "ephy-type-builtins.h"
 #include "ephy-uri-helpers.h"
 
@@ -32,10 +33,6 @@
 #include <libsoup/soup.h>
 #include <string.h>
 
-#ifdef ENABLE_SYNC
-#include "ephy-sync-service.h"
-#endif
-
 struct _EphyBookmarkPropertiesGrid {
   GtkGrid                         parent_instance;
 
@@ -241,19 +238,15 @@ ephy_bookmarks_properties_grid_actions_remove_bookmark (GSimpleAction *action,
                                                         GVariant      *value,
                                                         gpointer       user_data)
 {
-#ifdef ENABLE_SYNC
   EphySyncService *service;
-#endif
   EphyBookmarkPropertiesGrid *self = user_data;
 
   g_assert (EPHY_IS_BOOKMARK_PROPERTIES_GRID (self));
 
-#ifdef ENABLE_SYNC
   service = ephy_shell_get_sync_service (ephy_shell_get_default ());
   ephy_sync_service_delete_synchronizable (service,
                                            EPHY_SYNCHRONIZABLE_MANAGER (self->manager),
                                            EPHY_SYNCHRONIZABLE (self->bookmark));
-#endif
   ephy_bookmarks_manager_remove_bookmark (self->manager,  self->bookmark);
 
   if (self->type == EPHY_BOOKMARK_PROPERTIES_GRID_TYPE_DIALOG)
diff --git a/src/bookmarks/ephy-bookmark.c b/src/bookmarks/ephy-bookmark.c
index bfebf4f..e0f5f25 100644
--- a/src/bookmarks/ephy-bookmark.c
+++ b/src/bookmarks/ephy-bookmark.c
@@ -23,14 +23,11 @@
 #include "ephy-bookmark.h"
 
 #include "ephy-shell.h"
-
-#include <string.h>
-
-#ifdef ENABLE_SYNC
-#include "ephy-synchronizable.h"
 #include "ephy-sync-crypto.h"
 #include "ephy-sync-utils.h"
-#endif
+#include "ephy-synchronizable.h"
+
+#include <string.h>
 
 #define BOOKMARK_TYPE_VAL            "bookmark"
 #define BOOKMARK_PARENT_ID_VAL       "toolbar"
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 8ee786a..b067195 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -32,6 +32,7 @@
 #include "ephy-header-bar.h"
 #include "ephy-history-dialog.h"
 #include "ephy-lockdown.h"
+#include "ephy-notification.h"
 #include "ephy-prefs.h"
 #include "ephy-session.h"
 #include "ephy-settings.h"
@@ -47,17 +48,11 @@
 #include <gdk/gdkx.h>
 #include <gtk/gtk.h>
 
-#ifdef ENABLE_SYNC
-#include "ephy-notification.h"
-#endif
-
 struct _EphyShell {
   EphyEmbedShell parent_instance;
 
   EphySession *session;
-#ifdef ENABLE_SYNC
   EphySyncService *sync_service;
-#endif
   GList *windows;
   GObject *lockdown;
   EphyBookmarksManager *bookmarks_manager;
@@ -312,7 +307,6 @@ download_started_cb (WebKitWebContext *web_context,
   g_object_unref (ephy_download);
 }
 
-#ifdef ENABLE_SYNC
 static void
 sync_tokens_load_finished_cb (EphySyncService *service,
                               GError          *error,
@@ -333,7 +327,6 @@ sync_tokens_load_finished_cb (EphySyncService *service,
     ephy_notification_show (notification);
   }
 }
-#endif
 
 static void
 ephy_shell_startup (GApplication *application)
@@ -373,7 +366,6 @@ ephy_shell_startup (GApplication *application)
                               G_BINDING_SYNC_CREATE);
     }
 
-#ifdef ENABLE_SYNC
     /* Create the sync service. */
     ephy_shell->sync_service = ephy_sync_service_new ();
     g_signal_connect (ephy_shell->sync_service,
@@ -383,7 +375,6 @@ ephy_shell_startup (GApplication *application)
     /* Register the bookmarks collection. */
     ephy_sync_service_register_manager (ephy_shell->sync_service,
                                         EPHY_SYNCHRONIZABLE_MANAGER (ephy_shell_get_bookmarks_manager 
(ephy_shell)));
-#endif
 
     gtk_application_set_app_menu (GTK_APPLICATION (application),
                                   G_MENU_MODEL (gtk_builder_get_object (builder, "app-menu")));
@@ -651,9 +642,7 @@ ephy_shell_dispose (GObject *object)
   g_clear_pointer (&shell->history_dialog, gtk_widget_destroy);
   g_clear_object (&shell->prefs_dialog);
   g_clear_object (&shell->network_monitor);
-#ifdef ENABLE_SYNC
   g_clear_object (&shell->sync_service);
-#endif
   g_clear_object (&shell->bookmarks_manager);
 
   g_slist_free_full (shell->open_uris_idle_ids, remove_open_uris_idle_cb);
@@ -806,7 +795,6 @@ ephy_shell_get_session (EphyShell *shell)
   return shell->session;
 }
 
-#ifdef ENABLE_SYNC
 /**
  * ephy_shell_get_sync_service:
  * @shell: the #EphyShell
@@ -822,7 +810,6 @@ ephy_shell_get_sync_service (EphyShell *shell)
 
   return shell->sync_service;
 }
-#endif
 
 /**
  * ephy_shell_get_bookmarks_manager:
diff --git a/src/ephy-shell.h b/src/ephy-shell.h
index 9e86fa6..bd79449 100644
--- a/src/ephy-shell.h
+++ b/src/ephy-shell.h
@@ -26,16 +26,13 @@
 #include "ephy-embed-shell.h"
 #include "ephy-embed.h"
 #include "ephy-session.h"
+#include "ephy-sync-service.h"
 #include "ephy-window.h"
 
 #include <webkit2/webkit2.h>
 #include <glib-object.h>
 #include <glib.h>
 
-#ifdef ENABLE_SYNC
-#include "ephy-sync-service.h"
-#endif
-
 G_BEGIN_DECLS
 
 #define EPHY_TYPE_SHELL (ephy_shell_get_type ())
@@ -105,9 +102,7 @@ GNetworkMonitor *ephy_shell_get_net_monitor              (EphyShell *shell);
 
 EphyBookmarksManager *ephy_shell_get_bookmarks_manager   (EphyShell *shell);
 
-#ifdef ENABLE_SYNC
 EphySyncService *ephy_shell_get_sync_service             (EphyShell *shell);
-#endif
 
 GtkWidget       *ephy_shell_get_history_dialog           (EphyShell *shell);
 
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index e2df30a..35c316a 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -38,6 +38,7 @@
 #include "ephy-settings.h"
 #include "ephy-shell.h"
 #include "ephy-string.h"
+#include "ephy-sync-service.h"
 #include "ephy-uri-tester-shared.h"
 #include "clear-data-dialog.h"
 #include "cookies-dialog.h"
@@ -50,11 +51,6 @@
 #include <json-glib/json-glib.h>
 #include <string.h>
 
-#ifdef ENABLE_SYNC
-#include "ephy-sync-secret.h"
-#include "ephy-sync-service.h"
-#endif
-
 #define DOWNLOAD_BUTTON_WIDTH   8
 #define FXA_IFRAME_URL "https://accounts.firefox.com/signin?service=sync&context=fx_ios_v1";
 
@@ -114,7 +110,6 @@ struct _PrefsDialog {
   GHashTable *iso_639_table;
   GHashTable *iso_3166_table;
 
-#ifdef ENABLE_SYNC
   /* sync */
   GtkWidget *sync_authenticate_box;
   GtkWidget *sync_sign_in_box;
@@ -126,8 +121,6 @@ struct _PrefsDialog {
   WebKitWebView *fxa_web_view;
   WebKitUserContentManager *fxa_manager;
   WebKitUserScript *fxa_script;
-#endif
-  GtkWidget *notebook;
 };
 
 enum {
@@ -154,19 +147,16 @@ prefs_dialog_finalize (GObject *object)
   g_hash_table_destroy (dialog->iso_639_table);
   g_hash_table_destroy (dialog->iso_3166_table);
 
-#ifdef ENABLE_SYNC
   if (dialog->fxa_web_view != NULL) {
     webkit_user_content_manager_unregister_script_message_handler (dialog->fxa_manager,
                                                                    "accountsCommandHandler");
     webkit_user_script_unref (dialog->fxa_script);
     g_object_unref (dialog->fxa_manager);
   }
-#endif
 
   G_OBJECT_CLASS (prefs_dialog_parent_class)->finalize (object);
 }
 
-#ifdef ENABLE_SYNC
 static void
 sync_sign_in_details_show (PrefsDialog *dialog,
                            const char  *text)
@@ -182,7 +172,6 @@ sync_sign_in_details_show (PrefsDialog *dialog,
   g_free (message);
 }
 
-
 static void
 sync_sign_in_error_cb (EphySyncService *service,
                        const char      *error,
@@ -427,7 +416,6 @@ on_sync_sign_out_button_clicked (GtkWidget   *button,
                       TRUE, TRUE, 0);
   gtk_widget_set_visible (dialog->sync_sign_in_details, FALSE);
 }
-#endif
 
 static void
 on_manage_cookies_button_clicked (GtkWidget   *button,
@@ -519,7 +507,6 @@ prefs_dialog_class_init (PrefsDialogClass *klass)
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, lang_down_button);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, enable_spell_checking_checkbutton);
 
-#ifdef ENABLE_SYNC
   /* sync */
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, sync_authenticate_box);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, sync_sign_in_box);
@@ -527,12 +514,11 @@ prefs_dialog_class_init (PrefsDialogClass *klass)
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, sync_sign_out_box);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, sync_sign_out_details);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, sync_sign_out_button);
-#endif
-  gtk_widget_class_bind_template_child (widget_class, PrefsDialog, notebook);
 
   gtk_widget_class_bind_template_callback (widget_class, on_manage_cookies_button_clicked);
   gtk_widget_class_bind_template_callback (widget_class, on_manage_passwords_button_clicked);
   gtk_widget_class_bind_template_callback (widget_class, on_search_engine_dialog_button_clicked);
+  gtk_widget_class_bind_template_callback (widget_class, on_sync_sign_out_button_clicked);
 }
 
 static void
@@ -1513,7 +1499,6 @@ setup_language_page (PrefsDialog *dialog)
   create_language_section (dialog);
 }
 
-#ifdef ENABLE_SYNC
 static void
 setup_sync_page (PrefsDialog *dialog)
 {
@@ -1547,7 +1532,6 @@ setup_sync_page (PrefsDialog *dialog)
                            G_CALLBACK (sync_sign_in_error_cb),
                            dialog, 0);
 }
-#endif
 
 static void
 prefs_dialog_init (PrefsDialog *dialog)
@@ -1572,19 +1556,9 @@ prefs_dialog_init (PrefsDialog *dialog)
   setup_fonts_page (dialog);
   setup_stored_data_page (dialog);
   setup_language_page (dialog);
-#ifdef ENABLE_SYNC
-  if (mode != EPHY_EMBED_SHELL_MODE_APPLICATION) {
+  if (mode != EPHY_EMBED_SHELL_MODE_APPLICATION)
     setup_sync_page (dialog);
 
-    /* TODO: Switch back to using a template callback in class_init once sync is unconditionally enabled. */
-    g_signal_connect (dialog->sync_sign_out_button, "clicked",
-                      G_CALLBACK (on_sync_sign_out_button_clicked), dialog);
-  } else
-    gtk_notebook_remove_page (GTK_NOTEBOOK (dialog->notebook), -1);
-#else
-  gtk_notebook_remove_page (GTK_NOTEBOOK (dialog->notebook), -1);
-#endif
-
   ephy_gui_ensure_window_group (GTK_WINDOW (dialog));
   g_signal_connect (dialog, "response",
                     G_CALLBACK (prefs_dialog_response_cb), dialog);


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