Bug 748505 - Don't do nothing and report no error when trying to open a fifo

Remove the check for opening a regular file from
file_open_dialog_response() and call the functions in file-open
unconditionally. This is the actual fix because the check was simply
bailing out with no message or anything when trying to open a
non-regular file, whereas the checks in file-open return proper error
messsages.

In file_open_image(), do the checks for being a regular and readable
file first, so we don't run into reading from other files when trying
to figure the file format.
This commit is contained in:
Michael Natterer
2015-04-29 18:57:39 -04:00
parent bc4cf9918f
commit 2480d69341
2 changed files with 7 additions and 18 deletions

View File

@ -138,17 +138,6 @@ file_open_dialog_response (GtkWidget *open_dialog,
for (list = files; list; list = g_slist_next (list))
{
GFile *file = list->data;
gchar *path = g_file_get_path (file);
if (path)
{
gboolean regular = g_file_test (path, G_FILE_TEST_IS_REGULAR);
g_free (path);
if (! regular)
continue;
}
if (dialog->open_as_layers)
{

View File

@ -107,13 +107,6 @@ file_open_image (Gimp *gimp,
*status = GIMP_PDB_EXECUTION_ERROR;
if (! file_proc)
file_proc = file_procedure_find (gimp->plug_in_manager->load_procs, file,
error);
if (! file_proc)
return NULL;
/* FIXME enable these tests for remote files again, needs testing */
if (g_file_is_native (file) &&
g_file_query_exists (file, NULL))
@ -148,6 +141,13 @@ file_open_image (Gimp *gimp,
g_object_unref (info);
}
if (! file_proc)
file_proc = file_procedure_find (gimp->plug_in_manager->load_procs, file,
error);
if (! file_proc)
return NULL;
if (! g_file_is_native (file) &&
! file_remote_mount_file (gimp, file, progress, &my_error))
{