aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Bordoley <bordoley@msu.edu>2003-04-29 02:41:00 +0800
committerDave Bordoley <Bordoley@src.gnome.org>2003-04-29 02:41:00 +0800
commit48834c65ab583d46eaa331f4661ad35eb6de14e1 (patch)
tree21b49b27be23dc3b2fbc87a5cc1194c52999580a
parent93c335f91a7b6f48a0f1aa16e1d493a6dbbe115f (diff)
downloadgsoc2013-epiphany-48834c65ab583d46eaa331f4661ad35eb6de14e1.tar
gsoc2013-epiphany-48834c65ab583d46eaa331f4661ad35eb6de14e1.tar.gz
gsoc2013-epiphany-48834c65ab583d46eaa331f4661ad35eb6de14e1.tar.bz2
gsoc2013-epiphany-48834c65ab583d46eaa331f4661ad35eb6de14e1.tar.lz
gsoc2013-epiphany-48834c65ab583d46eaa331f4661ad35eb6de14e1.tar.xz
gsoc2013-epiphany-48834c65ab583d46eaa331f4661ad35eb6de14e1.tar.zst
gsoc2013-epiphany-48834c65ab583d46eaa331f4661ad35eb6de14e1.zip
Check if the bookmarks bar already contains the dragged bm or topic before
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.
-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;
}