Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let several file operations work on Google Drive #1598

Closed
wants to merge 6 commits into from

Conversation

besser82
Copy link
Contributor

@besser82 besser82 commented Sep 8, 2017

Several fixes for using gDrive with GVFS with Nemo. Backported from GNOME Nautilus.

@besser82 besser82 changed the title file: Let renames work on Google Drive Let several file operations work on Google Drive Sep 9, 2017
@Fantu
Copy link
Contributor

Fantu commented Sep 9, 2017

thanks, I saw many bug reports about bug/s with rename, hope that this solves them or at least part of them (about "file: Let renames work on Google Drive" commit)

@besser82 add also the change of debian/control "libglib2.0-dev (>= 2.37.3)," to "libglib2.0-dev (>= 2.45.7)," now missed

@besser82
Copy link
Contributor Author

besser82 commented Sep 9, 2017

@Fantu All the commits in this PR will solve most of the issues with gDrive (and maybe other GVFS clients).
I've tested all those commits on Fedora and RHEL. With these all obvious issues with gDrive are gone.

Renaming an item on Google Drive does not change the actual GVfs path
because the path is made up of document-ids, which do not change. A
rename operation only affects the title of the entry. In GIO terms,
only the standard::display-name changes, but the standard::name remains
the same.

Therefore, if there is already a file with the same standard::name,
then don't mark it as gone if it is the same file that we are renaming.

https://bugzilla.gnome.org/show_bug.cgi?id=740383
We really should be using standard::display-name when renaming files -
g_file_get_basename is simply not the right thing to use. Moreover,
in case of Google Drive, the URI might not change with the display
name and we can not get the old display name from the old GFile.

Therefore, let's explicitly keep track of the old and new display
names to address these issues.

https://bugzilla.gnome.org/show_bug.cgi?id=754785
Immediately check the volatility of the newly created file or directory
and switch to using the "real" persistent URI. The following operations
are affected:
  - creating new directories
  - creating new files from templates
  - dragging & dropping text to create new files
  - copying and moving of files and directories

The Google Drive backend doesn't support creating symbolic links so we
ignore that case.

https://bugzilla.gnome.org/show_bug.cgi?id=751481
Drag&drop of native Google Drive files doesn't work correctly, because
target path is used, which causes requests for HTTP backend and fails.
The activation URI is used for drag&drop since some time ago. Recently,
this behavior has been disabled for trash locations. This behavior seems
to make sense for recent locations in order to allow dropping in
applications, which are not based on GLib/GIO. It also makes sense for
afpbrowse, dnssd, network, and smbbrowse backends when mounting and
bookmarking. Let's set the activation URI only for the mentioned. This
change should not affect Nemo links (i.e. desktop files and symlinks),
which are handled by different codepath, it should affect only certain
GVfs backends.

https://bugzilla.gnome.org/show_bug.cgi?id=768168
@clefebvre
Copy link
Member

I can confirm this fixes being able to undo rename operations.

However I'm seeing a regression on text files... before this PR double-clicking a text file in a Google Drive mount opened it up in Firefox... now, Cinnamon is unable to detect how to open it and asks the user to choose a program for it.

@clefebvre
Copy link
Member

The regression seems to come from "file: Set activation URI for certain files only".

@clefebvre
Copy link
Member

clefebvre commented Oct 18, 2017

@besser82 I'm unable to test creating new files.. it fails both on master and with this PR.

I would suggest to split the PR so we can merge the functional bits (rename operations, dependencies), and create different PRs for creations and activation URIs so they can be tested and merged in isolation.

@mtwebster
Copy link
Member

How does one get gdrive working here? I've setup my account in the new Online Accounts settings. Is there an accepted/standard way to get drive to show up on gvfs after this?

@leigh123linux
Copy link
Contributor

leigh123linux commented Oct 22, 2017

@mtwebster is gvfs-goa installed?

After setting up in settings it should appear in nemo under network.

@clefebvre
Copy link
Member

rename, undo and glib-dep commits merged.

@clefebvre clefebvre closed this Feb 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants