aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-06-12 00:14:59 +0800
committerChristian Persch <chpe@src.gnome.org>2004-06-12 00:14:59 +0800
commitd3938a1cec5e2520289e37ff1ce5e2f808c97f03 (patch)
tree9bbe3b9627571500cc8ad9184de7720054297c8d
parentbf52ee9c4c4c1882ecd6bc72719c4361ad535d11 (diff)
downloadgsoc2013-epiphany-d3938a1cec5e2520289e37ff1ce5e2f808c97f03.tar
gsoc2013-epiphany-d3938a1cec5e2520289e37ff1ce5e2f808c97f03.tar.gz
gsoc2013-epiphany-d3938a1cec5e2520289e37ff1ce5e2f808c97f03.tar.bz2
gsoc2013-epiphany-d3938a1cec5e2520289e37ff1ce5e2f808c97f03.tar.lz
gsoc2013-epiphany-d3938a1cec5e2520289e37ff1ce5e2f808c97f03.tar.xz
gsoc2013-epiphany-d3938a1cec5e2520289e37ff1ce5e2f808c97f03.tar.zst
gsoc2013-epiphany-d3938a1cec5e2520289e37ff1ce5e2f808c97f03.zip
Save the toolbars models from dispose, not from finalize, since you cannot
2004-06-11 Christian Persch <chpe@cvs.gnome.org> * src/bookmarks/ephy-bookmarks.c: (ephy_bookmarks_finalize): * src/bookmarks/ephy-bookmarksbar-model.c: (ephy_bookmarksbar_model_dispose), (ephy_bookmarksbar_model_finalize), (ephy_bookmarksbar_model_class_init): * src/ephy-toolbars-model.c: (ephy_toolbars_model_dispose), (ephy_toolbars_model_finalize), (ephy_toolbars_model_class_init): Save the toolbars models from dispose, not from finalize, since you cannot emit signals from the latter (the get_item_* signals are emitted while saving).
-rw-r--r--ChangeLog14
-rw-r--r--src/bookmarks/ephy-bookmarks.c13
-rwxr-xr-xsrc/bookmarks/ephy-bookmarksbar-model.c14
-rwxr-xr-xsrc/ephy-toolbars-model.c14
4 files changed, 43 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 3233d9ec5..009a6662f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2004-06-11 Christian Persch <chpe@cvs.gnome.org>
+
+ * src/bookmarks/ephy-bookmarks.c: (ephy_bookmarks_finalize):
+ * src/bookmarks/ephy-bookmarksbar-model.c:
+ (ephy_bookmarksbar_model_dispose),
+ (ephy_bookmarksbar_model_finalize),
+ (ephy_bookmarksbar_model_class_init):
+ * src/ephy-toolbars-model.c: (ephy_toolbars_model_dispose),
+ (ephy_toolbars_model_finalize), (ephy_toolbars_model_class_init):
+
+ Save the toolbars models from dispose, not from finalize, since you
+ cannot emit signals from the latter (the get_item_* signals are
+ emitted while saving).
+
2004-06-11 Marco Pesenti Gritti <marco@gnome.org>
* configure.in:
diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c
index be9884956..84c84f92c 100644
--- a/src/bookmarks/ephy-bookmarks.c
+++ b/src/bookmarks/ephy-bookmarks.c
@@ -809,6 +809,13 @@ ephy_bookmarks_finalize (GObject *object)
ephy_bookmarks_save (eb);
+ /* have to do this before unreffing the nodes */
+ LOG ("Unref bookmarks toolbars model")
+ if (eb->priv->toolbars_model != NULL)
+ {
+ g_object_unref (eb->priv->toolbars_model);
+ }
+
ephy_node_unref (eb->priv->bookmarks);
ephy_node_unref (eb->priv->keywords);
ephy_node_unref (eb->priv->favorites);
@@ -816,12 +823,6 @@ ephy_bookmarks_finalize (GObject *object)
g_object_unref (eb->priv->db);
- LOG ("Unref bookmarks toolbars model")
- if (eb->priv->toolbars_model != NULL)
- {
- g_object_unref (eb->priv->toolbars_model);
- }
-
g_free (eb->priv->xml_file);
g_free (eb->priv->rdf_file);
diff --git a/src/bookmarks/ephy-bookmarksbar-model.c b/src/bookmarks/ephy-bookmarksbar-model.c
index fc969fddc..df70ca583 100755
--- a/src/bookmarks/ephy-bookmarksbar-model.c
+++ b/src/bookmarks/ephy-bookmarksbar-model.c
@@ -490,6 +490,16 @@ ephy_bookmarksbar_model_init (EphyBookmarksBarModel *model)
}
static void
+ephy_bookmarksbar_model_dispose (GObject *object)
+{
+ EphyBookmarksBarModel *model = EPHY_BOOKMARKSBAR_MODEL (object);
+
+ save_changes_idle (model);
+
+ G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
+static void
ephy_bookmarksbar_model_finalize (GObject *object)
{
EphyBookmarksBarModel *model = EPHY_BOOKMARKSBAR_MODEL (object);
@@ -500,9 +510,6 @@ ephy_bookmarksbar_model_finalize (GObject *object)
model->priv->timeout = 0;
}
- /* FIXME: instead of saving on exit, we should detect when items data changes */
- save_changes_idle (model);
-
g_free (model->priv->xml_file);
G_OBJECT_CLASS (parent_class)->finalize (object);
@@ -544,6 +551,7 @@ ephy_bookmarksbar_model_class_init (EphyBookmarksBarModelClass *klass)
parent_class = g_type_class_peek_parent (klass);
+ object_class->dispose = ephy_bookmarksbar_model_dispose;
object_class->finalize = ephy_bookmarksbar_model_finalize;
object_class->set_property = ephy_bookmarksbar_model_set_property;
object_class->get_property = ephy_bookmarksbar_model_get_property;
diff --git a/src/ephy-toolbars-model.c b/src/ephy-toolbars-model.c
index b730b93e2..a1dfdda83 100755
--- a/src/ephy-toolbars-model.c
+++ b/src/ephy-toolbars-model.c
@@ -220,6 +220,16 @@ ephy_toolbars_model_init (EphyToolbarsModel *model)
}
static void
+ephy_toolbars_model_dispose (GObject *object)
+{
+ EphyToolbarsModel *model = EPHY_TOOLBARS_MODEL (object);
+
+ save_changes_idle (model);
+
+ G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
+static void
ephy_toolbars_model_finalize (GObject *object)
{
EphyToolbarsModel *model = EPHY_TOOLBARS_MODEL (object);
@@ -230,9 +240,6 @@ ephy_toolbars_model_finalize (GObject *object)
model->priv->timeout = 0;
}
- /* FIXME: we should detect when item data changes, and save then instead */
- save_changes_idle (model);
-
g_free (model->priv->xml_file);
G_OBJECT_CLASS (parent_class)->finalize (object);
@@ -245,6 +252,7 @@ ephy_toolbars_model_class_init (EphyToolbarsModelClass *klass)
parent_class = g_type_class_peek_parent (klass);
+ object_class->dispose = ephy_toolbars_model_dispose;
object_class->finalize = ephy_toolbars_model_finalize;
g_type_class_add_private (object_class, sizeof (EphyToolbarsModelPrivate));