filechooserwidget: Limit recent folders to default limit

This commit is contained in:
Corey Berla 2024-02-06 11:27:08 -08:00
parent 7823e8120d
commit 8f3d85007b

View File

@ -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);