aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/ephy-toolbars-model.c55
1 files changed, 31 insertions, 24 deletions
diff --git a/src/ephy-toolbars-model.c b/src/ephy-toolbars-model.c
index 132172f91..0de9d97f5 100755
--- a/src/ephy-toolbars-model.c
+++ b/src/ephy-toolbars-model.c
@@ -281,6 +281,30 @@ get_toolbar_and_item_pos (EphyToolbarsModel *model,
return FALSE;
}
+static int
+get_toolbar_pos (EphyToolbarsModel *model,
+ const char *name)
+{
+ int i, n_toolbars;
+
+ n_toolbars = egg_toolbars_model_n_toolbars
+ (EGG_TOOLBARS_MODEL (model));
+
+ for (i = 0; i < n_toolbars; i++)
+ {
+ const char *t_name;
+
+ t_name = egg_toolbars_model_toolbar_nth
+ (EGG_TOOLBARS_MODEL (model), i);
+ if (strcmp (name, t_name) == 0)
+ {
+ return i;
+ }
+ }
+
+ return -1;
+}
+
static gboolean
impl_add_item (EggToolbarsModel *t,
int toolbar_position,
@@ -375,6 +399,13 @@ ephy_toolbars_model_set_bookmarks (EphyToolbarsModel *model, EphyBookmarks *book
egg_toolbars_model_load (egg_model, default_xml);
}
+ /* ensure that we have a BookmarksBar */
+ if (get_toolbar_pos (model, "BookmarksBar") == -1)
+ {
+ egg_toolbars_model_add_toolbar
+ (EGG_TOOLBARS_MODEL (model), -1, "BookmarksBar");
+ }
+
model->priv->loading = FALSE;
}
@@ -531,30 +562,6 @@ ephy_toolbars_model_new (EphyBookmarks *bookmarks)
NULL));
}
-static int
-get_toolbar_pos (EphyToolbarsModel *model,
- const char *name)
-{
- int i, n_toolbars;
-
- n_toolbars = egg_toolbars_model_n_toolbars
- (EGG_TOOLBARS_MODEL (model));
-
- for (i = 0; i < n_toolbars; i++)
- {
- const char *t_name;
-
- t_name = egg_toolbars_model_toolbar_nth
- (EGG_TOOLBARS_MODEL (model), i);
- if (strcmp (name, t_name) == 0)
- {
- return i;
- }
- }
-
- return -1;
-}
-
void
ephy_toolbars_model_remove_bookmark (EphyToolbarsModel *model,
long id)