[epiphany/gnome-3-24-loki] json-glib should not be required



commit 484d4a282e24952c4c27f4dc3ce382d5d19058fb
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Thu Sep 21 18:19:15 2017 -0500

    json-glib should not be required
    
    It's really only needed for sync, so stop using it unconditionally.

 configure.ac                  |    4 ++--
 src/bookmarks/ephy-bookmark.c |    6 ++++++
 src/bookmarks/ephy-bookmark.h |    3 +++
 src/prefs-dialog.c            |    3 ++-
 4 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index cfe5597..eaa07ca 100644
--- a/configure.ac
+++ b/configure.ac
@@ -108,7 +108,6 @@ 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([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])
@@ -140,7 +139,8 @@ AC_ARG_ENABLE([firefox-sync],
        [enable_firefox_sync=no]
 )
 AS_IF([test "x$enable_firefox_sync" = "xyes"],
-       [PKG_CHECK_MODULES([HOGWEED], [hogweed >= 3.2])
+       [PKG_CHECK_MODULES([JSON_GLIB], [json-glib-1.0 >= 1.2.0])
+        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])]
 )
diff --git a/src/bookmarks/ephy-bookmark.c b/src/bookmarks/ephy-bookmark.c
index ff0239b..7cd8e05 100644
--- a/src/bookmarks/ephy-bookmark.c
+++ b/src/bookmarks/ephy-bookmark.c
@@ -48,6 +48,7 @@ struct _EphyBookmark {
   gboolean     uploaded;
 };
 
+#ifdef ENABLE_SYNC
 static JsonSerializableIface *serializable_iface = NULL;
 
 static void json_serializable_iface_init (gpointer g_iface);
@@ -55,6 +56,9 @@ static void json_serializable_iface_init (gpointer g_iface);
 G_DEFINE_TYPE_WITH_CODE (EphyBookmark, ephy_bookmark, G_TYPE_OBJECT,
                         G_IMPLEMENT_INTERFACE (JSON_TYPE_SERIALIZABLE,
                                                json_serializable_iface_init))
+#else
+G_DEFINE_TYPE (EphyBookmark, ephy_bookmark, G_TYPE_OBJECT)
+#endif
 
 enum {
   PROP_0,
@@ -230,6 +234,7 @@ ephy_bookmark_init (EphyBookmark *self)
 #endif
 }
 
+#ifdef ENABLE_SYNC
 static JsonNode *
 ephy_bookmark_json_serializable_serialize_property (JsonSerializable *serializable,
                                                     const char       *name,
@@ -303,6 +308,7 @@ json_serializable_iface_init (gpointer g_iface)
   iface->serialize_property = ephy_bookmark_json_serializable_serialize_property;
   iface->deserialize_property = ephy_bookmark_json_serializable_deserialize_property;
 }
+#endif
 
 EphyBookmark *
 ephy_bookmark_new (const char *url, const char *title, GSequence *tags)
diff --git a/src/bookmarks/ephy-bookmark.h b/src/bookmarks/ephy-bookmark.h
index 1f49f04..11a8b0e 100644
--- a/src/bookmarks/ephy-bookmark.h
+++ b/src/bookmarks/ephy-bookmark.h
@@ -21,7 +21,10 @@
 #pragma once
 
 #include <glib-object.h>
+
+#ifdef ENABLE_SYNC
 #include <json-glib/json-glib.h>
+#endif
 
 G_BEGIN_DECLS
 
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index 571bf8c..e596028 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -47,10 +47,11 @@
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 #include <JavaScriptCore/JavaScript.h>
-#include <json-glib/json-glib.h>
 #include <string.h>
 
 #ifdef ENABLE_SYNC
+#include <json-glib/json-glib.h>
+
 #include "ephy-sync-crypto.h"
 #include "ephy-sync-secret.h"
 #include "ephy-sync-service.h"


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