window-slot: Add file name to file not found dialog

Nautilus can show "Unable to find the requested file. Please check the
spelling and try again." error when starting. The message doesn't indicate
what file was not found. Let's add the file name to that dialog to make it
obvious.

Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/1793
This commit is contained in:
Abanoub Ghadban 2021-06-05 13:11:36 +02:00 committed by Ondrej Holy
parent a501aaf40e
commit 3b226230fd

View file

@ -1583,6 +1583,7 @@ nautilus_window_slot_display_view_selection_failure (NautilusWindow *window,
char *error_message;
char *detail_message;
char *scheme_string;
char *file_path;
/* Some sort of failure occurred. How 'bout we tell the user? */
@ -1605,7 +1606,17 @@ nautilus_window_slot_display_view_selection_failure (NautilusWindow *window,
{
case G_IO_ERROR_NOT_FOUND:
{
detail_message = g_strdup (_("Unable to find the requested file. Please check the spelling and try again."));
file_path = g_file_get_path (location);
if (file_path != NULL)
{
detail_message = g_strdup_printf (_("Unable to find “%s”. Please check the spelling and try again."),
file_path);
}
else
{
detail_message = g_strdup (_("Unable to find the requested file. Please check the spelling and try again."));
}
g_free (file_path);
}
break;