summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk/gtkfilechooserdefault.c20
-rw-r--r--gtk/gtkrecentchooser.c7
-rw-r--r--gtk/gtkrecentchooserdefault.c21
-rw-r--r--gtk/gtksettings.c4
4 files changed, 11 insertions, 41 deletions
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index 33b5178d0b..2a957c5f81 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -392,6 +392,8 @@ enum {
GTK_TREE_MODEL_ROW,
};
+#define DEFAULT_RECENT_FILES_LIMIT 50
+
/* Icon size for if we can't get it from the theme */
#define FALLBACK_ICON_SIZE 16
@@ -6635,22 +6637,6 @@ recent_idle_cleanup (gpointer data)
g_free (load_data);
}
-static gint
-get_recent_files_limit (GtkWidget *widget)
-{
- GtkSettings *settings;
- gint limit;
-
- if (gtk_widget_has_screen (widget))
- settings = gtk_settings_get_for_screen (gtk_widget_get_screen (widget));
- else
- settings = gtk_settings_get_default ();
-
- g_object_get (G_OBJECT (settings), "gtk-recent-files-limit", &limit, NULL);
-
- return limit;
-}
-
/* Populates the file system model with the GtkRecentInfo* items in the provided list; frees the items */
static void
populate_model_with_recent_items (GtkFileChooserDefault *impl, GList *items)
@@ -6660,7 +6646,7 @@ populate_model_with_recent_items (GtkFileChooserDefault *impl, GList *items)
GList *l;
int n;
- limit = get_recent_files_limit (GTK_WIDGET (impl));
+ limit = DEFAULT_RECENT_FILES_LIMIT;
n = 0;
diff --git a/gtk/gtkrecentchooser.c b/gtk/gtkrecentchooser.c
index c5e151fb31..32f409d886 100644
--- a/gtk/gtkrecentchooser.c
+++ b/gtk/gtkrecentchooser.c
@@ -220,10 +220,7 @@ gtk_recent_chooser_default_init (GtkRecentChooserInterface *iface)
* GtkRecentChooser:limit:
*
* The maximum number of recently used resources to be displayed,
- * or -1 to display all items. By default, the
- * GtkSetting:gtk-recent-files-limit setting is respected: you can
- * override that limit on a particular instance of #GtkRecentChooser
- * by setting this property.
+ * or -1 to display all items.
*
* Since: 2.10
*/
@@ -233,7 +230,7 @@ gtk_recent_chooser_default_init (GtkRecentChooserInterface *iface)
P_("The maximum number of items to be displayed"),
-1,
G_MAXINT,
- -1,
+ 50,
GTK_PARAM_READWRITE));
/**
* GtkRecentChooser:sort-type:
diff --git a/gtk/gtkrecentchooserdefault.c b/gtk/gtkrecentchooserdefault.c
index c1d15d2feb..85a5bcd82e 100644
--- a/gtk/gtkrecentchooserdefault.c
+++ b/gtk/gtkrecentchooserdefault.c
@@ -167,6 +167,8 @@ enum {
#define NUM_CHARS 40
#define NUM_LINES 9
+#define DEFAULT_RECENT_FILES_LIMIT 50
+
/* GObject */
@@ -218,7 +220,6 @@ static void set_current_filter (GtkRecentChooserDefault *impl,
static GtkIconTheme *get_icon_theme_for_widget (GtkWidget *widget);
static gint get_icon_size_for_widget (GtkWidget *widget,
GtkIconSize icon_size);
-static gint get_recent_files_limit (GtkWidget *widget);
static void reload_recent_items (GtkRecentChooserDefault *impl);
static void chooser_set_model (GtkRecentChooserDefault *impl);
@@ -824,7 +825,7 @@ reload_recent_items (GtkRecentChooserDefault *impl)
GTK_ICON_SIZE_BUTTON);
if (!impl->priv->limit_set)
- impl->priv->limit = get_recent_files_limit (widget);
+ impl->priv->limit = DEFAULT_RECENT_FILES_LIMIT;
set_busy_cursor (impl, TRUE);
@@ -1333,22 +1334,6 @@ get_icon_size_for_widget (GtkWidget *widget,
return FALLBACK_ICON_SIZE;
}
-static gint
-get_recent_files_limit (GtkWidget *widget)
-{
- GtkSettings *settings;
- gint limit;
-
- if (gtk_widget_has_screen (widget))
- settings = gtk_settings_get_for_screen (gtk_widget_get_screen (widget));
- else
- settings = gtk_settings_get_default ();
-
- g_object_get (G_OBJECT (settings), "gtk-recent-files-limit", &limit, NULL);
-
- return limit;
-}
-
static void
recent_manager_changed_cb (GtkRecentManager *manager,
gpointer user_data)
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
index 4627926578..2c84ba3d95 100644
--- a/gtk/gtksettings.c
+++ b/gtk/gtksettings.c
@@ -1022,6 +1022,8 @@ gtk_settings_class_init (GtkSettingsClass *class)
* -1 means every recently used file stored.
*
* Since: 2.12
+ *
+ * Deprecated: 3.10: This setting is ignored
*/
result = settings_install_property_parser (class,
g_param_spec_int ("gtk-recent-files-limit",
@@ -1029,7 +1031,7 @@ gtk_settings_class_init (GtkSettingsClass *class)
P_("Number of recently used files"),
-1, G_MAXINT,
50,
- GTK_PARAM_READWRITE),
+ GTK_PARAM_READWRITE | G_PARAM_DEPRECATED),
NULL);
g_assert (result == PROP_RECENT_FILES_LIMIT);