[nautilus/wip/rishi/gfile-google] file-operations: Let directory creation work on Google Drive



commit d625105b0cdb655ed52dd3dcec1c117d3e1fc836
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Jun 25 10:27:31 2015 +0200

    file-operations: Let directory creation work on Google Drive
    
    Immediately check if the newly created directory is volatile or not,
    and if it is then switch to using the "real" persistent URI.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=751481

 libnautilus-private/nautilus-file-operations.c |   31 ++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file-operations.c b/libnautilus-private/nautilus-file-operations.c
index 0315a46..53ffd53 100644
--- a/libnautilus-private/nautilus-file-operations.c
+++ b/libnautilus-private/nautilus-file-operations.c
@@ -6056,6 +6056,37 @@ create_job (GIOSchedulerJob *io_job,
                                             common->cancellable,
                                             &error);
 
+#ifdef G_FILE_ATTRIBUTE_STANDARD_IS_VOLATILE
+               if (res) {
+                       GFileInfo *info = NULL;
+
+                       info = g_file_query_info (dest,
+                                                 G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK","
+                                                 G_FILE_ATTRIBUTE_STANDARD_IS_VOLATILE","
+                                                 G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET,
+                                                 G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
+                                                 common->cancellable,
+                                                 &error);
+                       if (info == NULL) {
+                               res = FALSE;
+                       } else {
+                               gboolean is_volatile;
+
+                               is_volatile = g_file_info_get_attribute_boolean (info,
+                                                                                
G_FILE_ATTRIBUTE_STANDARD_IS_VOLATILE);
+                               if (is_volatile) {
+                                       const gchar *target;
+
+                                       target = g_file_info_get_symlink_target (info);
+                                       g_object_unref (dest);
+                                       dest = g_file_new_for_uri (target);
+                               }
+                       }
+
+                       g_clear_object (&info);
+               }
+#endif /* G_FILE_ATTRIBUTE_STANDARD_IS_VOLATILE */
+
                if (res && common->undo_info != NULL) {
                        nautilus_file_undo_info_create_set_data (NAUTILUS_FILE_UNDO_INFO_CREATE 
(common->undo_info),
                                                                 dest, NULL, 0);


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