[gimp] app: add back code that only checks local files for type and permissions



commit 4bd2f3e87c88bfccad0b8653dba18958faf9c4ae
Author: Michael Natterer <mitch gimp org>
Date:   Tue Jul 8 20:23:34 2014 +0200

    app: add back code that only checks local files for type and permissions
    
    I've seen these tests failing on remote files that load and save just
    fine if the test is removed.

 app/file/file-open.c |    5 ++++-
 app/file/file-save.c |    4 +++-
 2 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/app/file/file-open.c b/app/file/file-open.c
index 0a1150d..fb47767 100644
--- a/app/file/file-open.c
+++ b/app/file/file-open.c
@@ -111,7 +111,9 @@ file_open_image (Gimp                *gimp,
   if (! file_proc)
     return NULL;
 
-  if (g_file_query_exists (file, NULL))
+  /* FIXME enable these tests for remote files again, needs testing */
+  if (g_file_is_native (file) &&
+      g_file_query_exists (file, NULL))
     {
       GFileInfo *info;
 
@@ -135,6 +137,7 @@ file_open_image (Gimp                *gimp,
         {
           g_set_error_literal (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
                                _("Premission denied"));
+          return NULL;
         }
     }
 
diff --git a/app/file/file-save.c b/app/file/file-save.c
index f578805..833a5aa 100644
--- a/app/file/file-save.c
+++ b/app/file/file-save.c
@@ -88,7 +88,9 @@ file_save (Gimp                *gimp,
   if (! drawable)
     return GIMP_PDB_EXECUTION_ERROR;
 
-  if (g_file_query_exists (file, NULL))
+  /* FIXME enable these tests for remote files again, needs testing */
+  if (g_file_is_native (file) &&
+      g_file_query_exists (file, NULL))
     {
       GFileInfo *info;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]