summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@cvs.gnome.org>2006-04-11 21:04:15 +0000
committerEmmanuele Bassi <ebassi@src.gnome.org>2006-04-11 21:04:15 +0000
commit82cda939239204f996eec19a40f04176e99ec424 (patch)
tree0efc0015242f10caf9e20bc4c7cf8b2f84c31c7e
parent4e2069f779a67284770c97d2dab9e9819377055e (diff)
downloadgtk+-82cda939239204f996eec19a40f04176e99ec424.tar.gz
Remove the unneeded setting of the storage file inside the constructor.
2006-04-11 Emmanuele Bassi <ebassi@cvs.gnome.org> * gtk/gtkrecentmanager.c (gtk_recent_manager_init) (gtk_recent_manager_new): Remove the unneeded setting of the storage file inside the constructor. (Murray Cumming) (build_recent_items_list): Reset the dirty bit when done rebuilding the list from the storage file.
-rw-r--r--ChangeLog8
-rw-r--r--ChangeLog.pre-2-108
-rw-r--r--gtk/gtkrecentmanager.c25
3 files changed, 25 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 8728b139fd..93488b13ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-04-11 Emmanuele Bassi <ebassi@cvs.gnome.org>
+
+ * gtk/gtkrecentmanager.c (gtk_recent_manager_init)
+ (gtk_recent_manager_new): Remove the unneeded setting of the
+ storage file inside the constructor. (Murray Cumming)
+ (build_recent_items_list): Reset the dirty bit when done rebuilding
+ the list from the storage file.
+
2006-04-11 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkscale.c (gtk_scale_get_layout_offsets): Silence
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 8728b139fd..93488b13ff 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,11 @@
+2006-04-11 Emmanuele Bassi <ebassi@cvs.gnome.org>
+
+ * gtk/gtkrecentmanager.c (gtk_recent_manager_init)
+ (gtk_recent_manager_new): Remove the unneeded setting of the
+ storage file inside the constructor. (Murray Cumming)
+ (build_recent_items_list): Reset the dirty bit when done rebuilding
+ the list from the storage file.
+
2006-04-11 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkscale.c (gtk_scale_get_layout_offsets): Silence
diff --git a/gtk/gtkrecentmanager.c b/gtk/gtkrecentmanager.c
index 62b6482513..93545da359 100644
--- a/gtk/gtkrecentmanager.c
+++ b/gtk/gtkrecentmanager.c
@@ -272,6 +272,8 @@ gtk_recent_manager_init (GtkRecentManager *manager)
priv->read_in_progress = FALSE;
priv->screen = NULL;
+
+ build_recent_items_list (manager);
}
static void
@@ -482,14 +484,17 @@ gtk_recent_manager_set_filename (GtkRecentManager *manager,
gtk_recent_manager_poll_timeout,
manager);
- build_recent_items_list (manager);
-
+ /* mark us clean, so that we can re-read the list
+ * of recently used resources
+ */
priv->is_dirty = FALSE;
+ build_recent_items_list (manager);
}
/* reads the recently used resources file and builds the items list.
* we keep the items list inside the parser object, and build the
* RecentInfo object only on user's demand to avoid useless replication.
+ * this function resets the dirty bit of the manager.
*/
static void
build_recent_items_list (GtkRecentManager *manager)
@@ -564,6 +569,7 @@ build_recent_items_list (GtkRecentManager *manager)
}
priv->read_in_progress = FALSE;
+ priv->is_dirty = FALSE;
}
@@ -591,20 +597,7 @@ build_recent_items_list (GtkRecentManager *manager)
GtkRecentManager *
gtk_recent_manager_new (void)
{
- GtkRecentManager *retval;
- gchar *filename;
-
- filename = g_build_filename (g_get_home_dir (),
- GTK_RECENTLY_USED_FILE,
- NULL);
-
- retval = g_object_new (GTK_TYPE_RECENT_MANAGER,
- "filename", filename,
- NULL);
-
- g_free (filename);
-
- return retval;
+ return g_object_new (GTK_TYPE_RECENT_MANAGER, NULL);
}
/**