mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-10-05 23:40:01 +00:00
files-view: Say "Trash is Empty" only in trash:///
Empty trash widget is displaying for empty folder inside trash instead of Empty folder widget. `eel_uri_is_trash` only checks whether the URI starts with "trash:", that's why it also returns true for empty folders inside trash. Create `eel_uri_is_trash_root` to distinguish trash root (trash:///) from empty folder inside trash (trash:///emptyfolder) Closes https://gitlab.gnome.org/GNOME/nautilus/issues/1367
This commit is contained in:
parent
65d9ef8d05
commit
2a741d9617
|
@ -43,12 +43,20 @@ eel_uri_is_starred (const gchar *uri)
|
|||
return g_str_has_prefix (uri, "starred:");
|
||||
}
|
||||
|
||||
/* It also matches trashed folders inside Trash,
|
||||
* use `eel_uri_is_trash_root` if that's not desirable. */
|
||||
gboolean
|
||||
eel_uri_is_trash (const char *uri)
|
||||
{
|
||||
return g_str_has_prefix (uri, "trash:");
|
||||
}
|
||||
|
||||
gboolean
|
||||
eel_uri_is_trash_root (const char *uri)
|
||||
{
|
||||
return g_strcmp0 (uri, "trash:///") == 0;
|
||||
}
|
||||
|
||||
gboolean
|
||||
eel_uri_is_recent (const char *uri)
|
||||
{
|
||||
|
|
|
@ -35,6 +35,7 @@ G_BEGIN_DECLS
|
|||
|
||||
gboolean eel_uri_is_starred (const char *uri);
|
||||
gboolean eel_uri_is_trash (const char *uri);
|
||||
gboolean eel_uri_is_trash_root (const char *uri);
|
||||
gboolean eel_uri_is_search (const char *uri);
|
||||
gboolean eel_uri_is_other_locations (const char *uri);
|
||||
gboolean eel_uri_is_recent (const char *uri);
|
||||
|
|
|
@ -3628,7 +3628,7 @@ real_check_empty_states (NautilusFilesView *view)
|
|||
{
|
||||
gtk_widget_show (priv->no_search_results_widget);
|
||||
}
|
||||
else if (eel_uri_is_trash (uri))
|
||||
else if (eel_uri_is_trash_root (uri))
|
||||
{
|
||||
gtk_widget_show (priv->trash_is_empty_widget);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue