After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 756644 - Mark files without parent as hidden
Mark files without parent as hidden
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: google backend
unspecified
Other All
: Normal normal
: ---
Assigned To: Debarshi Ray
gvfs-maint
: 758292 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-10-15 14:24 UTC by Ondrej Holy
Modified: 2015-11-19 09:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
google: Mark files without parent as hidden (2.27 KB, patch)
2015-10-15 14:26 UTC, Ondrej Holy
none Details | Review
google: Mark files you can't see on the web as hidden (2.44 KB, patch)
2015-10-16 07:19 UTC, Ondrej Holy
committed Details | Review

Description Ondrej Holy 2015-10-15 14:24:49 UTC
Files without the parent are currently shown in google backend root. You can see many files consequently, which are not shown in your google drive folder on the web. Those files can be shared with you, or you opened them in some google applications (i.e. google docs).
Comment 1 Ondrej Holy 2015-10-15 14:26:26 UTC
Created attachment 313377 [details] [review]
google: Mark files without parent as hidden

Mark those files as hidden to see same files as you can see on the web. Also mark the files as undeletable, because it is not possible to delete them from the obvious reason.
Comment 2 Debarshi Ray 2015-10-15 18:30:40 UTC
Review of attachment 313377 [details] [review]:

Looks good to me, but I can not test it because I lost the parent=[] file that I had in my Drive. Can you share something with me?

A few nitpicks:

::: daemon/gvfsbackendgoogle.c
@@ +902,3 @@
   gint64 mtime;
   gsize i;
+  GList *links;

Maybe put it below the 'GList *authors' above?

@@ +914,3 @@
+  g_list_free (links);
+
+  g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE, !is_root && has_parent);

Maybe put it together with CAN_TRASH? And since we are using 'goto out' move the g_list_free to the 'out' section at the end of the function for consistency?
Comment 3 Ondrej Holy 2015-10-16 07:19:26 UTC
Created attachment 313416 [details] [review]
google: Mark files you can't see on the web as hidden

Modified as per the nitpicks...

Try to open following file to test:
https://drive.google.com/file/d/0B9zPQZeTJSW6Q2U4cFRUd0NfbUk/view?usp=sharing
Comment 4 Debarshi Ray 2015-10-16 08:59:55 UTC
Review of attachment 313416 [details] [review]:

Thanks for the changes, Ondrej. It works as expected.
Comment 5 Ondrej Holy 2015-10-16 12:52:34 UTC
Comment on attachment 313416 [details] [review]
google: Mark files you can't see on the web as hidden

commit 3aade766e1793bbf3ba2ecd29aba44d0467a0c6d
Comment 6 Ondrej Holy 2015-10-16 12:52:51 UTC
Thanks for review.
Comment 7 Ondrej Holy 2015-11-19 09:43:30 UTC
*** Bug 758292 has been marked as a duplicate of this bug. ***