mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 22:41:43 +00:00
filechooserwidget: Limit recent folders to default limit
This commit is contained in:
parent
7823e8120d
commit
8f3d85007b
@ -639,6 +639,7 @@ _gtk_file_chooser_extract_recent_folders (GList *infos)
|
||||
GList *l;
|
||||
GList *result;
|
||||
GHashTable *folders;
|
||||
guint counter = 0;
|
||||
|
||||
result = NULL;
|
||||
|
||||
@ -651,6 +652,9 @@ _gtk_file_chooser_extract_recent_folders (GList *infos)
|
||||
GFile *dir;
|
||||
GFile *file;
|
||||
|
||||
if (counter >= DEFAULT_RECENT_FILES_LIMIT)
|
||||
break;
|
||||
|
||||
if (!gtk_recent_info_is_local (info))
|
||||
continue;
|
||||
|
||||
@ -674,6 +678,7 @@ _gtk_file_chooser_extract_recent_folders (GList *infos)
|
||||
{
|
||||
g_hash_table_insert (folders, dir, (gpointer) 1);
|
||||
result = g_list_prepend (result, g_object_ref (dir));
|
||||
counter++;
|
||||
}
|
||||
|
||||
g_object_unref (dir);
|
||||
|
Loading…
Reference in New Issue
Block a user