aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-07-07 21:02:53 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-07-07 21:02:53 +0800
commited4336b7f4f0bec5d6d81e56c3538c07effde0b8 (patch)
tree1bb787237a935bd5e15bcff63bb5aa0b2ea38d39
parent8c2b1c4e5e6335423c335fd99ab852fe74c0999f (diff)
downloadgsoc2013-epiphany-ed4336b7f4f0bec5d6d81e56c3538c07effde0b8.tar
gsoc2013-epiphany-ed4336b7f4f0bec5d6d81e56c3538c07effde0b8.tar.gz
gsoc2013-epiphany-ed4336b7f4f0bec5d6d81e56c3538c07effde0b8.tar.bz2
gsoc2013-epiphany-ed4336b7f4f0bec5d6d81e56c3538c07effde0b8.tar.lz
gsoc2013-epiphany-ed4336b7f4f0bec5d6d81e56c3538c07effde0b8.tar.xz
gsoc2013-epiphany-ed4336b7f4f0bec5d6d81e56c3538c07effde0b8.tar.zst
gsoc2013-epiphany-ed4336b7f4f0bec5d6d81e56c3538c07effde0b8.zip
Remove unused define.
2003-07-07 Marco Pesenti Gritti <marco@it.gnome.org> * lib/ephy-types.h: Remove unused define. * src/bookmarks/ephy-bookmarks.c: (ephy_bookmarks_save_delayed), (bookmarks_changed_cb), (bookmarks_removed_cb), (ephy_bookmarks_add): Save added bookmarks on idle, otherwise importing is too slow.
-rw-r--r--ChangeLog12
-rw-r--r--lib/ephy-types.h2
-rw-r--r--src/bookmarks/ephy-bookmarks.c26
3 files changed, 30 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 715a1a097..edbcb4db6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
2003-07-07 Marco Pesenti Gritti <marco@it.gnome.org>
+ * lib/ephy-types.h:
+
+ Remove unused define.
+
+ * src/bookmarks/ephy-bookmarks.c: (ephy_bookmarks_save_delayed),
+ (bookmarks_changed_cb), (bookmarks_removed_cb),
+ (ephy_bookmarks_add):
+
+ Save added bookmarks on idle, otherwise importing is too slow.
+
+2003-07-07 Marco Pesenti Gritti <marco@it.gnome.org>
+
* lib/widgets/ephy-autocompletion-window.c:
(ephy_autocompletion_window_key_press_cb):
diff --git a/lib/ephy-types.h b/lib/ephy-types.h
index d0fccafa7..70ce681e0 100644
--- a/lib/ephy-types.h
+++ b/lib/ephy-types.h
@@ -30,8 +30,6 @@ typedef enum
G_NOT_IMPLEMENTED
} gresult;
-#define EPHY_NODE_RESERVED_IDS 100
-
G_END_DECLS
#endif
diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c
index 7d35dc9e2..d38bd6ed1 100644
--- a/src/bookmarks/ephy-bookmarks.c
+++ b/src/bookmarks/ephy-bookmarks.c
@@ -406,15 +406,25 @@ save_bookmarks_delayed (EphyBookmarks *bookmarks)
}
static void
-ephy_bookmarks_set_dirty (EphyBookmarks *bookmarks)
+ephy_bookmarks_save_delayed (EphyBookmarks *bookmarks, int delay)
{
if (!bookmarks->priv->dirty)
{
bookmarks->priv->dirty = TRUE;
- bookmarks->priv->save_timeout_id =
- g_timeout_add (BOOKMARKS_SAVE_DELAY,
- (GSourceFunc) save_bookmarks_delayed,
- bookmarks);
+
+ if (delay > 0)
+ {
+ bookmarks->priv->save_timeout_id =
+ g_timeout_add (BOOKMARKS_SAVE_DELAY,
+ (GSourceFunc) save_bookmarks_delayed,
+ bookmarks);
+ }
+ else
+ {
+ bookmarks->priv->save_timeout_id =
+ g_idle_add ((GSourceFunc) save_bookmarks_delayed,
+ bookmarks);
+ }
}
}
@@ -545,7 +555,7 @@ bookmarks_changed_cb (EphyNode *node,
EphyBookmarks *eb)
{
ephy_bookmarks_emit_data_changed (eb);
- ephy_bookmarks_set_dirty (eb);
+ ephy_bookmarks_save_delayed (eb, BOOKMARKS_SAVE_DELAY);
}
static void
@@ -556,7 +566,7 @@ bookmarks_removed_cb (EphyNode *node,
{
ephy_bookmarks_emit_data_changed (eb);
g_signal_emit (G_OBJECT (eb), ephy_bookmarks_signals[TREE_CHANGED], 0);
- ephy_bookmarks_set_dirty (eb);
+ ephy_bookmarks_save_delayed (eb, BOOKMARKS_SAVE_DELAY);
}
static char *
@@ -832,7 +842,7 @@ ephy_bookmarks_add (EphyBookmarks *eb,
ephy_bookmarks_emit_data_changed (eb);
g_signal_emit (G_OBJECT (eb), ephy_bookmarks_signals[TREE_CHANGED], 0);
- ephy_bookmarks_save (eb);
+ ephy_bookmarks_save_delayed (eb, 0);
return bm;
}