diff options
author | Marco Pesenti Gritti <marco@it.gnome.org> | 2003-05-20 01:25:12 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <mpeseng@src.gnome.org> | 2003-05-20 01:25:12 +0800 |
commit | cc8f3060b3c57453f2128a573391add2a0bb47d4 (patch) | |
tree | a2f1965dfbadb7e8d0de464575abdf02ba6c3641 /src/bookmarks/ephy-bookmarks.c | |
parent | f9f7a48a13d9e876cb641af773a2eb88a4a0aaf6 (diff) | |
download | gsoc2013-epiphany-cc8f3060b3c57453f2128a573391add2a0bb47d4.tar gsoc2013-epiphany-cc8f3060b3c57453f2128a573391add2a0bb47d4.tar.gz gsoc2013-epiphany-cc8f3060b3c57453f2128a573391add2a0bb47d4.tar.bz2 gsoc2013-epiphany-cc8f3060b3c57453f2128a573391add2a0bb47d4.tar.lz gsoc2013-epiphany-cc8f3060b3c57453f2128a573391add2a0bb47d4.tar.xz gsoc2013-epiphany-cc8f3060b3c57453f2128a573391add2a0bb47d4.tar.zst gsoc2013-epiphany-cc8f3060b3c57453f2128a573391add2a0bb47d4.zip |
2003-05-19 Marco Pesenti Gritti <marco@it.gnome.org>
* lib/Makefile.am:
* lib/ephy-dnd.c: (ephy_dnd_node_list_extract_nodes):
* lib/ephy-node.c: (write_lock_to_read_lock),
(read_lock_to_write_lock), (lock_gdk), (unlock_gdk), (callback),
(ephy_node_emit_signal), (ephy_node_finalize), (real_remove_child),
(remove_child), (signal_object_weak_notify),
(unref_signal_objects), (ephy_node_dispose), (ephy_node_new),
(ephy_node_new_with_id), (ephy_node_get_id), (ephy_node_ref),
(ephy_node_unref), (ephy_node_freeze), (ephy_node_thaw),
(child_changed), (real_set_property), (ephy_node_set_property),
(ephy_node_get_property), (ephy_node_get_property_string),
(ephy_node_get_property_boolean), (ephy_node_get_property_long),
(ephy_node_get_property_int), (ephy_node_get_property_double),
(ephy_node_get_property_float), (ephy_node_get_property_node),
(save_parent), (ephy_node_save_to_xml), (real_add_child),
(ephy_node_new_from_xml), (ephy_node_add_child),
(ephy_node_remove_child), (ephy_node_has_child),
(ephy_node_real_get_child_index), (ephy_node_sort_children),
(ephy_node_reorder_children), (ephy_node_get_children),
(ephy_node_get_n_children), (ephy_node_get_nth_child),
(get_child_index_real), (ephy_node_get_child_index),
(ephy_node_get_next_child), (ephy_node_get_previous_child),
(ephy_node_signal_connect_object), (ephy_node_signal_disconnect):
* lib/ephy-node.h:
* lib/ephy-state.c: (ephy_states_load), (ensure_states),
(ephy_state_add_window), (ephy_state_add_paned), (ephy_state_save):
* lib/widgets/ephy-node-view.c: (ephy_node_view_class_init),
(ephy_node_view_selection_changed_cb),
(ephy_node_view_set_property), (ephy_node_view_get_property),
(ephy_node_view_remove):
* lib/widgets/ephy-tree-model-node.c:
(ephy_tree_model_node_class_init),
(ephy_tree_model_node_set_property),
(ephy_tree_model_node_get_property),
(ephy_tree_model_node_get_value), (ephy_tree_model_node_get_path),
(ephy_tree_model_node_iter_next),
(ephy_tree_model_node_node_from_iter):
* src/bookmarks/ephy-bookmark-action.c:
(ephy_bookmark_action_init), (ephy_bookmark_action_new):
* src/bookmarks/ephy-bookmark-properties.c:
(ephy_bookmark_properties_class_init),
(ephy_bookmark_properties_set_property):
* src/bookmarks/ephy-bookmarks-editor.c:
(cmd_show_in_bookmarks_bar), (cmd_open_bookmarks_in_tabs),
(cmd_open_bookmarks_in_browser), (cmd_delete),
(cmd_bookmark_properties), (cmd_copy),
(ephy_bookmarks_editor_node_activated_cb),
(ephy_bookmarks_editor_update_menu),
Diffstat (limited to 'src/bookmarks/ephy-bookmarks.c')
-rw-r--r-- | src/bookmarks/ephy-bookmarks.c | 51 |
1 files changed, 29 insertions, 22 deletions
diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c index 791440049..b43b1f981 100644 --- a/src/bookmarks/ephy-bookmarks.c +++ b/src/bookmarks/ephy-bookmarks.c @@ -43,6 +43,7 @@ struct EphyBookmarksPrivate { char *xml_file; + EphyNodeDb *db; EphyNode *bookmarks; EphyNode *keywords; EphyNode *favorites; @@ -284,7 +285,7 @@ ephy_bookmarks_load (EphyBookmarks *eb) { EphyNode *node; - node = ephy_node_new_from_xml (child); + node = ephy_node_new_from_xml (eb->priv->db, child); } xmlFreeDoc (doc); @@ -581,15 +582,19 @@ static void ephy_bookmarks_init (EphyBookmarks *eb) { GValue value = { 0, }; + EphyNodeDb *db; eb->priv = g_new0 (EphyBookmarksPrivate, 1); + db = ephy_node_db_new ("EphyBookmarks"); + eb->priv->db = db; + eb->priv->xml_file = g_build_filename (ephy_dot_dir (), "bookmarks.xml", NULL); /* Bookmarks */ - eb->priv->bookmarks = ephy_node_new_with_id (BOOKMARKS_NODE_ID); + eb->priv->bookmarks = ephy_node_new_with_id (db, BOOKMARKS_NODE_ID); ephy_node_ref (eb->priv->bookmarks); g_value_init (&value, G_TYPE_STRING); g_value_set_string (&value, _("All")); @@ -597,19 +602,17 @@ ephy_bookmarks_init (EphyBookmarks *eb) EPHY_NODE_KEYWORD_PROP_NAME, &value); g_value_unset (&value); - g_signal_connect_object (G_OBJECT (eb->priv->bookmarks), - "child_removed", - G_CALLBACK (bookmarks_removed_cb), - G_OBJECT (eb), - 0); - g_signal_connect_object (G_OBJECT (eb->priv->bookmarks), - "child_changed", - G_CALLBACK (bookmarks_changed_cb), - G_OBJECT (eb), - 0); + ephy_node_signal_connect_object (eb->priv->bookmarks, + EPHY_NODE_CHILD_REMOVED, + (EphyNodeCallback) bookmarks_removed_cb, + G_OBJECT (eb)); + ephy_node_signal_connect_object (eb->priv->bookmarks, + EPHY_NODE_CHILD_CHANGED, + (EphyNodeCallback) bookmarks_changed_cb, + G_OBJECT (eb)); /* Keywords */ - eb->priv->keywords = ephy_node_new_with_id (KEYWORDS_NODE_ID); + eb->priv->keywords = ephy_node_new_with_id (db, KEYWORDS_NODE_ID); ephy_node_ref (eb->priv->keywords); g_value_init (&value, G_TYPE_INT); g_value_set_int (&value, EPHY_NODE_ALL_PRIORITY); @@ -617,17 +620,16 @@ ephy_bookmarks_init (EphyBookmarks *eb) EPHY_NODE_KEYWORD_PROP_PRIORITY, &value); g_value_unset (&value); - g_signal_connect_object (G_OBJECT (eb->priv->keywords), - "child_removed", - G_CALLBACK (topics_removed_cb), - G_OBJECT (eb), - 0); + ephy_node_signal_connect_object (eb->priv->keywords, + EPHY_NODE_CHILD_REMOVED, + (EphyNodeCallback) topics_removed_cb, + G_OBJECT (eb)); ephy_node_add_child (eb->priv->keywords, eb->priv->bookmarks); /* Favorites */ - eb->priv->favorites = ephy_node_new_with_id (FAVORITES_NODE_ID); + eb->priv->favorites = ephy_node_new_with_id (db, FAVORITES_NODE_ID); ephy_node_ref (eb->priv->favorites); g_value_init (&value, G_TYPE_STRING); g_value_set_string (&value, _("Most Visited")); @@ -644,7 +646,7 @@ ephy_bookmarks_init (EphyBookmarks *eb) ephy_node_add_child (eb->priv->keywords, eb->priv->favorites); /* Not categorized */ - eb->priv->notcategorized = ephy_node_new_with_id (BMKS_NOTCATEGORIZED_NODE_ID); + eb->priv->notcategorized = ephy_node_new_with_id (db, BMKS_NOTCATEGORIZED_NODE_ID); ephy_node_ref (eb->priv->notcategorized); g_value_init (&value, G_TYPE_STRING); g_value_set_string (&value, _("Not Categorized")); @@ -715,7 +717,7 @@ ephy_bookmarks_add (EphyBookmarks *eb, EphyNode *bm; GValue value = { 0, }; - bm = ephy_node_new (); + bm = ephy_node_new (eb->priv->db); g_value_init (&value, G_TYPE_STRING); g_value_set_string (&value, title); @@ -952,7 +954,7 @@ ephy_bookmarks_add_keyword (EphyBookmarks *eb, EphyNode *key; GValue value = { 0, }; - key = ephy_node_new (); + key = ephy_node_new (eb->priv->db); g_value_init (&value, G_TYPE_STRING); g_value_set_string (&value, name); @@ -1094,3 +1096,8 @@ ephy_bookmarks_get_favorites (EphyBookmarks *eb) return eb->priv->favorites; } +EphyNode * +ephy_bookmarks_get_from_id (EphyBookmarks *eb, long id) +{ + return ephy_node_db_get_node_from_id (eb->priv->db, id); +} |