[gimp/gimp-2-8] 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/gimp-2-8] Bug 748505 - Don't do nothing and report no error when trying to open a fifo
- Date: Wed, 29 Apr 2015 23:07:28 +0000 (UTC)
commit 36d6f724da8189156219f57475a0c0b46e504694
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.
(cherry picked from commit 2480d693416dd2011e9440f0dfae49a1c236d6f4)
app/dialogs/file-open-dialog.c | 12 ------------
app/file/file-open.c | 17 ++++++++++-------
2 files changed, 10 insertions(+), 19 deletions(-)
---
diff --git a/app/dialogs/file-open-dialog.c b/app/dialogs/file-open-dialog.c
index fe067aa..6013cc3 100644
--- a/app/dialogs/file-open-dialog.c
+++ b/app/dialogs/file-open-dialog.c
@@ -136,18 +136,6 @@ file_open_dialog_response (GtkWidget *open_dialog,
for (list = uris; list; list = g_slist_next (list))
{
- gchar *filename = file_utils_filename_from_uri (list->data);
-
- if (filename)
- {
- gboolean regular = g_file_test (filename, G_FILE_TEST_IS_REGULAR);
-
- g_free (filename);
-
- if (! regular)
- continue;
- }
-
if (dialog->open_as_layers)
{
if (! dialog->image)
diff --git a/app/file/file-open.c b/app/file/file-open.c
index e8a29d4..3d10c28 100644
--- a/app/file/file-open.c
+++ b/app/file/file-open.c
@@ -115,13 +115,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, uri,
- error);
-
- if (! file_proc)
- return NULL;
-
filename = file_utils_filename_from_uri (uri);
if (filename)
@@ -151,6 +144,16 @@ file_open_image (Gimp *gimp,
filename = g_strdup (uri);
}
+ if (! file_proc)
+ file_proc = file_procedure_find (gimp->plug_in_manager->load_procs, uri,
+ error);
+
+ if (! file_proc)
+ {
+ g_free (filename);
+ return NULL;
+ }
+
return_vals =
gimp_pdb_execute_procedure_by_name (gimp->pdb,
context, progress, error,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]