[gtk+/multiroot-filechooser-2-20: 8/21] Prevent access to old locations when using a non-existant root URI.



commit 67f25a6302a8d9892bf2d47f75ef7288de01a60e
Author: Christian Hammond <chipx86 chipx86 com>
Date:   Sat Feb 13 14:45:38 2010 -0800

    Prevent access to old locations when using a non-existant root URI.

 gtk/gtkfilechooserdefault.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index 3eda714..2fb3980 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -7487,6 +7487,19 @@ gtk_file_chooser_default_update_current_folder (GtkFileChooser    *chooser,
       return FALSE;
     }
 
+  if (!_gtk_file_chooser_is_file_in_root (GTK_FILE_CHOOSER (impl), file))
+    {
+      g_set_error_literal (error,
+                           GTK_FILE_CHOOSER_ERROR,
+                           GTK_FILE_CHOOSER_ERROR_BAD_FILENAME,
+                           _("Cannot change to folder because it is not "
+                             "accessible from this file chooser"));
+
+      g_object_unref (file);
+      profile_end ("end - not accessible within root URI", NULL);
+      return FALSE;
+    }
+
   if (impl->update_current_folder_cancellable)
     g_cancellable_cancel (impl->update_current_folder_cancellable);
 



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