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 751481 - Support database-backed storages
Support database-backed storages
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: File and Folder Operations
unspecified
Other All
: Normal enhancement
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on: 741602
Blocks: 739008
 
 
Reported: 2015-06-25 08:22 UTC by Debarshi Ray
Modified: 2015-09-11 11:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
file-operations: Let directory creation work on Google Drive (1.77 KB, patch)
2015-06-25 08:29 UTC, Debarshi Ray
none Details | Review
file-operations: Let directory creation work on Google Drive (1.87 KB, patch)
2015-06-26 11:24 UTC, Debarshi Ray
none Details | Review
file-operations: Let directory copy / move work on Google Drive (2.31 KB, patch)
2015-09-07 12:59 UTC, Debarshi Ray
none Details | Review
file-operations: Let directory creation work on Google Drive (1.95 KB, patch)
2015-09-07 15:30 UTC, Debarshi Ray
none Details | Review
file-operations: Let directory copy / move work on Google Drive (2.27 KB, patch)
2015-09-07 15:31 UTC, Debarshi Ray
none Details | Review
file-operations: Let directory creation/copy/move work on Google Drive (3.30 KB, patch)
2015-09-08 12:21 UTC, Debarshi Ray
none Details | Review
file-operations: Let file/directory creation work on Google Drive (6.98 KB, patch)
2015-09-08 13:35 UTC, Debarshi Ray
none Details | Review
file-operations: Let file/directory creation work on Google Drive (7.29 KB, patch)
2015-09-10 10:41 UTC, Debarshi Ray
committed Details | Review

Description Debarshi Ray 2015-06-25 08:22:04 UTC
See bug 741602 for the problem with database-backed storages and various API suggestions to solve it.

An example of such a backend is the one for Google Drive being worked on in bug 739008
Comment 1 Debarshi Ray 2015-06-25 08:29:08 UTC
Created attachment 306076 [details] [review]
file-operations: Let directory creation work on Google Drive
Comment 2 Alexander Larsson 2015-06-25 09:11:35 UTC
Review of attachment 306076 [details] [review]:

You need to do similar things in the create file case, as well as the copy/move/link operations and the related create_dest_dir helper.

::: libnautilus-private/nautilus-file-operations.c
@@ +6066,3 @@
+						  G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
+						  common->cancellable,
+						  &error);

I think this should all go into a helper function, because it needs to be done for the "create file" case too, after the g_file_copy().

@@ +6073,3 @@
+
+				is_volatile = g_file_info_get_attribute_boolean (info,
+										 G_FILE_ATTRIBUTE_STANDARD_IS_VOLATILE);

I would probably add a local #indef G_FILE_ATTRIBUTE_STANDARD_IS_VOLATILE that defines it. That way we avoid depending on a new glib directly. We can remove it in a while.
Comment 3 Debarshi Ray 2015-06-26 11:23:19 UTC
(In reply to Alexander Larsson from comment #2)
> Review of attachment 306076 [details] [review] [review]:

Thanks for taking a look, Alex.

> You need to do similar things in the create file case, as well as the
> copy/move/link operations and the related create_dest_dir helper.
> 
> ::: libnautilus-private/nautilus-file-operations.c
> @@ +6066,3 @@
> +						  G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
> +						  common->cancellable,
> +						  &error);
> 
> I think this should all go into a helper function, because it needs to be
> done for the "create file" case too, after the g_file_copy().

Ok. I will do that once I move to testing those operations.

> @@ +6073,3 @@
> +
> +				is_volatile = g_file_info_get_attribute_boolean (info,
> +										 G_FILE_ATTRIBUTE_STANDARD_IS_VOLATILE);
> 
> I would probably add a local #indef G_FILE_ATTRIBUTE_STANDARD_IS_VOLATILE
> that defines it. That way we avoid depending on a new glib directly. We can
> remove it in a while.

I have add this now.
Comment 4 Debarshi Ray 2015-06-26 11:24:00 UTC
Created attachment 306159 [details] [review]
file-operations: Let directory creation work on Google Drive
Comment 5 Debarshi Ray 2015-09-07 12:59:46 UTC
Created attachment 310813 [details] [review]
file-operations: Let directory copy / move work on Google Drive

Let me know if you want to squash these together.
Comment 6 Debarshi Ray 2015-09-07 15:30:52 UTC
Created attachment 310836 [details] [review]
file-operations: Let directory creation work on Google Drive

We recently fixed the backend to use paths, not URIs, as symlink-target. So we should be using g_file_resolve_relative_path here.
Comment 7 Debarshi Ray 2015-09-07 15:31:23 UTC
Created attachment 310837 [details] [review]
file-operations: Let directory copy / move work on Google Drive
Comment 8 Debarshi Ray 2015-09-08 12:21:26 UTC
Created attachment 310897 [details] [review]
file-operations: Let directory creation/copy/move work on Google Drive

Refactor the mapping code and combine both patches into one.
Comment 9 Debarshi Ray 2015-09-08 13:35:30 UTC
Created attachment 310901 [details] [review]
file-operations: Let file/directory creation work on Google Drive

Cover the remaining file operations, and fix a typo. We ignore symlinks because the backend doesn't support them.
Comment 10 Carlos Soriano 2015-09-08 13:38:59 UTC
I think the ifdef is not necesary at all no? I think we are fine depending on new glib, as we usually depend on new gtk+ almost every release, so we are kinda used to require new libs every release.
Comment 11 Carlos Soriano 2015-09-10 09:54:38 UTC
Review of attachment 310901 [details] [review]:

Code looks good with the glib bump nit and going together with https://bugzilla.gnome.org/show_bug.cgi?id=754785

::: libnautilus-private/nautilus-file-operations.c
@@ +3705,3 @@
+	GFile *real_file = NULL;
+
+#ifdef G_FILE_ATTRIBUTE_STANDARD_IS_VOLATILE

As said if Alex is okay, instead of ifdef, bump glib version. We don't want to have broken sidebar advertising drive support but not working, or confusion on packagers.
Comment 12 Debarshi Ray 2015-09-10 10:41:15 UTC
Created attachment 311051 [details] [review]
file-operations: Let file/directory creation work on Google Drive
Comment 13 Carlos Soriano 2015-09-11 11:47:42 UTC
Review of attachment 311051 [details] [review]:

LGTM
Comment 14 Debarshi Ray 2015-09-11 11:55:26 UTC
Comment on attachment 311051 [details] [review]
file-operations: Let file/directory creation work on Google Drive

Pushed to master. Thanks Carlos!