aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2004-06-09 19:00:22 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2004-06-09 19:00:22 +0800
commit029c9d46c634e62950ca2761deb0159f90a45cac (patch)
tree76f16e4990c168ecabd7279b84b421130da44d63 /src
parent97084e9c8c3435b994cdafe546b9f86e281ced5b (diff)
downloadgsoc2013-epiphany-029c9d46c634e62950ca2761deb0159f90a45cac.tar
gsoc2013-epiphany-029c9d46c634e62950ca2761deb0159f90a45cac.tar.gz
gsoc2013-epiphany-029c9d46c634e62950ca2761deb0159f90a45cac.tar.bz2
gsoc2013-epiphany-029c9d46c634e62950ca2761deb0159f90a45cac.tar.lz
gsoc2013-epiphany-029c9d46c634e62950ca2761deb0159f90a45cac.tar.xz
gsoc2013-epiphany-029c9d46c634e62950ca2761deb0159f90a45cac.tar.zst
gsoc2013-epiphany-029c9d46c634e62950ca2761deb0159f90a45cac.zip
Retain custom types when moving items around
2004-06-09 Marco Pesenti Gritti <marco@gnome.org> * lib/egg/egg-editable-toolbar.c: (drag_data_get_cb), (set_item_drag_source), (create_item_from_action), (create_item), (drag_data_received_cb), (egg_editable_toolbar_set_edit_mode): * lib/egg/egg-toolbar-editor.c: (model_has_action): * lib/egg/egg-toolbars-model.c: (egg_toolbars_model_item_nth): * lib/egg/egg-toolbars-model.h: * src/ephy-toolbars-model.c: (get_toolbar_and_item_pos), (ephy_toolbars_model_class_init), (item_added): Retain custom types when moving items around
Diffstat (limited to 'src')
-rwxr-xr-xsrc/ephy-toolbars-model.c35
1 files changed, 4 insertions, 31 deletions
diff --git a/src/ephy-toolbars-model.c b/src/ephy-toolbars-model.c
index 180e9a4d4..92bc0e1ab 100755
--- a/src/ephy-toolbars-model.c
+++ b/src/ephy-toolbars-model.c
@@ -267,9 +267,8 @@ get_toolbar_and_item_pos (EphyToolbarsModel *model,
const char *i_name;
gboolean is_separator;
- i_name = egg_toolbars_model_item_nth
- (EGG_TOOLBARS_MODEL (model), t, i,
- &is_separator);
+ egg_toolbars_model_item_nth (EGG_TOOLBARS_MODEL (model),
+ t, i, &is_separator, &i_name, NULL);
g_return_val_if_fail (i_name != NULL, FALSE);
if (strcmp (i_name, action_name) == 0)
@@ -309,30 +308,6 @@ get_toolbar_pos (EphyToolbarsModel *model,
return -1;
}
-static gboolean
-impl_add_item (EggToolbarsModel *t,
- int toolbar_position,
- int position,
- const char *id,
- const char *type)
-{
- EphyToolbarsModel *model = EPHY_TOOLBARS_MODEL (t);
- gboolean is_bookmark;
-
- is_bookmark = strcmp (type, EPHY_DND_TOPIC_TYPE) == 0 ||
- strcmp (type, EPHY_DND_URL_TYPE) == 0;
-
- if (!is_bookmark || !get_toolbar_and_item_pos (model, id, NULL, NULL))
- {
- return EGG_TOOLBARS_MODEL_CLASS (parent_class)->add_item
- (t, toolbar_position, position, id, type);
- }
- else
- {
- return FALSE;
- }
-}
-
static void
connect_item (EphyToolbarsModel *model,
const char *name)
@@ -463,7 +438,6 @@ ephy_toolbars_model_class_init (EphyToolbarsModelClass *klass)
object_class->set_property = ephy_toolbars_model_set_property;
object_class->get_property = ephy_toolbars_model_get_property;
- etm_class->add_item = impl_add_item;
etm_class->get_item_id = impl_get_item_id;
etm_class->get_item_name = impl_get_item_name;
etm_class->get_item_type = impl_get_item_type;
@@ -496,9 +470,8 @@ item_added (EphyToolbarsModel *model, int toolbar_position, int position)
const char *i_name;
gboolean is_separator;
- i_name = egg_toolbars_model_item_nth
- (EGG_TOOLBARS_MODEL (model), toolbar_position,
- position, &is_separator);
+ egg_toolbars_model_item_nth (EGG_TOOLBARS_MODEL (model), toolbar_position,
+ position, &is_separator, &i_name, NULL);
if (!is_separator)
{
connect_item (model, i_name);