aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks/ephy-bookmarks.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bookmarks/ephy-bookmarks.c')
-rw-r--r--src/bookmarks/ephy-bookmarks.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c
index 7cfd86e7d..15f635add 100644
--- a/src/bookmarks/ephy-bookmarks.c
+++ b/src/bookmarks/ephy-bookmarks.c
@@ -134,6 +134,7 @@ static void ephy_bookmarks_class_init (EphyBookmarksClass *klass);
static void ephy_bookmarks_init (EphyBookmarks *tab);
static void ephy_bookmarks_finalize (GObject *object);
static char *impl_resolve_address (EphyBookmarks*, const char*, const char*);
+static void ephy_local_bookmarks_start_client (EphyBookmarks *bookmarks);
G_DEFINE_TYPE_WITH_CODE (EphyBookmarks, ephy_bookmarks, G_TYPE_OBJECT,
volatile GType flags_type; /* work around gcc's optimiser */
@@ -1132,14 +1133,12 @@ ga_client_state_changed_cb (GaClient *ga_client,
{
if (avahi_client_errno (ga_client->avahi_client) == AVAHI_ERR_DISCONNECTED)
{
- /* FIXMEchpe: is this correct */
- /* Destroy and reconnect */
- avahi_client_free (ga_client->avahi_client);
- ga_client->avahi_client = NULL;
- if (!ga_client_start (ga_client, NULL))
- {
- g_warning ("Unable to start Zeroconf subsystem");
- }
+ EphyBookmarksPrivate *priv = bookmarks->priv;
+
+ g_object_unref (priv->ga_client);
+ priv->ga_client = NULL;
+
+ ephy_local_bookmarks_start_client (bookmarks);
}
}
if (state == GA_CLIENT_STATE_S_RUNNING)
@@ -1149,7 +1148,7 @@ ga_client_state_changed_cb (GaClient *ga_client,
}
static void
-ephy_local_bookmarks_init (EphyBookmarks *bookmarks)
+ephy_local_bookmarks_start_client (EphyBookmarks *bookmarks)
{
EphyBookmarksPrivate *priv = bookmarks->priv;
GaClient *ga_client;
@@ -1161,12 +1160,20 @@ ephy_local_bookmarks_init (EphyBookmarks *bookmarks)
if (!ga_client_start (ga_client, NULL))
{
g_warning ("Unable to start Zeroconf subsystem");
+ g_object_unref (ga_client);
return;
}
priv->ga_client = ga_client;
+}
+
+static void
+ephy_local_bookmarks_init (EphyBookmarks *bookmarks)
+{
+ EphyBookmarksPrivate *priv = bookmarks->priv;
priv->resolve_handles = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free,
(GDestroyNotify) resolve_data_free);
+ ephy_local_bookmarks_start_client (bookmarks);
}
static void