diff options
Diffstat (limited to 'src/ephy-toolbars-model.c')
-rwxr-xr-x | src/ephy-toolbars-model.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ephy-toolbars-model.c b/src/ephy-toolbars-model.c index 6384b06e5..55d351873 100755 --- a/src/ephy-toolbars-model.c +++ b/src/ephy-toolbars-model.c @@ -56,6 +56,8 @@ enum static GObjectClass *parent_class = NULL; +#define EPHY_TOOLBARS_MODEL_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_TOOLBARS_MODEL, EphyToolbarsModelPrivate)) + struct EphyToolbarsModelPrivate { EphyBookmarks *bookmarks; @@ -403,8 +405,10 @@ ephy_toolbars_model_class_init (EphyToolbarsModelClass *klass) g_param_spec_object ("bookmarks", "Bookmarks", "Bookmarks", - EPHY_BOOKMARKS_TYPE, + EPHY_TYPE_BOOKMARKS, G_PARAM_READWRITE)); + + g_type_class_add_private (object_class, sizeof(EphyToolbarsModelPrivate)); } static void @@ -456,7 +460,8 @@ toolbar_removed (EphyToolbarsModel *model, int position) static void ephy_toolbars_model_init (EphyToolbarsModel *t) { - t->priv = g_new0 (EphyToolbarsModelPrivate, 1); + t->priv = EPHY_TOOLBARS_MODEL_GET_PRIVATE (t); + t->priv->bookmarks = NULL; t->priv->loading = FALSE; t->priv->xml_file = g_build_filename (ephy_dot_dir (), @@ -474,17 +479,12 @@ ephy_toolbars_model_finalize (GObject *object) { EphyToolbarsModel *t = EPHY_TOOLBARS_MODEL (object); - g_return_if_fail (object != NULL); - g_return_if_fail (IS_EPHY_TOOLBARS_MODEL (object)); - save_changes (t); g_object_unref (t->priv->bookmarks); g_free (t->priv->xml_file); - g_free (t->priv); - G_OBJECT_CLASS (parent_class)->finalize (object); } @@ -493,7 +493,7 @@ ephy_toolbars_model_new (EphyBookmarks *bookmarks) { EphyToolbarsModel *t; - t = EPHY_TOOLBARS_MODEL (g_object_new (EPHY_TOOLBARS_MODEL_TYPE, + t = EPHY_TOOLBARS_MODEL (g_object_new (EPHY_TYPE_TOOLBARS_MODEL, "bookmarks", bookmarks, NULL)); |