[gvfs/wip/oholy/google-cache-conservative: 34/39] google: Ignore entries without parents



commit 014a3d9edea522d460161c2e96d916585133ad04
Author: Ondrej Holy <oholy redhat com>
Date:   Tue Jul 31 18:43:44 2018 +0200

    google: Ignore entries without parents
    
    Entries without parents are not shown on the web and there isn't any
    reason to list them here. Such entries belongs to some web services
    and we have no control over them.

 daemon/gvfsbackendgoogle.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)
---
diff --git a/daemon/gvfsbackendgoogle.c b/daemon/gvfsbackendgoogle.c
index 47fc671f..7ffea960 100644
--- a/daemon/gvfsbackendgoogle.c
+++ b/daemon/gvfsbackendgoogle.c
@@ -347,14 +347,6 @@ get_parent_id (GVfsBackendGoogle *self,
         }
     }
 
-  if (ret_val == NULL)
-    {
-      const gchar *root_id;
-
-      root_id = gdata_entry_get_id (self->root);
-      ret_val = g_strdup (root_id);
-    }
-
   g_list_free (links);
   return ret_val;
 }
@@ -903,10 +895,8 @@ build_file_info (GVfsBackendGoogle      *self,
 {
   GFileType file_type;
   GList *authors;
-  GList *links;
   gboolean is_folder = FALSE;
   gboolean is_root = FALSE;
-  gboolean has_parent = FALSE;
   const gchar *etag;
   const gchar *id;
   const gchar *name;
@@ -925,9 +915,6 @@ build_file_info (GVfsBackendGoogle      *self,
   if (entry == self->root)
     is_root = TRUE;
 
-  links = gdata_entry_look_up_links (entry, GDATA_LINK_PARENT);
-  has_parent = (links != NULL);
-
   g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME, !is_root);
 
   g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE, is_folder);
@@ -936,9 +923,7 @@ build_file_info (GVfsBackendGoogle      *self,
   g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_STANDARD_IS_VOLATILE, is_symlink);
 
   g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH, FALSE);
-  g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE, !is_root && has_parent);
-
-  g_file_info_set_is_hidden (info, !has_parent);
+  g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE, !is_root);
 
   if (is_folder)
     {
@@ -1083,7 +1068,6 @@ build_file_info (GVfsBackendGoogle      *self,
   g_free (copy_name);
   g_free (escaped_name);
   g_free (content_type);
-  g_list_free (links);
 }
 
 /* ---------------------------------------------------------------------------------------------------- */


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