summaryrefslogtreecommitdiff
path: root/gtk/gtksettings.c
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2008-04-15 22:37:32 +0000
committerEmmanuele Bassi <ebassi@src.gnome.org>2008-04-15 22:37:32 +0000
commitbeb54a9b397109b4e964b85469b17d8b04bba9ee (patch)
tree21584f485520018f023a2aa2d18d913354f0591c /gtk/gtksettings.c
parentc31e25203052576a90ec1978c939424fafd132c2 (diff)
downloadgtk+-beb54a9b397109b4e964b85469b17d8b04bba9ee.tar.gz
Bug 488507 – boundless growth of .recently-used.xbel file slows down
2008-04-15 Emmanuele Bassi <ebassi@gnome.org> Bug 488507 – boundless growth of .recently-used.xbel file slows down applications * gtk/gtkrecentmanager.c: (gtk_recent_manager_init), (gtk_recent_manager_real_changed), (gtk_recent_manager_set_filename), (gtk_recent_manager_clamp_to_age): Clamp the recently used resources list by the age of its items, using the newly added GtkSettings property. * gtk/gtksettings.c (gtk_settings_class_init): Add the gtk-recent-files-max-age property, controlling the maximum age of the items in the recently used resources list. svn path=/trunk/; revision=20006
Diffstat (limited to 'gtk/gtksettings.c')
-rw-r--r--gtk/gtksettings.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
index 3081e8711a..a19ad33099 100644
--- a/gtk/gtksettings.c
+++ b/gtk/gtksettings.c
@@ -107,7 +107,8 @@ enum {
PROP_ENABLE_MNEMONICS,
PROP_ENABLE_ACCELS,
PROP_RECENT_FILES_LIMIT,
- PROP_IM_MODULE
+ PROP_IM_MODULE,
+ PROP_RECENT_FILES_MAX_AGE
};
@@ -820,6 +821,26 @@ gtk_settings_class_init (GtkSettingsClass *class)
GTK_PARAM_READWRITE),
NULL);
g_assert (result == PROP_IM_MODULE);
+
+ /**
+ * GtkSettings:gtk-recent-files-max-age:
+ *
+ * The maximum age, in days, of the items inside the recently used
+ * resources list. Items older than this setting will be excised
+ * from the list. If set to 0, the list will always be empty; if
+ * set to -1, no item will be removed.
+ *
+ * Since: 2.14
+ */
+ result = settings_install_property_parser (class,
+ g_param_spec_int ("gtk-recent-files-max-age",
+ P_("Recent Files Max Age"),
+ P_("Maximum age of recently used files, in days"),
+ -1, G_MAXINT,
+ 30,
+ GTK_PARAM_READWRITE),
+ NULL);
+ g_assert (result == PROP_RECENT_FILES_MAX_AGE);
}
static void