aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-10-03 04:50:25 +0800
committerChristian Persch <chpe@src.gnome.org>2005-10-03 04:50:25 +0800
commitd7fea59666e1aaf5ecc97219538b79932173e135 (patch)
tree24a6c0522ec116d6d72e46a6d8fad6c74e4b429e /src/bookmarks
parentae8ea41f87ce8c1e69c6a9ebe03eb154fcbe22b3 (diff)
downloadgsoc2013-epiphany-d7fea59666e1aaf5ecc97219538b79932173e135.tar
gsoc2013-epiphany-d7fea59666e1aaf5ecc97219538b79932173e135.tar.gz
gsoc2013-epiphany-d7fea59666e1aaf5ecc97219538b79932173e135.tar.bz2
gsoc2013-epiphany-d7fea59666e1aaf5ecc97219538b79932173e135.tar.lz
gsoc2013-epiphany-d7fea59666e1aaf5ecc97219538b79932173e135.tar.xz
gsoc2013-epiphany-d7fea59666e1aaf5ecc97219538b79932173e135.tar.zst
gsoc2013-epiphany-d7fea59666e1aaf5ecc97219538b79932173e135.zip
Add configure switch to disable zeroconf bookmarks, since they're almost
2005-10-02 Christian Persch <chpe@cvs.gnome.org> * configure.ac: * src/bookmarks/ephy-bookmarks.c: (save_filter), (ephy_bookmarks_save), (update_bookmark_keywords), (bookmark_is_categorized), (ephy_bookmarks_init), (ephy_bookmarks_finalize), (ephy_bookmarks_get_topic_uri), (ephy_bookmarks_find_keyword): * src/epiphany.defs: Add configure switch to disable zeroconf bookmarks, since they're almost useless since just about nobody ships gnome-vfs with howl support enabled, and have also been reported to cause long delays on startup.
Diffstat (limited to 'src/bookmarks')
-rw-r--r--src/bookmarks/ephy-bookmarks.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c
index 4a9357834..c6435e40d 100644
--- a/src/bookmarks/ephy-bookmarks.c
+++ b/src/bookmarks/ephy-bookmarks.c
@@ -75,10 +75,12 @@ struct _EphyBookmarksPrivate
GHashTable *props_dialogs;
guint disable_bookmark_editing_notifier_id;
+#ifdef ENABLE_ZEROCONF
/* Local sites */
EphyNode *local;
GnomeVFSDNSSDBrowseHandle *browse_handle;
GList *resolve_list;
+#endif
};
typedef struct
@@ -343,9 +345,14 @@ save_filter (EphyNode *node,
return node != priv->bookmarks &&
node != priv->favorites &&
node != priv->notcategorized &&
+#ifdef ENABLE_ZEROCONF
node != priv->local;
+#else
+ TRUE;
+#endif
}
+#ifdef ENABLE_ZEROCONF
static gboolean
save_filter_local (EphyNode *node,
EphyBookmarks *bookmarks)
@@ -354,6 +361,7 @@ save_filter_local (EphyNode *node,
return !ephy_node_has_child (priv->local, node);
}
+#endif
static void
ephy_bookmarks_save (EphyBookmarks *eb)
@@ -368,7 +376,11 @@ ephy_bookmarks_save (EphyBookmarks *eb)
(xmlChar *) EPHY_BOOKMARKS_XML_VERSION,
(xmlChar *) "Do not rely on this file, it's only for internal use. Use bookmarks.rdf instead.",
eb->priv->keywords, (EphyNodeFilterFunc) save_filter, eb,
+#ifdef ENABLE_ZEROCONF
eb->priv->bookmarks, (EphyNodeFilterFunc) save_filter_local, eb,
+#else
+ eb->priv->bookmarks, NULL, eb,
+#endif
NULL);
/* Export bookmarks in rdf */
@@ -656,7 +668,9 @@ update_bookmark_keywords (EphyBookmarks *eb, EphyNode *bookmark)
if (kid != eb->priv->notcategorized &&
kid != eb->priv->favorites &&
kid != eb->priv->bookmarks &&
+#ifdef ENABLE_ZEROCONF
kid != eb->priv->local &&
+#endif
ephy_node_has_child (kid, bookmark))
{
const char *topic;
@@ -725,7 +739,9 @@ bookmark_is_categorized (EphyBookmarks *eb, EphyNode *bookmark)
if (kid != eb->priv->notcategorized &&
kid != eb->priv->favorites &&
kid != eb->priv->bookmarks &&
+#ifdef ENABLE_ZEROCONF
kid != eb->priv->local &&
+#endif
ephy_node_has_child (kid, bookmark))
{
return TRUE;
@@ -812,6 +828,8 @@ backup_file (const char *original_filename, const char *extension)
g_free (backup_filename);
}
+#ifdef ENABLE_ZEROCONF
+
static void
resolve_cb (GnomeVFSDNSSDResolveHandle *handle,
GnomeVFSResult result,
@@ -949,6 +967,8 @@ ephy_local_bookmarks_stop (EphyBookmarks *bookmarks)
priv->resolve_list = NULL;
}
+#endif /* ENABLE_ZEROCONF */
+
static void
ephy_bookmarks_init (EphyBookmarks *eb)
{
@@ -1044,6 +1064,7 @@ ephy_bookmarks_init (EphyBookmarks *eb)
g_value_unset (&value);
ephy_node_add_child (eb->priv->keywords, eb->priv->notcategorized);
+#ifdef ENABLE_ZEROCONF
/* Local Websites */
eb->priv->local = ephy_node_new_with_id (db, BMKS_LOCAL_NODE_ID);
@@ -1068,6 +1089,7 @@ ephy_bookmarks_init (EphyBookmarks *eb)
g_value_unset (&value);
ephy_node_add_child (eb->priv->keywords, eb->priv->local);
ephy_local_bookmarks_init (eb);
+#endif /* ENABLE_ZEROCONF */
/* Smart bookmarks */
eb->priv->smartbookmarks = ephy_node_new_with_id (db, SMARTBOOKMARKS_NODE_ID);
@@ -1122,7 +1144,9 @@ ephy_bookmarks_finalize (GObject *object)
g_source_remove (eb->priv->save_timeout_id);
}
+#ifdef ENABLE_ZEROCONF
ephy_local_bookmarks_stop (eb);
+#endif
ephy_bookmarks_save (eb);
@@ -1534,10 +1558,12 @@ ephy_bookmarks_get_topic_uri (EphyBookmarks *eb,
{
uri = g_strdup ("topic://Special/Favorites");
}
+#ifdef ENABLE_ZEROCONF
else if (ephy_bookmarks_get_local (eb) == node)
{
uri = g_strdup ("topic://Special/Local");
}
+#endif
else
{
const char *name;
@@ -1583,10 +1609,12 @@ ephy_bookmarks_find_keyword (EphyBookmarks *eb,
{
return ephy_bookmarks_get_favorites (eb);
}
+#ifdef ENABLE_ZEROCONF
else if (strcmp (name, "topic://Special/Local") == 0)
{
return ephy_bookmarks_get_local (eb);
}
+#endif
else if (g_str_has_prefix (name, "topic://"))
{
topic_name += strlen ("topic://");
@@ -1687,11 +1715,13 @@ ephy_bookmarks_get_favorites (EphyBookmarks *eb)
return eb->priv->favorites;
}
+#ifdef ENABLE_ZEROCONF
EphyNode *
ephy_bookmarks_get_local (EphyBookmarks *eb)
{
return eb->priv->local;
}
+#endif
EphyNode *
ephy_bookmarks_get_not_categorized (EphyBookmarks *eb)