Fix move and copy operations
Owing to the loss of filename, the copy operation was disabled a long
time ago in (https://bugzilla.gnome.org/show_bug.cgi?id=755701).
Normally, for POSIX based systems, copying /file1
to directory
/folder1
is done by doing copy ('/file1', '/folder1/file1'). Since,
google drive backend uses IDs as filenames (which are not human readable),
so doing a copy operation normally should constitute of doing
copy ('/id1', '/folder1/id2')
, but instead GIO being POSIX compliant
does copy ('/id1', '/folder/id1')
.
Furthermore, after the copy operation has been done, nautilus performs a
query_info
operation on the path /folder1/id1
(to check if the file
has actually been copied) but since the newly created file inside
/folder1
has the new path /folder1/id2
(where 'id2' is generated by
Drive API) this operation fails resulting in an error and the new
file's title being set to id1
(Loss of titles).
To counter this issue, we store id1
in Properties Resource on the new
file being created, and insert a "fake" entry into the cache. This
fake entry (('id1', 'parent') -> GDataEntry
) gives the illusion that
the file exists after the copy operation, and hence the query_info
operation doesn't fail, and copies the file (while retaining title)
successfully.
This commit enables copy operation and handles most of the quirky cases of Drive, e.g. files having same title in a directory, file being copied over to same folder, etc.
Depends upon: libgdata!7 (merged) Fixes: #8 (closed)