aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rwxr-xr-xsrc/ephy-toolbars-model.c15
2 files changed, 17 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index d5666d5e6..e73ae6397 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2003-04-28 David Bordoley <bordoley@msu.edu>
+
+ * src/ephy-toolbars-model.c: (impl_add_item):
+
+ Check if the bookmarks bar already contains the dragged
+ bm or topic before adding it to the toolbar.
+
2003-04-28 Marco Pesenti Gritti <marco@it.gnome.org>
* lib/widgets/Makefile.am:
diff --git a/src/ephy-toolbars-model.c b/src/ephy-toolbars-model.c
index a256c485a..f4fb3a0d2 100755
--- a/src/ephy-toolbars-model.c
+++ b/src/ephy-toolbars-model.c
@@ -78,6 +78,8 @@ impl_add_item (EggToolbarsModel *t,
EphyBookmarks *bookmarks;
char *action_name = NULL;
const char *res;
+ gboolean topic = FALSE;
+ int id = -1;
LOG ("Add item %s", name)
@@ -86,8 +88,8 @@ impl_add_item (EggToolbarsModel *t,
if (gdk_atom_intern (EPHY_DND_TOPIC_TYPE, FALSE) == type)
{
GList *nodes;
- int id;
-
+
+ topic = TRUE;
nodes = ephy_dnd_node_list_extract_nodes (name);
id = ephy_node_get_id (EPHY_NODE (nodes->data));
action_name = g_strdup_printf ("GoTopicId%d", id);
@@ -96,8 +98,8 @@ impl_add_item (EggToolbarsModel *t,
else if (gdk_atom_intern (EPHY_DND_BOOKMARK_TYPE, FALSE) == type)
{
GList *nodes;
- int id;
+ topic = FALSE;
nodes = ephy_dnd_node_list_extract_nodes (name);
id = ephy_node_get_id (EPHY_NODE (nodes->data));
action_name = g_strdup_printf ("GoBookmarkId%d", id);
@@ -106,8 +108,11 @@ impl_add_item (EggToolbarsModel *t,
res = action_name ? action_name : name;
- EGG_TOOLBARS_MODEL_CLASS (parent_class)->add_item
- (t, toolbar_position, position, type, res);
+ if (!ephy_toolbars_model_has_bookmark (EPHY_TOOLBARS_MODEL (t), topic, id))
+ {
+ EGG_TOOLBARS_MODEL_CLASS (parent_class)->add_item
+ (t, toolbar_position, position, type, res);
+ }
return res;
}