mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-15 14:50:06 +00:00
filechooserwidget: Remove custom recent_info_has_application impl
This commit is contained in:
parent
4766b475d0
commit
f4c4fe860b
@ -7480,23 +7480,6 @@ recent_clear_model (GtkFileChooserWidget *impl,
|
|||||||
g_set_object (&priv->recent_model, NULL);
|
g_set_object (&priv->recent_model, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
|
||||||
recent_item_is_private (GtkRecentInfo *info)
|
|
||||||
{
|
|
||||||
gboolean is_private = FALSE;
|
|
||||||
|
|
||||||
if (gtk_recent_info_get_private_hint (info))
|
|
||||||
{
|
|
||||||
const gchar *app_name = g_get_application_name ();
|
|
||||||
gchar **recent_apps = gtk_recent_info_get_applications (info, NULL);
|
|
||||||
is_private = !g_strv_contains ((const char *const*) recent_apps,
|
|
||||||
app_name);
|
|
||||||
g_strfreev (recent_apps);
|
|
||||||
}
|
|
||||||
|
|
||||||
return is_private;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
recent_start_loading (GtkFileChooserWidget *impl)
|
recent_start_loading (GtkFileChooserWidget *impl)
|
||||||
{
|
{
|
||||||
@ -7531,6 +7514,7 @@ recent_start_loading (GtkFileChooserWidget *impl)
|
|||||||
if (priv->action == GTK_FILE_CHOOSER_ACTION_OPEN)
|
if (priv->action == GTK_FILE_CHOOSER_ACTION_OPEN)
|
||||||
{
|
{
|
||||||
const int limit = DEFAULT_RECENT_FILES_LIMIT;
|
const int limit = DEFAULT_RECENT_FILES_LIMIT;
|
||||||
|
const char *app_name = g_get_application_name ();
|
||||||
GList *l;
|
GList *l;
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
@ -7541,9 +7525,11 @@ recent_start_loading (GtkFileChooserWidget *impl)
|
|||||||
GtkRecentInfo *info = l->data;
|
GtkRecentInfo *info = l->data;
|
||||||
GFile *file;
|
GFile *file;
|
||||||
|
|
||||||
if (recent_item_is_private (info))
|
if (gtk_recent_info_get_private_hint (info) &&
|
||||||
|
!gtk_recent_info_has_application (info, app_name))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
||||||
file = g_file_new_for_uri (gtk_recent_info_get_uri (info));
|
file = g_file_new_for_uri (gtk_recent_info_get_uri (info));
|
||||||
_gtk_file_system_model_add_and_query_file (priv->recent_model,
|
_gtk_file_system_model_add_and_query_file (priv->recent_model,
|
||||||
file,
|
file,
|
||||||
|
Loading…
Reference in New Issue
Block a user