aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-01-09 21:03:55 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-01-09 21:03:55 +0800
commit7d278d4b5910d1adc5e075882aa559e8da407c4a (patch)
tree44d8ca418545e23c408b413548c5f8f710cdd6de
parent05dc477f8e2a3943fd5eea73ae137cbcd544ce31 (diff)
downloadgsoc2013-epiphany-7d278d4b5910d1adc5e075882aa559e8da407c4a.tar
gsoc2013-epiphany-7d278d4b5910d1adc5e075882aa559e8da407c4a.tar.gz
gsoc2013-epiphany-7d278d4b5910d1adc5e075882aa559e8da407c4a.tar.bz2
gsoc2013-epiphany-7d278d4b5910d1adc5e075882aa559e8da407c4a.tar.lz
gsoc2013-epiphany-7d278d4b5910d1adc5e075882aa559e8da407c4a.tar.xz
gsoc2013-epiphany-7d278d4b5910d1adc5e075882aa559e8da407c4a.tar.zst
gsoc2013-epiphany-7d278d4b5910d1adc5e075882aa559e8da407c4a.zip
Extend ephy node to allow some reversed ids. Use it for base
2003-01-09 Marco Pesenti Gritti <marco@it.gnome.org> * TODO: * embed/ephy-history.c: (ephy_history_init): * embed/mozilla/FilePicker.cpp: * lib/ephy-node.c: (ephy_node_new_with_id), (ephy_node_system_init): * lib/ephy-node.h: * src/bookmarks/ephy-bookmarks.c: (ephy_bookmarks_init): Extend ephy node to allow some reversed ids. Use it for base bookmarks/history elements, should fix bookmarks lossage. Fix filepicker initialization.
-rw-r--r--ChangeLog15
-rw-r--r--TODO1
-rw-r--r--embed/ephy-history.c12
-rw-r--r--embed/mozilla/FilePicker.cpp2
-rw-r--r--lib/ephy-node.c22
-rw-r--r--lib/ephy-node.h2
-rw-r--r--src/bookmarks/ephy-bookmarks.c10
7 files changed, 56 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index ca17a3d0b..e06da760f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2003-01-09 Marco Pesenti Gritti <marco@it.gnome.org>
+
+ * TODO:
+ * embed/ephy-history.c: (ephy_history_init):
+ * embed/mozilla/FilePicker.cpp:
+ * lib/ephy-node.c: (ephy_node_new_with_id),
+ (ephy_node_system_init):
+ * lib/ephy-node.h:
+ * src/bookmarks/ephy-bookmarks.c: (ephy_bookmarks_init):
+
+ Extend ephy node to allow some reversed ids.
+ Use it for base bookmarks/history elements, should
+ fix bookmarks lossage.
+ Fix filepicker initialization.
+
2003-01-08 Marco Pesenti Gritti <marco@it.gnome.org>
* TODO:
diff --git a/TODO b/TODO
index ac544e2b2..e0401b985 100644
--- a/TODO
+++ b/TODO
@@ -6,6 +6,7 @@ To do:
- embed dialogs crashes when the window has been closed
- save bookmarks dialog state (current keyword)
- show bookmarks updated content
+- temporary bookmarks, maybe an expire checkbox in new bookmark dialog ?
Done:
diff --git a/embed/ephy-history.c b/embed/ephy-history.c
index 84875f721..db6f885d2 100644
--- a/embed/ephy-history.c
+++ b/embed/ephy-history.c
@@ -57,6 +57,12 @@ enum
LAST_SIGNAL
};
+enum
+{
+ HOSTS_NODE_ID = 5,
+ PAGES_NODE_ID = 6
+};
+
static void
ephy_history_class_init (EphyHistoryClass *klass);
static void
@@ -388,8 +394,8 @@ ephy_history_init (EphyHistory *eb)
eb->priv->hosts_hash_lock = g_new0 (GStaticRWLock, 1);
g_static_rw_lock_init (eb->priv->hosts_hash_lock);
- /* Bookmarks */
- eb->priv->pages = ephy_node_new ();
+ /* Pages */
+ eb->priv->pages = ephy_node_new_with_id (PAGES_NODE_ID);
ephy_node_ref (eb->priv->pages);
g_signal_connect_object (G_OBJECT (eb->priv->pages),
"child_added",
@@ -403,7 +409,7 @@ ephy_history_init (EphyHistory *eb)
0);
/* Hosts */
- eb->priv->hosts = ephy_node_new ();
+ eb->priv->hosts = ephy_node_new_with_id (HOSTS_NODE_ID);
ephy_node_ref (eb->priv->hosts);
g_signal_connect_object (G_OBJECT (eb->priv->hosts),
"child_added",
diff --git a/embed/mozilla/FilePicker.cpp b/embed/mozilla/FilePicker.cpp
index 6ef57d503..144f2e1f2 100644
--- a/embed/mozilla/FilePicker.cpp
+++ b/embed/mozilla/FilePicker.cpp
@@ -329,7 +329,7 @@ NS_METHOD GFilePicker::InitWithGtkWidget (GtkWidget *aParentWidget,
mTitle = nsDependentCString(aTitle);
- mMode = mMode;
+ mMode = aMode;
mFile = do_CreateInstance (NS_LOCAL_FILE_CONTRACTID);
diff --git a/lib/ephy-node.c b/lib/ephy-node.c
index b75df9349..c9ee9aa76 100644
--- a/lib/ephy-node.c
+++ b/lib/ephy-node.c
@@ -96,12 +96,14 @@ enum
LAST_SIGNAL
};
+#define RESERVED_IDS 10
+
static GObjectClass *parent_class = NULL;
static guint ephy_node_signals[LAST_SIGNAL] = { 0 };
static GMutex *id_factory_lock = NULL;
-static long id_factory = 0;
+static long id_factory = RESERVED_IDS;
static GStaticRWLock *id_to_node_lock = NULL;
static GPtrArray *id_to_node;
@@ -392,6 +394,22 @@ ephy_node_new (void)
return node;
}
+EphyNode *
+ephy_node_new_with_id (gulong reserved_id)
+{
+ EphyNode *node;
+
+ g_return_val_if_fail (reserved_id < RESERVED_IDS, NULL);
+
+ node = EPHY_NODE (g_object_new (EPHY_TYPE_NODE,
+ "id", reserved_id,
+ NULL));
+
+ g_return_val_if_fail (node->priv != NULL, NULL);
+
+ return node;
+}
+
long
ephy_node_get_id (EphyNode *node)
{
@@ -1367,7 +1385,7 @@ ephy_node_system_init (void)
g_static_rw_lock_init (id_to_node_lock);
/* id factory */
- id_factory = 0;
+ id_factory = RESERVED_IDS;
id_factory_lock = g_mutex_new ();
}
diff --git a/lib/ephy-node.h b/lib/ephy-node.h
index 2e5f92210..5a3413617 100644
--- a/lib/ephy-node.h
+++ b/lib/ephy-node.h
@@ -62,6 +62,8 @@ GType ephy_node_get_type (void);
EphyNode *ephy_node_new (void);
+EphyNode *ephy_node_new_with_id (gulong reserved_id);
+
/* unique node ID */
long ephy_node_get_id (EphyNode *node);
diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c
index 7110a2cd8..1dea94539 100644
--- a/src/bookmarks/ephy-bookmarks.c
+++ b/src/bookmarks/ephy-bookmarks.c
@@ -47,6 +47,12 @@ struct EphyBookmarksPrivate
GStaticRWLock *keywords_hash_lock;
};
+enum
+{
+ BOOKMARKS_NODE_ID = 0,
+ KEYWORDS_NODE_ID = 1
+};
+
static void
ephy_bookmarks_class_init (EphyBookmarksClass *klass);
static void
@@ -517,7 +523,7 @@ ephy_bookmarks_init (EphyBookmarks *eb)
g_static_rw_lock_init (eb->priv->favorites_hash_lock);
/* Bookmarks */
- eb->priv->bookmarks = ephy_node_new ();
+ eb->priv->bookmarks = ephy_node_new_with_id (BOOKMARKS_NODE_ID);
ephy_node_ref (eb->priv->bookmarks);
g_value_init (&value, G_TYPE_STRING);
g_value_set_string (&value, _("All"));
@@ -537,7 +543,7 @@ ephy_bookmarks_init (EphyBookmarks *eb)
0);
/* Keywords */
- eb->priv->keywords = ephy_node_new ();
+ eb->priv->keywords = ephy_node_new_with_id (KEYWORDS_NODE_ID);
ephy_node_ref (eb->priv->keywords);
ephy_node_add_child (eb->priv->keywords,