[gimp] Bug 748505 - Don't do nothing and report no error when trying to open a fifo
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Bug 748505 - Don't do nothing and report no error when trying to open a fifo
- Date: Wed, 29 Apr 2015 23:02:17 +0000 (UTC)
commit 2480d693416dd2011e9440f0dfae49a1c236d6f4
Author: Michael Natterer <mitch gimp org>
Date: Wed Apr 29 18:57:39 2015 -0400
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.
app/dialogs/file-open-dialog.c | 11 -----------
app/file/file-open.c | 14 +++++++-------
2 files changed, 7 insertions(+), 18 deletions(-)
---
diff --git a/app/dialogs/file-open-dialog.c b/app/dialogs/file-open-dialog.c
index a8fda31..d250627 100644
--- a/app/dialogs/file-open-dialog.c
+++ b/app/dialogs/file-open-dialog.c
@@ -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)
{
diff --git a/app/file/file-open.c b/app/file/file-open.c
index 48c4d12..e8f98ce 100644
--- a/app/file/file-open.c
+++ b/app/file/file-open.c
@@ -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))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]