aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-03-25 02:01:35 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-03-25 02:01:35 +0800
commitbb4528f9eef4b9417a4d7a2c7c012d8a3136170a (patch)
tree84b00ab9e0ca17eee787127bb79a1e3f8607b498 /src/bookmarks
parent2dba798e1f6e6c29db3bffa922b9831197bd3e16 (diff)
downloadgsoc2013-epiphany-bb4528f9eef4b9417a4d7a2c7c012d8a3136170a.tar
gsoc2013-epiphany-bb4528f9eef4b9417a4d7a2c7c012d8a3136170a.tar.gz
gsoc2013-epiphany-bb4528f9eef4b9417a4d7a2c7c012d8a3136170a.tar.bz2
gsoc2013-epiphany-bb4528f9eef4b9417a4d7a2c7c012d8a3136170a.tar.lz
gsoc2013-epiphany-bb4528f9eef4b9417a4d7a2c7c012d8a3136170a.tar.xz
gsoc2013-epiphany-bb4528f9eef4b9417a4d7a2c7c012d8a3136170a.tar.zst
gsoc2013-epiphany-bb4528f9eef4b9417a4d7a2c7c012d8a3136170a.zip
Fix warning opening selector. Destroy the editor on exit, ref the shell so
2003-03-24 Marco Pesenti Gritti <marco@it.gnome.org> * src/bookmarks/ephy-bookmarks.c: (update_topics_list), (ephy_bookmarks_set_keyword), (ephy_bookmarks_unset_keyword): * src/bookmarks/ephy-topics-selector.c: (ephy_topics_selector_set_property): * src/window-commands.c: (bookmarks_hide_cb), (shell_weak_notify_cb), (window_cmd_go_bookmarks): Fix warning opening selector. Destroy the editor on exit, ref the shell so you can have just the editor open. Build the key list and set is as property of the node (should solve autocompletion problems).
Diffstat (limited to 'src/bookmarks')
-rw-r--r--src/bookmarks/ephy-bookmarks.c40
-rw-r--r--src/bookmarks/ephy-topics-selector.c1
2 files changed, 41 insertions, 0 deletions
diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c
index 5c4bd0694..3a3b0dc48 100644
--- a/src/bookmarks/ephy-bookmarks.c
+++ b/src/bookmarks/ephy-bookmarks.c
@@ -832,6 +832,42 @@ ephy_bookmarks_has_keyword (EphyBookmarks *eb,
return ephy_node_has_child (keyword, bookmark);
}
+static void
+update_topics_list (EphyBookmarks *eb, EphyNode *bookmark)
+{
+ GPtrArray *children;
+ int i;
+ GString *list;
+ GValue value = { 0, };
+
+ list = g_string_new (NULL);
+
+ children = ephy_node_get_children (eb->priv->keywords);
+ for (i = 0; i < children->len; i++)
+ {
+ EphyNode *kid;
+
+ kid = g_ptr_array_index (children, i);
+
+ if (ephy_node_has_child (kid, bookmark))
+ {
+ const char *topic;
+ topic = ephy_node_get_property_string
+ (kid, EPHY_NODE_KEYWORD_PROP_NAME);
+ g_string_append (list, topic);
+ }
+ }
+ ephy_node_thaw (eb->priv->keywords);
+
+ g_value_init (&value, G_TYPE_STRING);
+ g_value_set_string (&value, list->str);
+ ephy_node_set_property (bookmark, EPHY_NODE_BMK_PROP_KEYWORDS,
+ &value);
+ g_value_unset (&value);
+
+ g_string_free (list, TRUE);
+}
+
void
ephy_bookmarks_set_keyword (EphyBookmarks *eb,
EphyNode *keyword,
@@ -840,6 +876,8 @@ ephy_bookmarks_set_keyword (EphyBookmarks *eb,
if (ephy_node_has_child (keyword, bookmark)) return;
ephy_node_add_child (keyword, bookmark);
+
+ update_topics_list (eb, bookmark);
}
void
@@ -850,6 +888,8 @@ ephy_bookmarks_unset_keyword (EphyBookmarks *eb,
if (!ephy_node_has_child (keyword, bookmark)) return;
ephy_node_remove_child (keyword, bookmark);
+
+ update_topics_list (eb, bookmark);
}
EphyNode *
diff --git a/src/bookmarks/ephy-topics-selector.c b/src/bookmarks/ephy-topics-selector.c
index 9ebccb97e..a86c1a48b 100644
--- a/src/bookmarks/ephy-topics-selector.c
+++ b/src/bookmarks/ephy-topics-selector.c
@@ -161,6 +161,7 @@ ephy_topics_selector_set_property (GObject *object,
case PROP_BOOKMARK:
ephy_topics_selector_set_bookmark
(selector, g_value_get_object (value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;