Merge lp:~michihenning/storage-framework/specify-metadata into lp:storage-framework/devel

Proposed by Michi Henning
Status: Merged
Approved by: James Henstridge
Approved revision: 84
Merged at revision: 82
Proposed branch: lp:~michihenning/storage-framework/specify-metadata
Merge into: lp:storage-framework/devel
Diff against target: 1802 lines (+365/-232)
25 files modified
data/provider.xml (+27/-0)
demo/provider_test/provider-test.cpp (+18/-17)
include/unity/storage/provider/ProviderBase.h (+9/-8)
include/unity/storage/provider/internal/ProviderInterface.h (+25/-9)
include/unity/storage/qt/Account.h (+3/-4)
include/unity/storage/qt/Item.h (+17/-10)
include/unity/storage/qt/internal/AccountImpl.h (+2/-2)
include/unity/storage/qt/internal/ItemImpl.h (+9/-8)
src/provider/internal/ProviderInterface.cpp (+90/-30)
src/qt/Account.cpp (+4/-4)
src/qt/Item.cpp (+32/-31)
src/qt/client/internal/remote_client/AccountImpl.cpp (+1/-1)
src/qt/client/internal/remote_client/FileImpl.cpp (+1/-1)
src/qt/client/internal/remote_client/FolderImpl.cpp (+5/-5)
src/qt/client/internal/remote_client/ItemImpl.cpp (+2/-2)
src/qt/client/internal/remote_client/RootImpl.cpp (+1/-1)
src/qt/internal/AccountImpl.cpp (+4/-4)
src/qt/internal/ItemImpl.cpp (+20/-18)
tests/provider-ProviderInterface/ProviderInterface_test.cpp (+24/-23)
tests/provider-ProviderInterface/TestProvider.cpp (+18/-9)
tests/provider-ProviderInterface/TestProvider.h (+9/-9)
tests/remote-client-v1/MockProvider.cpp (+9/-9)
tests/remote-client-v1/MockProvider.h (+13/-9)
tests/remote-client/MockProvider.cpp (+9/-9)
tests/remote-client/MockProvider.h (+13/-9)
To merge this branch: bzr merge lp:~michihenning/storage-framework/specify-metadata
Reviewer Review Type Date Requested Status
James Henstridge Approve
unity-api-1-bot continuous-integration Approve
Review via email: mp+308997@code.launchpad.net

Commit message

Added string list param to all methods that return an item, so the client can specify which metadata values should be returned.

Description of the change

Added string list param to all methods that return an item, so the client can specify which metadata values should be returned. An empty list means "return some suitable default set". A single-item list with the key "__ALL__" means the provider should return everything that is available.

None of the code actually uses this yet. This MR just adds the param. There are a number of places where we get warnings for unused parameters, until we flesh out the tests to actually do something with the keys.

Also still need to work out how to present the actual key values to the provider and client. (Ideally, we'd have a single header that is used by both sides, so the known keys can't go out of sync.

To post a comment you must log in.
Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

PASSED: Continuous integration, rev:82
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/158/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/906
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/913
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/716
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/716/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/716
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/716/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/716
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/716/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/716
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/716/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/716
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/716/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/716
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/716/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/716
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/716/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/716
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/716/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/716
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/716/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/158/rebuild

review: Approve (continuous-integration)
Revision history for this message
James Henstridge (jamesh) wrote :

Just the one query about the MetadataKeys typedef, but other than that this look great.

review: Needs Information
83. By Michi Henning

Got rid of MetadataKeys typedef.

Revision history for this message
Michi Henning (michihenning) wrote :

Fixed, thanks! I didn't know about QStringList... :-(

Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

FAILED: Continuous integration, rev:83
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/167/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build/945/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/952
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/755/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/755
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/755/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/755
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/755/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/755/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/755
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/755/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/755
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/755/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/755/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/755
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/755/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/755
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/755/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/167/rebuild

review: Needs Fixing (continuous-integration)
84. By Michi Henning

Fixed compile failure due to Qt header changes on Vivid.

Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

PASSED: Continuous integration, rev:84
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/170/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/948
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/955
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/758
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/758/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/758
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/758/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/758
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/758/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/758
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/758/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/758
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/758/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/758
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/758/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/758
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/758/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/758
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/758/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/758
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/758/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/170/rebuild

review: Approve (continuous-integration)
Revision history for this message
James Henstridge (jamesh) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'data/provider.xml'
--- data/provider.xml 2016-08-11 01:56:11 +0000
+++ data/provider.xml 2016-11-02 04:28:58 +0000
@@ -16,11 +16,21 @@
1616
17 Note that parent_ids is a sequence of IDs instead of a single ID to allow the client to17 Note that parent_ids is a sequence of IDs instead of a single ID to allow the client to
18 navigate items in Google Drive, which permits more than one parent for a file or folder.18 navigate items in Google Drive, which permits more than one parent for a file or folder.
19
20 The metadata_keys parameter allows the caller to select which metadata values should be returned
21 for an item. If the list is empty, the provider will return a "reasonable" default set of metadata
22 values. (Note that this may not be the same set for each provider.) If the caller specifies one or
23 more keys, the provider will return the requested values. Note that not all providers may support
24 all values, so some of the requested values may be missing. Also, providers are free to return
25 additional values that were not requested.
26 Passing a single-element list with the value "__ALL__" indicates that the provider should return
27 all available metadata.
19 -->28 -->
20 <interface name="com.canonical.StorageFramework.Provider">29 <interface name="com.canonical.StorageFramework.Provider">
21 <!--30 <!--
22 Roots:31 Roots:
23 @short_description: Get the list of roots for the storage account32 @short_description: Get the list of roots for the storage account
33 @metadata_keys: what metadata to return for the roots
24 @roots: Returned list of roots.34 @roots: Returned list of roots.
2535
26 Returns the list of top level root items provided by the36 Returns the list of top level root items provided by the
@@ -28,6 +38,7 @@
28 of files, this list will contain a single item.38 of files, this list will contain a single item.
29 -->39 -->
30 <method name="Roots">40 <method name="Roots">
41 <arg type="as" name="metadata_keys" direction="in"/>
31 <arg type="a(sasssia{sv})" name="roots" direction="out"/>42 <arg type="a(sasssia{sv})" name="roots" direction="out"/>
32 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList&lt;unity::storage::internal::ItemMetadata&gt;"/>43 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList&lt;unity::storage::internal::ItemMetadata&gt;"/>
33 </method>44 </method>
@@ -37,6 +48,7 @@
37 @short_description: list the children of the given folder48 @short_description: list the children of the given folder
38 @item_id: the ID identifying the folder49 @item_id: the ID identifying the folder
39 @page_token: if not empty, return the page of results identified by this token.50 @page_token: if not empty, return the page of results identified by this token.
51 @metadata_keys: what metadata to return for the children
40 @children: returned list of children52 @children: returned list of children
41 @next_token: if not empty, a token that can be used to request more results.53 @next_token: if not empty, a token that can be used to request more results.
4254
@@ -48,6 +60,7 @@
48 <method name="List">60 <method name="List">
49 <arg type="s" name="item_id" direction="in"/>61 <arg type="s" name="item_id" direction="in"/>
50 <arg type="s" name="page_token" direction="in"/>62 <arg type="s" name="page_token" direction="in"/>
63 <arg type="as" name="metadata_keys" direction="in"/>
51 <arg type="a(sasssia{sv})" name="children" direction="out"/>64 <arg type="a(sasssia{sv})" name="children" direction="out"/>
52 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList&lt;unity::storage::internal::ItemMetadata&gt;"/>65 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList&lt;unity::storage::internal::ItemMetadata&gt;"/>
53 <arg type="s" name="next_token" direction="out"/>66 <arg type="s" name="next_token" direction="out"/>
@@ -58,11 +71,13 @@
58 @short_description: lookup a child in a folder by name71 @short_description: lookup a child in a folder by name
59 @parent_id: the ID of the parent folder72 @parent_id: the ID of the parent folder
60 @name: the name of the child73 @name: the name of the child
74 @metadata_keys: what metadata to return for the item(s)
61 @items: the matching items in the folder75 @items: the matching items in the folder
62 -->76 -->
63 <method name="Lookup">77 <method name="Lookup">
64 <arg type="s" name="parent_id" direction="in"/>78 <arg type="s" name="parent_id" direction="in"/>
65 <arg type="s" name="name" direction="in"/>79 <arg type="s" name="name" direction="in"/>
80 <arg type="as" name="metadata_keys" direction="in"/>
66 <arg type="a(sasssia{sv})" name="items" direction="out"/>81 <arg type="a(sasssia{sv})" name="items" direction="out"/>
67 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList&lt;unity::storage::internal::ItemMetadata&gt;"/>82 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList&lt;unity::storage::internal::ItemMetadata&gt;"/>
68 </method>83 </method>
@@ -71,10 +86,12 @@
71 Metadata:86 Metadata:
72 @short_description: get metadata for an item87 @short_description: get metadata for an item
73 @item_id: the ID of the item88 @item_id: the ID of the item
89 @metadata_keys: what metadata to return for the item
74 @metadata: the item metadata90 @metadata: the item metadata
75 -->91 -->
76 <method name="Metadata">92 <method name="Metadata">
77 <arg type="s" name="item_id" direction="in"/>93 <arg type="s" name="item_id" direction="in"/>
94 <arg type="as" name="metadata_keys" direction="in"/>
78 <arg type="(sasssia{sv})" name="metadata" direction="out"/>95 <arg type="(sasssia{sv})" name="metadata" direction="out"/>
79 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="unity::storage::internal::ItemMetadata"/>96 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="unity::storage::internal::ItemMetadata"/>
80 </method>97 </method>
@@ -84,11 +101,13 @@
84 @short_description: create a new folder101 @short_description: create a new folder
85 @parent_id: the ID of the parent folder102 @parent_id: the ID of the parent folder
86 @name: the name of the new folder103 @name: the name of the new folder
104 @metadata_keys: what metadata to return for the new folder
87 @metadata: the metadata for the new folder105 @metadata: the metadata for the new folder
88 -->106 -->
89 <method name="CreateFolder">107 <method name="CreateFolder">
90 <arg type="s" name="parent_id" direction="in"/>108 <arg type="s" name="parent_id" direction="in"/>
91 <arg type="s" name="name" direction="in"/>109 <arg type="s" name="name" direction="in"/>
110 <arg type="as" name="metadata_keys" direction="in"/>
92 <arg type="(sasssia{sv})" name="metadata" direction="out"/>111 <arg type="(sasssia{sv})" name="metadata" direction="out"/>
93 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="unity::storage::internal::ItemMetadata"/>112 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="unity::storage::internal::ItemMetadata"/>
94 </method>113 </method>
@@ -102,6 +121,7 @@
102 @content_type: the content type of the new file121 @content_type: the content type of the new file
103 @allow_overwrite: if false, the file creation will fail if it122 @allow_overwrite: if false, the file creation will fail if it
104 would overwrite an existing file.123 would overwrite an existing file.
124 @metadata_keys: what metadata to return for the new file
105 @upload_id: the identifier for this upload job125 @upload_id: the identifier for this upload job
106 @file_descriptor: a file descriptor to write the file contents to126 @file_descriptor: a file descriptor to write the file contents to
107127
@@ -116,6 +136,7 @@
116 <arg type="x" name="size" direction="in"/>136 <arg type="x" name="size" direction="in"/>
117 <arg type="s" name="content_type" direction="in"/>137 <arg type="s" name="content_type" direction="in"/>
118 <arg type="b" name="allow_overwrite" direction="in"/>138 <arg type="b" name="allow_overwrite" direction="in"/>
139 <arg type="as" name="metadata_keys" direction="in"/>
119 <arg type="s" name="upload_id" direction="out"/>140 <arg type="s" name="upload_id" direction="out"/>
120 <arg type="h" name="file_descriptor" direction="out"/>141 <arg type="h" name="file_descriptor" direction="out"/>
121 </method>142 </method>
@@ -127,6 +148,7 @@
127 @size: the size of the upload148 @size: the size of the upload
128 @old_etag: if not empty, the expected etag of the old version149 @old_etag: if not empty, the expected etag of the old version
129 of the file.150 of the file.
151 @metadata_keys: what metadata to return for the updated file
130 @upload_id: the identifier for this upload job152 @upload_id: the identifier for this upload job
131 @file_descriptor: a file descriptor to write the file contents to153 @file_descriptor: a file descriptor to write the file contents to
132154
@@ -144,6 +166,7 @@
144 <arg type="s" name="item_id" direction="in"/>166 <arg type="s" name="item_id" direction="in"/>
145 <arg type="x" name="size" direction="in"/>167 <arg type="x" name="size" direction="in"/>
146 <arg type="s" name="old_etag" direction="in"/>168 <arg type="s" name="old_etag" direction="in"/>
169 <arg type="as" name="metadata_keys" direction="in"/>
147 <arg type="s" name="upload_id" direction="out"/>170 <arg type="s" name="upload_id" direction="out"/>
148 <arg type="h" name="file_descriptor" direction="out"/>171 <arg type="h" name="file_descriptor" direction="out"/>
149 </method>172 </method>
@@ -233,12 +256,14 @@
233 @item_id: the ID for the item256 @item_id: the ID for the item
234 @new_parent_id: the ID for the new parent folder257 @new_parent_id: the ID for the new parent folder
235 @new_name: the new name for the item258 @new_name: the new name for the item
259 @metadata_keys: what metadata to return for the moved item
236 @metadata: the metadata for the file in the new location260 @metadata: the metadata for the file in the new location
237 -->261 -->
238 <method name="Move">262 <method name="Move">
239 <arg type="s" name="item_id" direction="in"/>263 <arg type="s" name="item_id" direction="in"/>
240 <arg type="s" name="new_parent_id" direction="in"/>264 <arg type="s" name="new_parent_id" direction="in"/>
241 <arg type="s" name="new_name" direction="in"/>265 <arg type="s" name="new_name" direction="in"/>
266 <arg type="as" name="metadata_keys" direction="in"/>
242 <arg type="(ssssia{sv})" name="metadata" direction="out"/>267 <arg type="(ssssia{sv})" name="metadata" direction="out"/>
243 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="unity::storage::internal::ItemMetadata"/>268 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="unity::storage::internal::ItemMetadata"/>
244 </method>269 </method>
@@ -249,12 +274,14 @@
249 @item_id: the ID for the item274 @item_id: the ID for the item
250 @new_parent_id: the ID for the new parent folder275 @new_parent_id: the ID for the new parent folder
251 @new_name: the new name for the item276 @new_name: the new name for the item
277 @metadata_keys: what metadata to return for the copied item
252 @metadata: the metadata for the file in the new location278 @metadata: the metadata for the file in the new location
253 -->279 -->
254 <method name="Copy">280 <method name="Copy">
255 <arg type="s" name="item_id" direction="in"/>281 <arg type="s" name="item_id" direction="in"/>
256 <arg type="s" name="new_parent_id" direction="in"/>282 <arg type="s" name="new_parent_id" direction="in"/>
257 <arg type="s" name="new_name" direction="in"/>283 <arg type="s" name="new_name" direction="in"/>
284 <arg type="as" name="metadata_keys" direction="in"/>
258 <arg type="(ssssia{sv})" name="metadata" direction="out"/>285 <arg type="(ssssia{sv})" name="metadata" direction="out"/>
259 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="unity::storage::internal::ItemMetadata"/>286 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="unity::storage::internal::ItemMetadata"/>
260 </method>287 </method>
261288
=== modified file 'demo/provider_test/provider-test.cpp'
--- demo/provider_test/provider-test.cpp 2016-09-03 00:53:43 +0000
+++ demo/provider_test/provider-test.cpp 2016-11-02 04:28:58 +0000
@@ -42,25 +42,25 @@
42public:42public:
43 MyProvider();43 MyProvider();
4444
45 boost::future<ItemList> roots(Context const& ctx) override;45 boost::future<ItemList> roots(vector<string> const& keys, Context const& ctx) override;
46 boost::future<tuple<ItemList,string>> list(46 boost::future<tuple<ItemList,string>> list(
47 string const& item_id, string const& page_token,47 string const& item_id, string const& page_token, vector<string> const& keys,
48 Context const& ctx) override;48 Context const& ctx) override;
49 boost::future<ItemList> lookup(49 boost::future<ItemList> lookup(
50 string const& parent_id, string const& name,50 string const& parent_id, string const& name, vector<string> const& keys,
51 Context const& ctx) override;51 Context const& ctx) override;
52 boost::future<Item> metadata(52 boost::future<Item> metadata(
53 string const& item_id, Context const& ctx) override;53 string const& item_id, vector<string> const& keys, Context const& ctx) override;
54 boost::future<Item> create_folder(54 boost::future<Item> create_folder(
55 string const& parent_id, string const& name,55 string const& parent_id, string const& name, vector<string> const& keys,
56 Context const& ctx) override;56 Context const& ctx) override;
5757
58 boost::future<unique_ptr<UploadJob>> create_file(58 boost::future<unique_ptr<UploadJob>> create_file(
59 string const& parent_id, string const& name,59 string const& parent_id, string const& name,
60 int64_t size, string const& content_type, bool allow_overwrite,60 int64_t size, string const& content_type, bool allow_overwrite, vector<string> const& keys,
61 Context const& ctx) override;61 Context const& ctx) override;
62 boost::future<unique_ptr<UploadJob>> update(62 boost::future<unique_ptr<UploadJob>> update(
63 string const& item_id, int64_t size, string const& old_etag,63 string const& item_id, int64_t size, string const& old_etag, vector<string> const& keys,
64 Context const& ctx) override;64 Context const& ctx) override;
6565
66 boost::future<unique_ptr<DownloadJob>> download(66 boost::future<unique_ptr<DownloadJob>> download(
@@ -70,10 +70,10 @@
70 string const& item_id, Context const& ctx) override;70 string const& item_id, Context const& ctx) override;
71 boost::future<Item> move(71 boost::future<Item> move(
72 string const& item_id, string const& new_parent_id,72 string const& item_id, string const& new_parent_id,
73 string const& new_name, Context const& ctx) override;73 string const& new_name, vector<string> const& keys, Context const& ctx) override;
74 boost::future<Item> copy(74 boost::future<Item> copy(
75 string const& item_id, string const& new_parent_id,75 string const& item_id, string const& new_parent_id,
76 string const& new_name, Context const& ctx) override;76 string const& new_name, vector<string> const& keys, Context const& ctx) override;
77};77};
7878
79class MyUploadJob : public TempfileUploadJob79class MyUploadJob : public TempfileUploadJob
@@ -98,7 +98,7 @@
98{98{
99}99}
100100
101boost::future<ItemList> MyProvider::roots(Context const& ctx)101boost::future<ItemList> MyProvider::roots(vector<string> const& keys, Context const& ctx)
102{102{
103 printf("roots() called by %s (%d)\n", ctx.security_label.c_str(), ctx.pid);103 printf("roots() called by %s (%d)\n", ctx.security_label.c_str(), ctx.pid);
104 fflush(stdout);104 fflush(stdout);
@@ -109,7 +109,7 @@
109}109}
110110
111boost::future<tuple<ItemList,string>> MyProvider::list(111boost::future<tuple<ItemList,string>> MyProvider::list(
112 string const& item_id, string const& page_token,112 string const& item_id, string const& page_token, vector<string> const& keys,
113 Context const& ctx)113 Context const& ctx)
114{114{
115 printf("list('%s', '%s') called by %s (%d)\n", item_id.c_str(), page_token.c_str(), ctx.security_label.c_str(), ctx.pid);115 printf("list('%s', '%s') called by %s (%d)\n", item_id.c_str(), page_token.c_str(), ctx.security_label.c_str(), ctx.pid);
@@ -137,7 +137,7 @@
137}137}
138138
139boost::future<ItemList> MyProvider::lookup(139boost::future<ItemList> MyProvider::lookup(
140 string const& parent_id, string const& name, Context const& ctx)140 string const& parent_id, string const& name, vector<string> const& keys, Context const& ctx)
141{141{
142 printf("lookup('%s', '%s') called by %s (%d)\n", parent_id.c_str(), name.c_str(), ctx.security_label.c_str(), ctx.pid);142 printf("lookup('%s', '%s') called by %s (%d)\n", parent_id.c_str(), name.c_str(), ctx.security_label.c_str(), ctx.pid);
143 fflush(stdout);143 fflush(stdout);
@@ -160,6 +160,7 @@
160}160}
161161
162boost::future<Item> MyProvider::metadata(string const& item_id,162boost::future<Item> MyProvider::metadata(string const& item_id,
163 vector<string> const& keys,
163 Context const& ctx)164 Context const& ctx)
164{165{
165 printf("metadata('%s') called by %s (%d)\n", item_id.c_str(), ctx.security_label.c_str(), ctx.pid);166 printf("metadata('%s') called by %s (%d)\n", item_id.c_str(), ctx.security_label.c_str(), ctx.pid);
@@ -187,7 +188,7 @@
187}188}
188189
189boost::future<Item> MyProvider::create_folder(190boost::future<Item> MyProvider::create_folder(
190 string const& parent_id, string const& name,191 string const& parent_id, string const& name, vector<string> const& keys,
191 Context const& ctx)192 Context const& ctx)
192{193{
193 printf("create_folder('%s', '%s') called by %s (%d)\n", parent_id.c_str(), name.c_str(), ctx.security_label.c_str(), ctx.pid);194 printf("create_folder('%s', '%s') called by %s (%d)\n", parent_id.c_str(), name.c_str(), ctx.security_label.c_str(), ctx.pid);
@@ -204,7 +205,7 @@
204205
205boost::future<unique_ptr<UploadJob>> MyProvider::create_file(206boost::future<unique_ptr<UploadJob>> MyProvider::create_file(
206 string const& parent_id, string const& name,207 string const& parent_id, string const& name,
207 int64_t size, string const& content_type, bool allow_overwrite,208 int64_t size, string const& content_type, bool allow_overwrite, vector<string> const& keys,
208 Context const& ctx)209 Context const& ctx)
209{210{
210 printf("create_file('%s', '%s', %" PRId64 ", '%s', %d) called by %s (%d)\n", parent_id.c_str(), name.c_str(), size, content_type.c_str(), allow_overwrite, ctx.security_label.c_str(), ctx.pid);211 printf("create_file('%s', '%s', %" PRId64 ", '%s', %d) called by %s (%d)\n", parent_id.c_str(), name.c_str(), size, content_type.c_str(), allow_overwrite, ctx.security_label.c_str(), ctx.pid);
@@ -213,7 +214,7 @@
213}214}
214215
215boost::future<unique_ptr<UploadJob>> MyProvider::update(216boost::future<unique_ptr<UploadJob>> MyProvider::update(
216 string const& item_id, int64_t size, string const& old_etag, Context const& ctx)217 string const& item_id, int64_t size, string const& old_etag, vector<string> const& keys, Context const& ctx)
217{218{
218 printf("update('%s', %" PRId64 ", '%s') called by %s (%d)\n", item_id.c_str(), size, old_etag.c_str(), ctx.security_label.c_str(), ctx.pid);219 printf("update('%s', %" PRId64 ", '%s') called by %s (%d)\n", item_id.c_str(), size, old_etag.c_str(), ctx.security_label.c_str(), ctx.pid);
219 fflush(stdout);220 fflush(stdout);
@@ -248,7 +249,7 @@
248249
249boost::future<Item> MyProvider::move(250boost::future<Item> MyProvider::move(
250 string const& item_id, string const& new_parent_id,251 string const& item_id, string const& new_parent_id,
251 string const& new_name, Context const& ctx)252 string const& new_name, vector<string> const& keys, Context const& ctx)
252{253{
253 printf("move('%s', '%s', '%s') called by %s (%d)\n", item_id.c_str(), new_parent_id.c_str(), new_name.c_str(), ctx.security_label.c_str(), ctx.pid);254 printf("move('%s', '%s', '%s') called by %s (%d)\n", item_id.c_str(), new_parent_id.c_str(), new_name.c_str(), ctx.security_label.c_str(), ctx.pid);
254 fflush(stdout);255 fflush(stdout);
@@ -258,7 +259,7 @@
258259
259boost::future<Item> MyProvider::copy(260boost::future<Item> MyProvider::copy(
260 string const& item_id, string const& new_parent_id,261 string const& item_id, string const& new_parent_id,
261 string const& new_name, Context const& ctx)262 string const& new_name, vector<string> const& keys, Context const& ctx)
262{263{
263 printf("copy('%s', '%s', '%s') called by %s (%d)\n", item_id.c_str(), new_parent_id.c_str(), new_name.c_str(), ctx.security_label.c_str(), ctx.pid);264 printf("copy('%s', '%s', '%s') called by %s (%d)\n", item_id.c_str(), new_parent_id.c_str(), new_name.c_str(), ctx.security_label.c_str(), ctx.pid);
264 fflush(stdout);265 fflush(stdout);
265266
=== modified file 'include/unity/storage/provider/ProviderBase.h'
--- include/unity/storage/provider/ProviderBase.h 2016-09-28 07:04:41 +0000
+++ include/unity/storage/provider/ProviderBase.h 2016-11-02 04:28:58 +0000
@@ -75,26 +75,27 @@
75 ProviderBase(ProviderBase const& other) = delete;75 ProviderBase(ProviderBase const& other) = delete;
76 ProviderBase& operator=(ProviderBase const& other) = delete;76 ProviderBase& operator=(ProviderBase const& other) = delete;
7777
78 virtual boost::future<ItemList> roots(Context const& context) = 0;78 virtual boost::future<ItemList> roots(std::vector<std::string> const& keys, Context const& context) = 0;
79 virtual boost::future<std::tuple<ItemList,std::string>> list(79 virtual boost::future<std::tuple<ItemList,std::string>> list(
80 std::string const& item_id, std::string const& page_token,80 std::string const& item_id, std::string const& page_token,
81 std::vector<std::string> const& keys,
81 Context const& context) = 0;82 Context const& context) = 0;
82 virtual boost::future<ItemList> lookup(83 virtual boost::future<ItemList> lookup(
83 std::string const& parent_id, std::string const& name,84 std::string const& parent_id, std::string const& name, std::vector<std::string> const& keys,
84 Context const& context) = 0;85 Context const& context) = 0;
85 virtual boost::future<Item> metadata(std::string const& item_id,86 virtual boost::future<Item> metadata(std::string const& item_id, std::vector<std::string> const& keys,
86 Context const& context) = 0;87 Context const& context) = 0;
8788
88 virtual boost::future<Item> create_folder(89 virtual boost::future<Item> create_folder(
89 std::string const& parent_id, std::string const& name,90 std::string const& parent_id, std::string const& name, std::vector<std::string> const& keys,
90 Context const& context) = 0;91 Context const& context) = 0;
9192
92 virtual boost::future<std::unique_ptr<UploadJob>> create_file(93 virtual boost::future<std::unique_ptr<UploadJob>> create_file(
93 std::string const& parent_id, std::string const& name,94 std::string const& parent_id, std::string const& name,
94 int64_t size, std::string const& content_type, bool allow_overwrite,95 int64_t size, std::string const& content_type, bool allow_overwrite, std::vector<std::string> const& keys,
95 Context const& context) = 0;96 Context const& context) = 0;
96 virtual boost::future<std::unique_ptr<UploadJob>> update(97 virtual boost::future<std::unique_ptr<UploadJob>> update(
97 std::string const& item_id, int64_t size, std::string const& old_etag,98 std::string const& item_id, int64_t size, std::string const& old_etag, std::vector<std::string> const& keys,
98 Context const& context) = 0;99 Context const& context) = 0;
99100
100 virtual boost::future<std::unique_ptr<DownloadJob>> download(101 virtual boost::future<std::unique_ptr<DownloadJob>> download(
@@ -104,10 +105,10 @@
104 std::string const& item_id, Context const& context) = 0;105 std::string const& item_id, Context const& context) = 0;
105 virtual boost::future<Item> move(106 virtual boost::future<Item> move(
106 std::string const& item_id, std::string const& new_parent_id,107 std::string const& item_id, std::string const& new_parent_id,
107 std::string const& new_name, Context const& context) = 0;108 std::string const& new_name, std::vector<std::string> const& keys, Context const& context) = 0;
108 virtual boost::future<Item> copy(109 virtual boost::future<Item> copy(
109 std::string const& item_id, std::string const& new_parent_id,110 std::string const& item_id, std::string const& new_parent_id,
110 std::string const& new_name, Context const& context) = 0;111 std::string const& new_name, std::vector<std::string> const& keys, Context const& context) = 0;
111};112};
112113
113}114}
114115
=== modified file 'include/unity/storage/provider/internal/ProviderInterface.h'
--- include/unity/storage/provider/internal/ProviderInterface.h 2016-08-25 23:56:02 +0000
+++ include/unity/storage/provider/internal/ProviderInterface.h 2016-11-02 04:28:58 +0000
@@ -59,20 +59,36 @@
59 typedef unity::storage::internal::ItemMetadata IMD; // To keep things readable59 typedef unity::storage::internal::ItemMetadata IMD; // To keep things readable
6060
61public Q_SLOTS:61public Q_SLOTS:
62 QList<IMD> Roots();62 QList<IMD> Roots(QList<QString> const& keys);
63 QList<IMD> List(QString const& item_id, QString const& page_token, QString& next_token);63 QList<IMD> List(QString const& item_id, QString const& page_token, QList<QString> const& keys, QString& next_token);
64 QList<IMD> Lookup(QString const& parent_id, QString const& name);64 QList<IMD> Lookup(QString const& parent_id, QString const& name, QList<QString> const& keys);
65 IMD Metadata(QString const& item_id);65 IMD Metadata(QString const& item_id, QList<QString> const& keys);
66 IMD CreateFolder(QString const& parent_id, QString const& name);66 IMD CreateFolder(QString const& parent_id, QString const& name, QList<QString> const& keys);
67 QString CreateFile(QString const& parent_id, QString const& name, int64_t size, QString const& content_type, bool allow_overwrite, QDBusUnixFileDescriptor& file_descriptor);67 QString CreateFile(QString const& parent_id,
68 QString Update(QString const& item_id, int64_t size, QString const& old_etag, QDBusUnixFileDescriptor& file_descriptor);68 QString const& name,
69 int64_t size,
70 QString const& content_type,
71 bool allow_overwrite,
72 QList<QString> const& keys,
73 QDBusUnixFileDescriptor& file_descriptor);
74 QString Update(QString const& item_id,
75 int64_t size,
76 QString const& old_etag,
77 QList<QString> const& keys,
78 QDBusUnixFileDescriptor& file_descriptor);
69 IMD FinishUpload(QString const& upload_id);79 IMD FinishUpload(QString const& upload_id);
70 void CancelUpload(QString const& upload_id);80 void CancelUpload(QString const& upload_id);
71 QString Download(QString const& item_id, QDBusUnixFileDescriptor& file_descriptor);81 QString Download(QString const& item_id, QDBusUnixFileDescriptor& file_descriptor);
72 void FinishDownload(QString const& download_id);82 void FinishDownload(QString const& download_id);
73 void Delete(QString const& item_id);83 void Delete(QString const& item_id);
74 IMD Move(QString const& item_id, QString const& new_parent_id, QString const& new_name);84 IMD Move(QString const& item_id,
75 IMD Copy(QString const& item_id, QString const& new_parent_id, QString const& new_name);85 QString const& new_parent_id,
86 QString const& new_name,
87 QList<QString> const& metadata_keys);
88 IMD Copy(QString const& item_id,
89 QString const& new_parent_id,
90 QString const& new_name,
91 QList<QString> const& metadata_keys);
7692
77private Q_SLOTS:93private Q_SLOTS:
78 void request_finished();94 void request_finished();
7995
=== modified file 'include/unity/storage/qt/Account.h'
--- include/unity/storage/qt/Account.h 2016-10-10 05:24:16 +0000
+++ include/unity/storage/qt/Account.h 2016-11-02 04:28:58 +0000
@@ -18,9 +18,8 @@
1818
19#pragma once19#pragma once
2020
21#include <QList>
22#include <QMetaType>21#include <QMetaType>
23#include <QString>22#include <QStringList>
2423
25#include <memory>24#include <memory>
2625
@@ -62,8 +61,8 @@
62 QString ownerId() const;61 QString ownerId() const;
63 QString description() const;62 QString description() const;
6463
65 Q_INVOKABLE ItemListJob* roots() const;64 Q_INVOKABLE ItemListJob* roots(QStringList const& keys = QStringList()) const;
66 Q_INVOKABLE ItemJob* get(QString const& itemId) const;65 Q_INVOKABLE ItemJob* get(QString const& itemId, QStringList const& keys = QStringList()) const;
6766
68 bool operator==(Account const&) const;67 bool operator==(Account const&) const;
69 bool operator!=(Account const&) const;68 bool operator!=(Account const&) const;
7069
=== modified file 'include/unity/storage/qt/Item.h'
--- include/unity/storage/qt/Item.h 2016-10-13 07:59:12 +0000
+++ include/unity/storage/qt/Item.h 2016-11-02 04:28:58 +0000
@@ -62,7 +62,7 @@
62 Q_PROPERTY(unity::storage::qt::Item::Type type READ type FINAL)62 Q_PROPERTY(unity::storage::qt::Item::Type type READ type FINAL)
63 Q_PROPERTY(QVariantMap metadata READ metadata FINAL)63 Q_PROPERTY(QVariantMap metadata READ metadata FINAL)
64 Q_PROPERTY(QDateTime lastModifiedTime READ lastModifiedTime FINAL)64 Q_PROPERTY(QDateTime lastModifiedTime READ lastModifiedTime FINAL)
65 Q_PROPERTY(QList<QString> parentIds READ parentIds FINAL)65 Q_PROPERTY(QStringList parentIds READ parentIds FINAL)
6666
67public:67public:
68 Item();68 Item();
@@ -95,23 +95,30 @@
95 Type type() const;95 Type type() const;
96 QVariantMap metadata() const;96 QVariantMap metadata() const;
97 QDateTime lastModifiedTime() const;97 QDateTime lastModifiedTime() const;
98 QList<QString> parentIds() const;98 QStringList parentIds() const;
9999
100 Q_INVOKABLE ItemListJob* parents() const;100 Q_INVOKABLE ItemListJob* parents(QStringList const& keys = QStringList()) const;
101 Q_INVOKABLE ItemJob* copy(Item const& newParent, QString const& newName) const;101 Q_INVOKABLE ItemJob* copy(Item const& newParent,
102 Q_INVOKABLE ItemJob* move(Item const& newParent, QString const& newName) const;102 QString const& newName,
103 QStringList const& keys = QStringList()) const;
104 Q_INVOKABLE ItemJob* move(Item const& newParent,
105 QString const& newName,
106 QStringList const& keys = QStringList()) const;
103 Q_INVOKABLE VoidJob* deleteItem() const;107 Q_INVOKABLE VoidJob* deleteItem() const;
104108
105 Q_INVOKABLE Uploader* createUploader(ConflictPolicy policy, qint64 sizeInBytes) const;109 Q_INVOKABLE Uploader* createUploader(ConflictPolicy policy,
110 qint64 sizeInBytes,
111 QStringList const& keys = QStringList()) const;
106 Q_INVOKABLE Downloader* createDownloader() const;112 Q_INVOKABLE Downloader* createDownloader() const;
107113
108 Q_INVOKABLE ItemListJob* list() const;114 Q_INVOKABLE ItemListJob* list(QStringList const& keys = QStringList()) const;
109 Q_INVOKABLE ItemListJob* lookup(QString const& name) const;115 Q_INVOKABLE ItemListJob* lookup(QString const& name, QStringList const& = QStringList()) const;
110 Q_INVOKABLE ItemJob* createFolder(QString const& name) const;116 Q_INVOKABLE ItemJob* createFolder(QString const& name, QStringList const& = QStringList()) const;
111 Q_INVOKABLE Uploader* createFile(QString const& name,117 Q_INVOKABLE Uploader* createFile(QString const& name,
112 ConflictPolicy policy,118 ConflictPolicy policy,
113 qint64 sizeInBytes,119 qint64 sizeInBytes,
114 QString const& contentType) const;120 QString const& contentType,
121 QStringList const& keys = QStringList()) const;
115122
116 Q_INVOKABLE IntJob* freeSpaceBytes() const;123 Q_INVOKABLE IntJob* freeSpaceBytes() const;
117 Q_INVOKABLE IntJob* usedSpaceBytes() const;124 Q_INVOKABLE IntJob* usedSpaceBytes() const;
118125
=== modified file 'include/unity/storage/qt/internal/AccountImpl.h'
--- include/unity/storage/qt/internal/AccountImpl.h 2016-10-12 05:25:20 +0000
+++ include/unity/storage/qt/internal/AccountImpl.h 2016-11-02 04:28:58 +0000
@@ -51,8 +51,8 @@
51 QString owner() const;51 QString owner() const;
52 QString description() const;52 QString description() const;
5353
54 ItemListJob* roots() const;54 ItemListJob* roots(QStringList const& keys) const;
55 ItemJob* get(QString const& itemId) const;55 ItemJob* get(QString const& itemId, QStringList const& keys) const;
5656
57 bool operator==(AccountImpl const&) const;57 bool operator==(AccountImpl const&) const;
58 bool operator!=(AccountImpl const&) const;58 bool operator!=(AccountImpl const&) const;
5959
=== modified file 'include/unity/storage/qt/internal/ItemImpl.h'
--- include/unity/storage/qt/internal/ItemImpl.h 2016-10-13 07:59:12 +0000
+++ include/unity/storage/qt/internal/ItemImpl.h 2016-11-02 04:28:58 +0000
@@ -58,20 +58,21 @@
58 QDateTime lastModifiedTime() const;58 QDateTime lastModifiedTime() const;
59 QList<QString> parentIds() const;59 QList<QString> parentIds() const;
6060
61 ItemListJob* parents() const;61 ItemListJob* parents(QStringList const& keys) const;
62 ItemJob* copy(Item const& newParent, QString const& newName) const;62 ItemJob* copy(Item const& newParent, QString const& newName, QStringList const& keys) const;
63 ItemJob* move(Item const& newParent, QString const& newName) const;63 ItemJob* move(Item const& newParent, QString const& newName, QStringList const& keys) const;
64 VoidJob* deleteItem() const;64 VoidJob* deleteItem() const;
65 Uploader* createUploader(Item::ConflictPolicy policy, qint64 sizeInBytes) const;65 Uploader* createUploader(Item::ConflictPolicy policy, qint64 sizeInBytes, QStringList const& keys) const;
66 Downloader* createDownloader() const;66 Downloader* createDownloader() const;
67 ItemListJob* list() const;67 ItemListJob* list(QStringList const& keys) const;
68 ItemListJob* lookup(QString const& name) const;68 ItemListJob* lookup(QString const& name, QStringList const& keys) const;
69 ItemJob* createFolder(QString const& name) const;69 ItemJob* createFolder(QString const& name, QStringList const& keys) const;
70 Uploader* createFile(QString const& name) const;70 Uploader* createFile(QString const& name) const;
71 Uploader* createFile(QString const& name,71 Uploader* createFile(QString const& name,
72 Item::ConflictPolicy policy,72 Item::ConflictPolicy policy,
73 qint64 sizeInBytes,73 qint64 sizeInBytes,
74 QString const& contentType) const;74 QString const& contentType,
75 QStringList const& keys) const;
75 IntJob* freeSpaceBytes() const;76 IntJob* freeSpaceBytes() const;
76 IntJob* usedSpaceBytes() const;77 IntJob* usedSpaceBytes() const;
7778
7879
=== modified file 'src/provider/internal/ProviderInterface.cpp'
--- src/provider/internal/ProviderInterface.cpp 2016-09-02 13:51:37 +0000
+++ src/provider/internal/ProviderInterface.cpp 2016-11-02 04:28:58 +0000
@@ -33,6 +33,21 @@
3333
34using namespace std;34using namespace std;
3535
36namespace
37{
38
39vector<string> to_vector(QList<QString> const& l)
40{
41 vector<string> v;
42 for (auto const& s : l)
43 {
44 v.push_back(s.toStdString());
45 }
46 return v;
47}
48
49}
50
36namespace unity {51namespace unity {
37namespace storage {52namespace storage {
38namespace provider {53namespace provider {
@@ -86,10 +101,10 @@
86 handler->deleteLater();101 handler->deleteLater();
87}102}
88103
89QList<ProviderInterface::IMD> ProviderInterface::Roots()104QList<ProviderInterface::IMD> ProviderInterface::Roots(QList<QString> const& keys)
90{105{
91 queue_request([](shared_ptr<AccountData> const& account, Context const& ctx, QDBusMessage const& message) {106 queue_request([keys](shared_ptr<AccountData> const& account, Context const& ctx, QDBusMessage const& message) {
92 auto f = account->provider().roots(ctx);107 auto f = account->provider().roots(to_vector(keys), ctx);
93 return f.then(108 return f.then(
94 EXEC_IN_MAIN109 EXEC_IN_MAIN
95 [account, message](decltype(f) f) -> QDBusMessage {110 [account, message](decltype(f) f) -> QDBusMessage {
@@ -100,10 +115,15 @@
100 return {};115 return {};
101}116}
102117
103QList<ProviderInterface::IMD> ProviderInterface::List(QString const& item_id, QString const& page_token, QString& /*next_token*/)118QList<ProviderInterface::IMD> ProviderInterface::List(QString const& item_id,
119 QString const& page_token,
120 QList<QString> const& keys,
121 QString& /*next_token*/)
104{122{
105 queue_request([item_id, page_token](shared_ptr<AccountData> const& account, Context const& ctx, QDBusMessage const& message) {123 queue_request([item_id, page_token, keys](shared_ptr<AccountData> const& account,
106 auto f = account->provider().list(item_id.toStdString(), page_token.toStdString(), ctx);124 Context const& ctx,
125 QDBusMessage const& message) {
126 auto f = account->provider().list(item_id.toStdString(), page_token.toStdString(), to_vector(keys), ctx);
107 return f.then(127 return f.then(
108 EXEC_IN_MAIN128 EXEC_IN_MAIN
109 [account, message](decltype(f) f) -> QDBusMessage {129 [account, message](decltype(f) f) -> QDBusMessage {
@@ -119,10 +139,14 @@
119 return {};139 return {};
120}140}
121141
122QList<ProviderInterface::IMD> ProviderInterface::Lookup(QString const& parent_id, QString const& name)142QList<ProviderInterface::IMD> ProviderInterface::Lookup(QString const& parent_id,
143 QString const& name,
144 QList<QString> const& keys)
123{145{
124 queue_request([parent_id, name](shared_ptr<AccountData> const& account, Context const& ctx, QDBusMessage const& message) {146 queue_request([parent_id, name, keys](shared_ptr<AccountData> const& account,
125 auto f = account->provider().lookup(parent_id.toStdString(), name.toStdString(), ctx);147 Context const& ctx,
148 QDBusMessage const& message) {
149 auto f = account->provider().lookup(parent_id.toStdString(), name.toStdString(), to_vector(keys), ctx);
126 return f.then(150 return f.then(
127 EXEC_IN_MAIN151 EXEC_IN_MAIN
128 [account, message](decltype(f) f) -> QDBusMessage {152 [account, message](decltype(f) f) -> QDBusMessage {
@@ -133,10 +157,12 @@
133 return {};157 return {};
134}158}
135159
136ProviderInterface::IMD ProviderInterface::Metadata(QString const& item_id)160ProviderInterface::IMD ProviderInterface::Metadata(QString const& item_id, QList<QString> const& keys)
137{161{
138 queue_request([item_id](shared_ptr<AccountData> const& account, Context const& ctx, QDBusMessage const& message) {162 queue_request([item_id, keys](shared_ptr<AccountData> const& account,
139 auto f = account->provider().metadata(item_id.toStdString(), ctx);163 Context const& ctx,
164 QDBusMessage const& message) {
165 auto f = account->provider().metadata(item_id.toStdString(), to_vector(keys), ctx);
140 return f.then(166 return f.then(
141 EXEC_IN_MAIN167 EXEC_IN_MAIN
142 [account, message](decltype(f) f) -> QDBusMessage {168 [account, message](decltype(f) f) -> QDBusMessage {
@@ -147,11 +173,15 @@
147 return {};173 return {};
148}174}
149175
150ProviderInterface::IMD ProviderInterface::CreateFolder(QString const& parent_id, QString const& name)176ProviderInterface::IMD ProviderInterface::CreateFolder(QString const& parent_id,
177 QString const& name,
178 QList<QString> const& keys)
151{179{
152 queue_request([parent_id, name](shared_ptr<AccountData> const& account, Context const& ctx, QDBusMessage const& message) {180 queue_request([parent_id, name, keys](shared_ptr<AccountData> const& account,
181 Context const& ctx,
182 QDBusMessage const& message) {
153 auto f = account->provider().create_folder(183 auto f = account->provider().create_folder(
154 parent_id.toStdString(), name.toStdString(), ctx);184 parent_id.toStdString(), name.toStdString(), to_vector(keys), ctx);
155 return f.then(185 return f.then(
156 EXEC_IN_MAIN186 EXEC_IN_MAIN
157 [account, message](decltype(f) f) -> QDBusMessage {187 [account, message](decltype(f) f) -> QDBusMessage {
@@ -162,12 +192,20 @@
162 return {};192 return {};
163}193}
164194
165QString ProviderInterface::CreateFile(QString const& parent_id, QString const& name, int64_t size, QString const& content_type, bool allow_overwrite, QDBusUnixFileDescriptor& /*file_descriptor*/)195QString ProviderInterface::CreateFile(QString const& parent_id,
196 QString const& name,
197 int64_t size,
198 QString const& content_type,
199 bool allow_overwrite,
200 QList<QString> const& keys,
201 QDBusUnixFileDescriptor& /*file_descriptor*/)
166{202{
167 queue_request([parent_id, name, size, content_type, allow_overwrite](shared_ptr<AccountData> const& account, Context const& ctx, QDBusMessage const& message) {203 queue_request([parent_id, name, size, content_type, allow_overwrite, keys](shared_ptr<AccountData> const& account,
204 Context const& ctx,
205 QDBusMessage const& message) {
168 auto f = account->provider().create_file(206 auto f = account->provider().create_file(
169 parent_id.toStdString(), name.toStdString(),207 parent_id.toStdString(), name.toStdString(),
170 size, content_type.toStdString(), allow_overwrite, ctx);208 size, content_type.toStdString(), allow_overwrite, to_vector(keys), ctx);
171 return f.then(209 return f.then(
172 EXEC_IN_MAIN210 EXEC_IN_MAIN
173 [account, message](decltype(f) f) -> QDBusMessage {211 [account, message](decltype(f) f) -> QDBusMessage {
@@ -188,11 +226,17 @@
188 return "";226 return "";
189}227}
190228
191QString ProviderInterface::Update(QString const& item_id, int64_t size, QString const& old_etag, QDBusUnixFileDescriptor& /*file_descriptor*/)229QString ProviderInterface::Update(QString const& item_id,
230 int64_t size,
231 QString const& old_etag,
232 QList<QString> const& keys,
233 QDBusUnixFileDescriptor& /*file_descriptor*/)
192{234{
193 queue_request([item_id, size, old_etag](shared_ptr<AccountData> const& account, Context const& ctx, QDBusMessage const& message) {235 queue_request([item_id, size, old_etag, keys](shared_ptr<AccountData> const& account,
236 Context const& ctx,
237 QDBusMessage const& message) {
194 auto f = account->provider().update(238 auto f = account->provider().update(
195 item_id.toStdString(), size, old_etag.toStdString(), ctx);239 item_id.toStdString(), size, old_etag.toStdString(), to_vector(keys), ctx);
196 return f.then(240 return f.then(
197 EXEC_IN_MAIN241 EXEC_IN_MAIN
198 [account, message](decltype(f) f) -> QDBusMessage {242 [account, message](decltype(f) f) -> QDBusMessage {
@@ -215,7 +259,9 @@
215259
216ProviderInterface::IMD ProviderInterface::FinishUpload(QString const& upload_id)260ProviderInterface::IMD ProviderInterface::FinishUpload(QString const& upload_id)
217{261{
218 queue_request([upload_id](shared_ptr<AccountData> const& account, Context const& /*ctx*/, QDBusMessage const& message) {262 queue_request([upload_id](shared_ptr<AccountData> const& account,
263 Context const& /*ctx*/,
264 QDBusMessage const& message) {
219 // FIXME: removing the job at this point means we can't265 // FIXME: removing the job at this point means we can't
220 // cancel during finish().266 // cancel during finish().
221 // Throws if job is not available267 // Throws if job is not available
@@ -233,7 +279,9 @@
233279
234void ProviderInterface::CancelUpload(QString const& upload_id)280void ProviderInterface::CancelUpload(QString const& upload_id)
235{281{
236 queue_request([upload_id](shared_ptr<AccountData> const& account, Context const& /*ctx*/, QDBusMessage const& message) {282 queue_request([upload_id](shared_ptr<AccountData> const& account,
283 Context const& /*ctx*/,
284 QDBusMessage const& message) {
237 // Throws if job is not available285 // Throws if job is not available
238 auto job = account->jobs().remove_upload(message.service(), upload_id.toStdString());286 auto job = account->jobs().remove_upload(message.service(), upload_id.toStdString());
239 auto f = job->p_->cancel(*job);287 auto f = job->p_->cancel(*job);
@@ -273,7 +321,9 @@
273321
274void ProviderInterface::FinishDownload(QString const& download_id)322void ProviderInterface::FinishDownload(QString const& download_id)
275{323{
276 queue_request([download_id](shared_ptr<AccountData> const& account, Context const& /*ctx*/, QDBusMessage const& message) {324 queue_request([download_id](shared_ptr<AccountData> const& account,
325 Context const& /*ctx*/,
326 QDBusMessage const& message) {
277 // FIXME: removing the job at this point means we can't327 // FIXME: removing the job at this point means we can't
278 // cancel during finish().328 // cancel during finish().
279 // Throws if job is not available329 // Throws if job is not available
@@ -302,12 +352,17 @@
302 });352 });
303}353}
304354
305ProviderInterface::IMD ProviderInterface::Move(QString const& item_id, QString const& new_parent_id, QString const& new_name)355ProviderInterface::IMD ProviderInterface::Move(QString const& item_id,
356 QString const& new_parent_id,
357 QString const& new_name,
358 QList<QString> const& keys)
306{359{
307 queue_request([item_id, new_parent_id, new_name](shared_ptr<AccountData> const& account, Context const& ctx, QDBusMessage const& message) {360 queue_request([item_id, new_parent_id, new_name, keys](shared_ptr<AccountData> const& account,
361 Context const& ctx,
362 QDBusMessage const& message) {
308 auto f = account->provider().move(363 auto f = account->provider().move(
309 item_id.toStdString(), new_parent_id.toStdString(),364 item_id.toStdString(), new_parent_id.toStdString(),
310 new_name.toStdString(), ctx);365 new_name.toStdString(), to_vector(keys), ctx);
311 return f.then(366 return f.then(
312 EXEC_IN_MAIN367 EXEC_IN_MAIN
313 [account, message](decltype(f) f) -> QDBusMessage {368 [account, message](decltype(f) f) -> QDBusMessage {
@@ -318,12 +373,17 @@
318 return {};373 return {};
319}374}
320375
321ProviderInterface::IMD ProviderInterface::Copy(QString const& item_id, QString const& new_parent_id, QString const& new_name)376ProviderInterface::IMD ProviderInterface::Copy(QString const& item_id,
377 QString const& new_parent_id,
378 QString const& new_name,
379 QList<QString> const& keys)
322{380{
323 queue_request([item_id, new_parent_id, new_name](shared_ptr<AccountData> const& account, Context const& ctx, QDBusMessage const& message) {381 queue_request([item_id, new_parent_id, new_name, keys](shared_ptr<AccountData> const& account,
382 Context const& ctx,
383 QDBusMessage const& message) {
324 auto f = account->provider().copy(384 auto f = account->provider().copy(
325 item_id.toStdString(), new_parent_id.toStdString(),385 item_id.toStdString(), new_parent_id.toStdString(),
326 new_name.toStdString(), ctx);386 new_name.toStdString(), to_vector(keys), ctx);
327 return f.then(387 return f.then(
328 EXEC_IN_MAIN388 EXEC_IN_MAIN
329 [account, message](decltype(f) f) -> QDBusMessage {389 [account, message](decltype(f) f) -> QDBusMessage {
330390
=== modified file 'src/qt/Account.cpp'
--- src/qt/Account.cpp 2016-09-22 01:52:20 +0000
+++ src/qt/Account.cpp 2016-11-02 04:28:58 +0000
@@ -93,14 +93,14 @@
93 return p_->description();93 return p_->description();
94}94}
9595
96ItemListJob* Account::roots() const96ItemListJob* Account::roots(QStringList const& keys) const
97{97{
98 return p_->roots();98 return p_->roots(keys);
99}99}
100100
101ItemJob* Account::get(QString const& itemId) const101ItemJob* Account::get(QString const& itemId, QStringList const& keys) const
102{102{
103 return p_->get(itemId);103 return p_->get(itemId, keys);
104}104}
105105
106bool Account::operator==(Account const& other) const106bool Account::operator==(Account const& other) const
107107
=== modified file 'src/qt/Item.cpp'
--- src/qt/Item.cpp 2016-10-13 07:59:12 +0000
+++ src/qt/Item.cpp 2016-11-02 04:28:58 +0000
@@ -112,24 +112,24 @@
112 return p_->lastModifiedTime();112 return p_->lastModifiedTime();
113}113}
114114
115QList<QString> Item::parentIds() const115QStringList Item::parentIds() const
116{116{
117 return p_->parentIds();117 return p_->parentIds();
118}118}
119119
120ItemListJob* Item::parents() const120ItemListJob* Item::parents(QStringList const& keys) const
121{121{
122 return p_->parents();122 return p_->parents(keys);
123}123}
124124
125ItemJob* Item::copy(Item const& newParent, QString const& newName) const125ItemJob* Item::copy(Item const& newParent, QString const& newName, QStringList const& keys) const
126{126{
127 return p_->copy(newParent, newName);127 return p_->copy(newParent, newName, keys);
128}128}
129129
130ItemJob* Item::move(Item const& newParent, QString const& newName) const130ItemJob* Item::move(Item const& newParent, QString const& newName, QStringList const& keys) const
131{131{
132 return p_->move(newParent, newName);132 return p_->move(newParent, newName, keys);
133}133}
134134
135VoidJob* Item::deleteItem() const135VoidJob* Item::deleteItem() const
@@ -137,9 +137,9 @@
137 return p_->deleteItem();137 return p_->deleteItem();
138}138}
139139
140Uploader* Item::createUploader(ConflictPolicy policy, qint64 sizeInBytes) const140Uploader* Item::createUploader(ConflictPolicy policy, qint64 sizeInBytes, QStringList const& keys) const
141{141{
142 return p_->createUploader(policy, sizeInBytes);142 return p_->createUploader(policy, sizeInBytes, keys);
143}143}
144144
145Downloader* Item::createDownloader() const145Downloader* Item::createDownloader() const
@@ -147,27 +147,28 @@
147 return p_->createDownloader();147 return p_->createDownloader();
148}148}
149149
150ItemListJob* Item::list() const150ItemListJob* Item::list(QStringList const& keys) const
151{151{
152 return p_->list();152 return p_->list(keys);
153}153}
154154
155ItemListJob* Item::lookup(QString const& name) const155ItemListJob* Item::lookup(QString const& name, QStringList const& keys) const
156{156{
157 return p_->lookup(name);157 return p_->lookup(name, keys);
158}158}
159159
160ItemJob* Item::createFolder(QString const& name) const160ItemJob* Item::createFolder(QString const& name, QStringList const& keys) const
161{161{
162 return p_->createFolder(name);162 return p_->createFolder(name, keys);
163}163}
164164
165Uploader* Item::createFile(QString const& name,165Uploader* Item::createFile(QString const& name,
166 ConflictPolicy policy,166 ConflictPolicy policy,
167 qint64 sizeInBytes,167 qint64 sizeInBytes,
168 QString const& contentType) const168 QString const& contentType,
169 QStringList const& keys) const
169{170{
170 return p_->createFile(name, policy, sizeInBytes, contentType);171 return p_->createFile(name, policy, sizeInBytes, contentType, keys);
171}172}
172173
173IntJob* Item::freeSpaceBytes() const174IntJob* Item::freeSpaceBytes() const
174175
=== modified file 'src/qt/client/internal/remote_client/AccountImpl.cpp'
--- src/qt/client/internal/remote_client/AccountImpl.cpp 2016-08-26 04:45:56 +0000
+++ src/qt/client/internal/remote_client/AccountImpl.cpp 2016-11-02 04:28:58 +0000
@@ -86,7 +86,7 @@
86 return make_exceptional_future<QVector<Root::SPtr>>(RuntimeDestroyedException("Account::roots()"));86 return make_exceptional_future<QVector<Root::SPtr>>(RuntimeDestroyedException("Account::roots()"));
87 }87 }
8888
89 auto reply = provider_->Roots();89 auto reply = provider_->Roots(QList<QString>());
9090
91 auto process_reply = [this](decltype(reply) const& reply, QFutureInterface<QVector<Root::SPtr>>& qf)91 auto process_reply = [this](decltype(reply) const& reply, QFutureInterface<QVector<Root::SPtr>>& qf)
92 {92 {
9393
=== modified file 'src/qt/client/internal/remote_client/FileImpl.cpp'
--- src/qt/client/internal/remote_client/FileImpl.cpp 2016-08-26 04:45:56 +0000
+++ src/qt/client/internal/remote_client/FileImpl.cpp 2016-11-02 04:28:58 +0000
@@ -72,7 +72,7 @@
7272
73 QString old_etag = policy == ConflictPolicy::overwrite ? "" : md_.etag;73 QString old_etag = policy == ConflictPolicy::overwrite ? "" : md_.etag;
74 auto prov = provider();74 auto prov = provider();
75 auto reply = prov->Update(md_.item_id, size, old_etag);75 auto reply = prov->Update(md_.item_id, size, old_etag, QList<QString>());
7676
77 auto process_reply = [this, size, old_etag, prov](decltype(reply) const& reply,77 auto process_reply = [this, size, old_etag, prov](decltype(reply) const& reply,
78 QFutureInterface<std::shared_ptr<Uploader>>& qf)78 QFutureInterface<std::shared_ptr<Uploader>>& qf)
7979
=== modified file 'src/qt/client/internal/remote_client/FolderImpl.cpp'
--- src/qt/client/internal/remote_client/FolderImpl.cpp 2016-08-26 04:45:56 +0000
+++ src/qt/client/internal/remote_client/FolderImpl.cpp 2016-11-02 04:28:58 +0000
@@ -68,7 +68,7 @@
68 }68 }
6969
70 auto prov = provider();70 auto prov = provider();
71 auto reply = prov->List(md_.item_id, "");71 auto reply = prov->List(md_.item_id, "", QList<QString>());
7272
73 // Sorry for the mess, but we can't use auto for the lambda because it calls itself,73 // Sorry for the mess, but we can't use auto for the lambda because it calls itself,
74 // and the compiler can't deduce the type of the lambda while it's still parsing the lambda body.74 // and the compiler can't deduce the type of the lambda while it's still parsing the lambda body.
@@ -114,7 +114,7 @@
114 else114 else
115 {115 {
116 // Request next lot.116 // Request next lot.
117 auto next_reply = prov->List(md_.item_id, token);117 auto next_reply = prov->List(md_.item_id, token, QList<QString>());
118 new Handler<QVector<shared_ptr<Item>>>(const_cast<FolderImpl*>(this), next_reply, process_reply);118 new Handler<QVector<shared_ptr<Item>>>(const_cast<FolderImpl*>(this), next_reply, process_reply);
119 }119 }
120 };120 };
@@ -135,7 +135,7 @@
135 }135 }
136136
137 auto prov = provider();137 auto prov = provider();
138 auto reply = prov->Lookup(md_.item_id, name);138 auto reply = prov->Lookup(md_.item_id, name, QList<QString>());
139139
140 auto process_reply = [this, name](decltype(reply) const& reply, QFutureInterface<QVector<shared_ptr<Item>>>& qf)140 auto process_reply = [this, name](decltype(reply) const& reply, QFutureInterface<QVector<shared_ptr<Item>>>& qf)
141 {141 {
@@ -194,7 +194,7 @@
194 }194 }
195195
196 auto prov = provider();196 auto prov = provider();
197 auto reply = prov->CreateFolder(md_.item_id, name);197 auto reply = prov->CreateFolder(md_.item_id, name, QList<QString>());
198198
199 auto process_reply = [this](decltype(reply) const& reply, QFutureInterface<shared_ptr<Folder>>& qf)199 auto process_reply = [this](decltype(reply) const& reply, QFutureInterface<shared_ptr<Folder>>& qf)
200 {200 {
@@ -252,7 +252,7 @@
252 }252 }
253253
254 auto prov = provider();254 auto prov = provider();
255 auto reply = prov->CreateFile(md_.item_id, name, size, "application/octet-stream", false);255 auto reply = prov->CreateFile(md_.item_id, name, size, "application/octet-stream", false, QList<QString>());
256256
257 auto process_reply = [this, size](decltype(reply) const& reply, QFutureInterface<shared_ptr<Uploader>>& qf)257 auto process_reply = [this, size](decltype(reply) const& reply, QFutureInterface<shared_ptr<Uploader>>& qf)
258 {258 {
259259
=== modified file 'src/qt/client/internal/remote_client/ItemImpl.cpp'
--- src/qt/client/internal/remote_client/ItemImpl.cpp 2016-09-28 04:37:14 +0000
+++ src/qt/client/internal/remote_client/ItemImpl.cpp 2016-11-02 04:28:58 +0000
@@ -95,7 +95,7 @@
95 }95 }
9696
97 auto prov = provider();97 auto prov = provider();
98 auto reply = prov->Copy(md_.item_id, new_parent->native_identity(), new_name);98 auto reply = prov->Copy(md_.item_id, new_parent->native_identity(), new_name, QList<QString>());
9999
100 auto process_reply = [this](decltype(reply) const& reply, QFutureInterface<std::shared_ptr<Item>>& qf)100 auto process_reply = [this](decltype(reply) const& reply, QFutureInterface<std::shared_ptr<Item>>& qf)
101 {101 {
@@ -160,7 +160,7 @@
160 {160 {
161 return make_exceptional_future<shared_ptr<Item>>(RuntimeDestroyedException("Item::move()"));161 return make_exceptional_future<shared_ptr<Item>>(RuntimeDestroyedException("Item::move()"));
162 }162 }
163 auto reply = prov->Move(md_.item_id, new_parent->native_identity(), new_name);163 auto reply = prov->Move(md_.item_id, new_parent->native_identity(), new_name, QList<QString>());
164164
165 auto process_reply = [this](decltype(reply) const& reply, QFutureInterface<std::shared_ptr<Item>>& qf)165 auto process_reply = [this](decltype(reply) const& reply, QFutureInterface<std::shared_ptr<Item>>& qf)
166 {166 {
167167
=== modified file 'src/qt/client/internal/remote_client/RootImpl.cpp'
--- src/qt/client/internal/remote_client/RootImpl.cpp 2016-08-26 04:45:56 +0000
+++ src/qt/client/internal/remote_client/RootImpl.cpp 2016-11-02 04:28:58 +0000
@@ -122,7 +122,7 @@
122 }122 }
123123
124 auto prov = provider();124 auto prov = provider();
125 auto reply = prov->Metadata(native_identity);125 auto reply = prov->Metadata(native_identity, QList<QString>());
126126
127 auto process_reply = [this](decltype(reply) const& reply, QFutureInterface<Item::SPtr>& qf)127 auto process_reply = [this](decltype(reply) const& reply, QFutureInterface<Item::SPtr>& qf)
128 {128 {
129129
=== modified file 'src/qt/internal/AccountImpl.cpp'
--- src/qt/internal/AccountImpl.cpp 2016-10-12 05:25:20 +0000
+++ src/qt/internal/AccountImpl.cpp 2016-11-02 04:28:58 +0000
@@ -81,7 +81,7 @@
81 return is_valid_ ? description_ : "";81 return is_valid_ ? description_ : "";
82}82}
8383
84ItemListJob* AccountImpl::roots() const84ItemListJob* AccountImpl::roots(QStringList const& keys) const
85{85{
86 QString const method = "Account::roots()";86 QString const method = "Account::roots()";
8787
@@ -107,12 +107,12 @@
107 }107 }
108 };108 };
109109
110 auto reply = provider_->Roots();110 auto reply = provider_->Roots(keys);
111 auto This = const_pointer_cast<AccountImpl>(shared_from_this());111 auto This = const_pointer_cast<AccountImpl>(shared_from_this());
112 return ItemListJobImpl::make_job(This, method, reply, validate);112 return ItemListJobImpl::make_job(This, method, reply, validate);
113}113}
114114
115ItemJob* AccountImpl::get(QString const& itemId) const115ItemJob* AccountImpl::get(QString const& itemId, QStringList const& keys) const
116{116{
117 QString const method = "Account::get()";117 QString const method = "Account::get()";
118118
@@ -132,7 +132,7 @@
132 {132 {
133 };133 };
134134
135 auto reply = provider_->Metadata(itemId);135 auto reply = provider_->Metadata(itemId, keys);
136 auto This = const_pointer_cast<AccountImpl>(shared_from_this());136 auto This = const_pointer_cast<AccountImpl>(shared_from_this());
137 return ItemJobImpl::make_job(This, method, reply, validate);137 return ItemJobImpl::make_job(This, method, reply, validate);
138}138}
139139
=== modified file 'src/qt/internal/ItemImpl.cpp'
--- src/qt/internal/ItemImpl.cpp 2016-10-17 12:23:12 +0000
+++ src/qt/internal/ItemImpl.cpp 2016-11-02 04:28:58 +0000
@@ -115,7 +115,7 @@
115 return md_.parent_ids;115 return md_.parent_ids;
116}116}
117117
118ItemListJob* ItemImpl::parents() const118ItemListJob* ItemImpl::parents(QStringList const& keys) const
119{119{
120 QString const method = "Item::parents()";120 QString const method = "Item::parents()";
121121
@@ -135,7 +135,7 @@
135 QList<QDBusPendingReply<storage::internal::ItemMetadata>> replies;135 QList<QDBusPendingReply<storage::internal::ItemMetadata>> replies;
136 for (auto const& id : md_.parent_ids)136 for (auto const& id : md_.parent_ids)
137 {137 {
138 auto reply = account_impl_->provider()->Metadata(id);138 auto reply = account_impl_->provider()->Metadata(id, keys);
139 replies.append(reply);139 replies.append(reply);
140 }140 }
141141
@@ -152,7 +152,7 @@
152 return MultiItemJobImpl::make_job(account_impl_, method, replies, validate);152 return MultiItemJobImpl::make_job(account_impl_, method, replies, validate);
153}153}
154154
155ItemJob* ItemImpl::copy(Item const& newParent, QString const& newName) const155ItemJob* ItemImpl::copy(Item const& newParent, QString const& newName, QStringList const& keys) const
156{156{
157 QString const method = "Item::copy()";157 QString const method = "Item::copy()";
158158
@@ -174,12 +174,12 @@
174 }174 }
175 };175 };
176176
177 auto reply = account_impl_->provider()->Copy(md_.item_id, newParent.itemId(), newName);177 auto reply = account_impl_->provider()->Copy(md_.item_id, newParent.itemId(), newName, keys);
178 auto This = const_pointer_cast<ItemImpl>(shared_from_this());178 auto This = const_pointer_cast<ItemImpl>(shared_from_this());
179 return ItemJobImpl::make_job(This, method, reply, validate);179 return ItemJobImpl::make_job(This, method, reply, validate);
180}180}
181181
182ItemJob* ItemImpl::move(Item const& newParent, QString const& newName) const182ItemJob* ItemImpl::move(Item const& newParent, QString const& newName, QStringList const& keys) const
183{183{
184 QString const method = "Item::move()";184 QString const method = "Item::move()";
185185
@@ -207,7 +207,7 @@
207 }207 }
208 };208 };
209209
210 auto reply = account_impl_->provider()->Move(md_.item_id, newParent.itemId(), newName);210 auto reply = account_impl_->provider()->Move(md_.item_id, newParent.itemId(), newName, keys);
211 auto This = const_pointer_cast<ItemImpl>(shared_from_this());211 auto This = const_pointer_cast<ItemImpl>(shared_from_this());
212 return ItemJobImpl::make_job(This, method, reply, validate);212 return ItemJobImpl::make_job(This, method, reply, validate);
213}213}
@@ -232,7 +232,7 @@
232 return VoidJobImpl::make_job(This, method, reply);232 return VoidJobImpl::make_job(This, method, reply);
233}233}
234234
235Uploader* ItemImpl::createUploader(Item::ConflictPolicy policy, qint64 sizeInBytes) const235Uploader* ItemImpl::createUploader(Item::ConflictPolicy policy, qint64 sizeInBytes, QStringList const& keys) const
236{236{
237 QString const method = "Item::createUploader()";237 QString const method = "Item::createUploader()";
238238
@@ -263,7 +263,7 @@
263 };263 };
264264
265 auto etag = policy == Item::ConflictPolicy::Overwrite ? "" : md_.etag;265 auto etag = policy == Item::ConflictPolicy::Overwrite ? "" : md_.etag;
266 auto reply = account_impl_->provider()->Update(md_.item_id, sizeInBytes, etag);266 auto reply = account_impl_->provider()->Update(md_.item_id, sizeInBytes, etag, keys);
267 auto This = const_pointer_cast<ItemImpl>(shared_from_this());267 auto This = const_pointer_cast<ItemImpl>(shared_from_this());
268 return UploaderImpl::make_job(This, method, reply, validate, policy, sizeInBytes);268 return UploaderImpl::make_job(This, method, reply, validate, policy, sizeInBytes);
269}269}
@@ -288,7 +288,7 @@
288 return DownloaderImpl::make_job(This, method, reply);288 return DownloaderImpl::make_job(This, method, reply);
289}289}
290290
291ItemListJob* ItemImpl::list() const291ItemListJob* ItemImpl::list(QStringList const& keys) const
292{292{
293 QString const method = "Item::list()";293 QString const method = "Item::list()";
294294
@@ -313,17 +313,17 @@
313 }313 }
314 };314 };
315315
316 auto fetch_next = [this](QString const& page_token)316 auto fetch_next = [this, keys](QString const& page_token)
317 {317 {
318 return account_impl_->provider()->List(md_.item_id, page_token);318 return account_impl_->provider()->List(md_.item_id, page_token, keys);
319 };319 };
320320
321 auto reply = account_impl_->provider()->List(md_.item_id, "");321 auto reply = account_impl_->provider()->List(md_.item_id, "", keys);
322 auto This = const_pointer_cast<ItemImpl>(shared_from_this());322 auto This = const_pointer_cast<ItemImpl>(shared_from_this());
323 return MultiItemListJobImpl::make_job(This, method, reply, validate, fetch_next);323 return MultiItemListJobImpl::make_job(This, method, reply, validate, fetch_next);
324}324}
325325
326ItemListJob* ItemImpl::lookup(QString const& name) const326ItemListJob* ItemImpl::lookup(QString const& name, QStringList const& keys) const
327{327{
328 QString const method = "Item::lookup()";328 QString const method = "Item::lookup()";
329329
@@ -342,12 +342,12 @@
342 {342 {
343 };343 };
344344
345 auto reply = account_impl_->provider()->Lookup(md_.item_id, name);345 auto reply = account_impl_->provider()->Lookup(md_.item_id, name, keys);
346 auto This = const_pointer_cast<ItemImpl>(shared_from_this());346 auto This = const_pointer_cast<ItemImpl>(shared_from_this());
347 return ItemListJobImpl::make_job(This, method, reply, validate);347 return ItemListJobImpl::make_job(This, method, reply, validate);
348}348}
349349
350ItemJob* ItemImpl::createFolder(QString const& name) const350ItemJob* ItemImpl::createFolder(QString const& name, QStringList const& keys) const
351{351{
352 QString const method = "Item::createFolder()";352 QString const method = "Item::createFolder()";
353353
@@ -373,7 +373,7 @@
373 throw StorageErrorImpl::local_comms_error(msg);373 throw StorageErrorImpl::local_comms_error(msg);
374 };374 };
375375
376 auto reply = account_impl_->provider()->CreateFolder(md_.item_id, name);376 auto reply = account_impl_->provider()->CreateFolder(md_.item_id, name, keys);
377 auto This = const_pointer_cast<ItemImpl>(shared_from_this());377 auto This = const_pointer_cast<ItemImpl>(shared_from_this());
378 return ItemJobImpl::make_job(This, method, reply, validate);378 return ItemJobImpl::make_job(This, method, reply, validate);
379}379}
@@ -381,7 +381,8 @@
381Uploader* ItemImpl::createFile(QString const& name,381Uploader* ItemImpl::createFile(QString const& name,
382 Item::ConflictPolicy policy,382 Item::ConflictPolicy policy,
383 qint64 sizeInBytes,383 qint64 sizeInBytes,
384 QString const& contentType) const384 QString const& contentType,
385 QStringList const& keys) const
385{386{
386 QString const method = "Item::createFile()";387 QString const method = "Item::createFile()";
387388
@@ -418,7 +419,8 @@
418 };419 };
419420
420 bool allow_overwrite = policy == Item::ConflictPolicy::Overwrite;421 bool allow_overwrite = policy == Item::ConflictPolicy::Overwrite;
421 auto reply = account_impl_->provider()->CreateFile(md_.item_id, name, sizeInBytes, contentType, allow_overwrite);422 auto reply = account_impl_->provider()->CreateFile(md_.item_id, name, sizeInBytes,
423 contentType, allow_overwrite, keys);
422 auto This = const_pointer_cast<ItemImpl>(shared_from_this());424 auto This = const_pointer_cast<ItemImpl>(shared_from_this());
423 return UploaderImpl::make_job(This, method, reply, validate, policy, sizeInBytes);425 return UploaderImpl::make_job(This, method, reply, validate, policy, sizeInBytes);
424}426}
425427
=== modified file 'tests/provider-ProviderInterface/ProviderInterface_test.cpp'
--- tests/provider-ProviderInterface/ProviderInterface_test.cpp 2016-09-28 04:37:14 +0000
+++ tests/provider-ProviderInterface/ProviderInterface_test.cpp 2016-11-02 04:28:58 +0000
@@ -85,7 +85,7 @@
85{85{
86 set_provider(unique_ptr<ProviderBase>(new TestProvider));86 set_provider(unique_ptr<ProviderBase>(new TestProvider));
8787
88 auto reply = client_->Roots();88 auto reply = client_->Roots(QList<QString>());
89 wait_for(reply);89 wait_for(reply);
90 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();90 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
91 EXPECT_EQ(1, reply.value().size());91 EXPECT_EQ(1, reply.value().size());
@@ -101,7 +101,7 @@
101{101{
102 set_provider(unique_ptr<ProviderBase>(new TestProvider));102 set_provider(unique_ptr<ProviderBase>(new TestProvider));
103103
104 auto reply = client_->List("root_id", "");104 auto reply = client_->List("root_id", "", QList<QString>());
105 wait_for(reply);105 wait_for(reply);
106 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();106 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
107 auto items = reply.argumentAt<0>();107 auto items = reply.argumentAt<0>();
@@ -111,7 +111,7 @@
111 EXPECT_EQ("child2_id", items[1].item_id);111 EXPECT_EQ("child2_id", items[1].item_id);
112 EXPECT_EQ("page_token", page_token);112 EXPECT_EQ("page_token", page_token);
113113
114 reply = client_->List("root_id", page_token);114 reply = client_->List("root_id", page_token, QList<QString>());
115 wait_for(reply);115 wait_for(reply);
116 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();116 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
117 items = reply.argumentAt<0>();117 items = reply.argumentAt<0>();
@@ -122,13 +122,13 @@
122 EXPECT_EQ("", page_token);122 EXPECT_EQ("", page_token);
123123
124 // Try a bad page token124 // Try a bad page token
125 reply = client_->List("root_id", "bad_page_token");125 reply = client_->List("root_id", "bad_page_token", QList<QString>());
126 wait_for(reply);126 wait_for(reply);
127 EXPECT_TRUE(reply.isError());127 EXPECT_TRUE(reply.isError());
128 EXPECT_EQ(PROVIDER_ERROR + "LogicException", reply.error().name()) << reply.error().name().toStdString();128 EXPECT_EQ(PROVIDER_ERROR + "LogicException", reply.error().name()) << reply.error().name().toStdString();
129 EXPECT_EQ("Unknown page token", reply.error().message()) << reply.error().message().toStdString();129 EXPECT_EQ("Unknown page token", reply.error().message()) << reply.error().message().toStdString();
130130
131 reply = client_->List("no_such_folder_id", "");131 reply = client_->List("no_such_folder_id", "", QList<QString>());
132 wait_for(reply);132 wait_for(reply);
133 EXPECT_TRUE(reply.isError());133 EXPECT_TRUE(reply.isError());
134 EXPECT_EQ(PROVIDER_ERROR + "NotExistsException", reply.error().name());134 EXPECT_EQ(PROVIDER_ERROR + "NotExistsException", reply.error().name());
@@ -139,7 +139,7 @@
139{139{
140 set_provider(unique_ptr<ProviderBase>(new TestProvider));140 set_provider(unique_ptr<ProviderBase>(new TestProvider));
141141
142 auto reply = client_->Lookup("root_id", "Filename");142 auto reply = client_->Lookup("root_id", "Filename", QList<QString>());
143 wait_for(reply);143 wait_for(reply);
144 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();144 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
145 auto items = reply.value();145 auto items = reply.value();
@@ -155,7 +155,7 @@
155{155{
156 set_provider(unique_ptr<ProviderBase>(new TestProvider));156 set_provider(unique_ptr<ProviderBase>(new TestProvider));
157157
158 auto reply = client_->Metadata("root_id");158 auto reply = client_->Metadata("root_id", QList<QString>());
159 wait_for(reply);159 wait_for(reply);
160 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();160 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
161 auto item = reply.value();161 auto item = reply.value();
@@ -169,7 +169,7 @@
169{169{
170 set_provider(unique_ptr<ProviderBase>(new TestProvider));170 set_provider(unique_ptr<ProviderBase>(new TestProvider));
171171
172 auto reply = client_->CreateFolder("root_id", "New Folder");172 auto reply = client_->CreateFolder("root_id", "New Folder", QList<QString>());
173 wait_for(reply);173 wait_for(reply);
174 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();174 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
175 auto item = reply.value();175 auto item = reply.value();
@@ -186,7 +186,8 @@
186 QString upload_id;186 QString upload_id;
187 QDBusUnixFileDescriptor socket;187 QDBusUnixFileDescriptor socket;
188 {188 {
189 auto reply = client_->CreateFile("parent_id", "file name", file_contents.size(), "text/plain", false);189 auto reply = client_->CreateFile("parent_id", "file name", file_contents.size(),
190 "text/plain", false, QList<QString>());
190 wait_for(reply);191 wait_for(reply);
191 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();192 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
192 upload_id = reply.argumentAt<0>();193 upload_id = reply.argumentAt<0>();
@@ -235,7 +236,7 @@
235 QString upload_id;236 QString upload_id;
236 QDBusUnixFileDescriptor socket;237 QDBusUnixFileDescriptor socket;
237 {238 {
238 auto reply = client_->Update("item_id", file_contents.size(), "old_etag");239 auto reply = client_->Update("item_id", file_contents.size(), "old_etag", QList<QString>());
239 wait_for(reply);240 wait_for(reply);
240 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();241 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
241 upload_id = reply.argumentAt<0>();242 upload_id = reply.argumentAt<0>();
@@ -282,7 +283,7 @@
282 QString upload_id;283 QString upload_id;
283 QDBusUnixFileDescriptor socket;284 QDBusUnixFileDescriptor socket;
284 {285 {
285 auto reply = client_->Update("item_id", 100, "old_etag");286 auto reply = client_->Update("item_id", 100, "old_etag", QList<QString>());
286 wait_for(reply);287 wait_for(reply);
287 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();288 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
288 upload_id = reply.argumentAt<0>();289 upload_id = reply.argumentAt<0>();
@@ -305,7 +306,7 @@
305 QString upload_id;306 QString upload_id;
306 QDBusUnixFileDescriptor socket;307 QDBusUnixFileDescriptor socket;
307 {308 {
308 auto reply = client_->Update("item_id", file_contents.size() - 5, "old_etag");309 auto reply = client_->Update("item_id", file_contents.size() - 5, "old_etag", QList<QString>());
309 wait_for(reply);310 wait_for(reply);
310 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();311 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
311 upload_id = reply.argumentAt<0>();312 upload_id = reply.argumentAt<0>();
@@ -352,7 +353,7 @@
352 QString upload_id;353 QString upload_id;
353 QDBusUnixFileDescriptor socket;354 QDBusUnixFileDescriptor socket;
354 {355 {
355 auto reply = client_->Update("item_id", 100, "old_etag");356 auto reply = client_->Update("item_id", 100, "old_etag", QList<QString>());
356 wait_for(reply);357 wait_for(reply);
357 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();358 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
358 upload_id = reply.argumentAt<0>();359 upload_id = reply.argumentAt<0>();
@@ -372,7 +373,7 @@
372 QString upload_id;373 QString upload_id;
373 QDBusUnixFileDescriptor socket;374 QDBusUnixFileDescriptor socket;
374 {375 {
375 auto reply = client_->Update("item_id", 100, "old_etag");376 auto reply = client_->Update("item_id", 100, "old_etag", QList<QString>());
376 wait_for(reply);377 wait_for(reply);
377 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();378 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
378 upload_id = reply.argumentAt<0>();379 upload_id = reply.argumentAt<0>();
@@ -387,7 +388,7 @@
387{388{
388 set_provider(unique_ptr<ProviderBase>(new TestProvider));389 set_provider(unique_ptr<ProviderBase>(new TestProvider));
389390
390 auto upload_reply = client_->Update("item_id", 100, "old_etag");391 auto upload_reply = client_->Update("item_id", 100, "old_etag", QList<QString>());
391 wait_for(upload_reply);392 wait_for(upload_reply);
392 ASSERT_TRUE(upload_reply.isValid()) << upload_reply.error().message().toStdString();393 ASSERT_TRUE(upload_reply.isValid()) << upload_reply.error().message().toStdString();
393 auto upload_id = upload_reply.argumentAt<0>();394 auto upload_id = upload_reply.argumentAt<0>();
@@ -419,7 +420,7 @@
419 QDBusConnection::disconnectFromBus(SECOND_CONNECTION_NAME);420 QDBusConnection::disconnectFromBus(SECOND_CONNECTION_NAME);
420 service_watcher.addWatchedService(connection2.baseService());421 service_watcher.addWatchedService(connection2.baseService());
421 ProviderClient client2(bus_name(), object_path(), connection2);422 ProviderClient client2(bus_name(), object_path(), connection2);
422 auto reply = client2.Update("item_id", 100, "old_etag");423 auto reply = client2.Update("item_id", 100, "old_etag", QList<QString>());
423 wait_for(reply);424 wait_for(reply);
424 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();425 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
425 // Store socket so it will remain open past the closing of the426 // Store socket so it will remain open past the closing of the
@@ -457,7 +458,7 @@
457{458{
458 set_provider(unique_ptr<ProviderBase>(new TestProvider));459 set_provider(unique_ptr<ProviderBase>(new TestProvider));
459460
460 auto upload_reply = client_->Update("item_id", 100, "old_etag");461 auto upload_reply = client_->Update("item_id", 100, "old_etag", QList<QString>());
461 wait_for(upload_reply);462 wait_for(upload_reply);
462 ASSERT_TRUE(upload_reply.isValid()) << upload_reply.error().message().toStdString();463 ASSERT_TRUE(upload_reply.isValid()) << upload_reply.error().message().toStdString();
463 auto upload_id = upload_reply.argumentAt<0>();464 auto upload_id = upload_reply.argumentAt<0>();
@@ -480,7 +481,7 @@
480 QString upload_id;481 QString upload_id;
481 QDBusUnixFileDescriptor socket;482 QDBusUnixFileDescriptor socket;
482 {483 {
483 auto reply = client_->Update("tempfile_item_id", file_contents.size(), "old_etag");484 auto reply = client_->Update("tempfile_item_id", file_contents.size(), "old_etag", QList<QString>());
484 wait_for(reply);485 wait_for(reply);
485 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();486 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
486 upload_id = reply.argumentAt<0>();487 upload_id = reply.argumentAt<0>();
@@ -527,7 +528,7 @@
527 QString upload_id;528 QString upload_id;
528 QDBusUnixFileDescriptor socket;529 QDBusUnixFileDescriptor socket;
529 {530 {
530 auto reply = client_->Update("tempfile_item_id", 100, "old_etag");531 auto reply = client_->Update("tempfile_item_id", 100, "old_etag", QList<QString>());
531 wait_for(reply);532 wait_for(reply);
532 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();533 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
533 upload_id = reply.argumentAt<0>();534 upload_id = reply.argumentAt<0>();
@@ -550,7 +551,7 @@
550 QString upload_id;551 QString upload_id;
551 QDBusUnixFileDescriptor socket;552 QDBusUnixFileDescriptor socket;
552 {553 {
553 auto reply = client_->Update("tempfile_item_id", file_contents.size() - 5, "old_etag");554 auto reply = client_->Update("tempfile_item_id", file_contents.size() - 5, "old_etag", QList<QString>());
554 wait_for(reply);555 wait_for(reply);
555 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();556 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
556 upload_id = reply.argumentAt<0>();557 upload_id = reply.argumentAt<0>();
@@ -597,7 +598,7 @@
597 QString upload_id;598 QString upload_id;
598 QDBusUnixFileDescriptor socket;599 QDBusUnixFileDescriptor socket;
599 {600 {
600 auto reply = client_->Update("tempfile_item_id", 100, "old_etag");601 auto reply = client_->Update("tempfile_item_id", 100, "old_etag", QList<QString>());
601 wait_for(reply);602 wait_for(reply);
602 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();603 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
603 upload_id = reply.argumentAt<0>();604 upload_id = reply.argumentAt<0>();
@@ -756,7 +757,7 @@
756{757{
757 set_provider(unique_ptr<ProviderBase>(new TestProvider));758 set_provider(unique_ptr<ProviderBase>(new TestProvider));
758759
759 auto reply = client_->Move("child_id", "new_parent_id", "New name");760 auto reply = client_->Move("child_id", "new_parent_id", "New name", QList<QString>());
760 wait_for(reply);761 wait_for(reply);
761 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();762 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
762 auto item = reply.value();763 auto item = reply.value();
@@ -770,7 +771,7 @@
770{771{
771 set_provider(unique_ptr<ProviderBase>(new TestProvider));772 set_provider(unique_ptr<ProviderBase>(new TestProvider));
772773
773 auto reply = client_->Copy("child_id", "new_parent_id", "New name");774 auto reply = client_->Copy("child_id", "new_parent_id", "New name", QList<QString>());
774 wait_for(reply);775 wait_for(reply);
775 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();776 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
776 auto item = reply.value();777 auto item = reply.value();
777778
=== modified file 'tests/provider-ProviderInterface/TestProvider.cpp'
--- tests/provider-ProviderInterface/TestProvider.cpp 2016-08-24 10:52:17 +0000
+++ tests/provider-ProviderInterface/TestProvider.cpp 2016-11-02 04:28:58 +0000
@@ -283,8 +283,9 @@
283}283}
284284
285285
286boost::future<ItemList> TestProvider::roots(Context const& ctx)286boost::future<ItemList> TestProvider::roots(vector<string> const& keys, Context const& ctx)
287{287{
288 Q_UNUSED(keys);
288 Q_UNUSED(ctx);289 Q_UNUSED(ctx);
289290
290 ItemList roots = {291 ItemList roots = {
@@ -296,8 +297,9 @@
296}297}
297298
298boost::future<tuple<ItemList,string>> TestProvider::list(299boost::future<tuple<ItemList,string>> TestProvider::list(
299 string const& item_id, string const& page_token, Context const& ctx)300 string const& item_id, string const& page_token, vector<string> const& keys, Context const& ctx)
300{301{
302 Q_UNUSED(keys);
301 Q_UNUSED(ctx);303 Q_UNUSED(ctx);
302304
303 boost::promise<tuple<ItemList,string>> p;305 boost::promise<tuple<ItemList,string>> p;
@@ -330,8 +332,9 @@
330}332}
331333
332boost::future<ItemList> TestProvider::lookup(334boost::future<ItemList> TestProvider::lookup(
333 string const& parent_id, string const& name, Context const& ctx)335 string const& parent_id, string const& name, vector<string> const& keys, Context const& ctx)
334{336{
337 Q_UNUSED(keys);
335 Q_UNUSED(ctx);338 Q_UNUSED(ctx);
336339
337 boost::promise<ItemList> p;340 boost::promise<ItemList> p;
@@ -343,8 +346,9 @@
343}346}
344347
345boost::future<Item> TestProvider::metadata(348boost::future<Item> TestProvider::metadata(
346 string const& item_id, Context const& ctx)349 string const& item_id, vector<string> const& keys, Context const& ctx)
347{350{
351 Q_UNUSED(keys);
348 Q_UNUSED(ctx);352 Q_UNUSED(ctx);
349353
350 boost::promise<Item> p;354 boost::promise<Item> p;
@@ -361,8 +365,9 @@
361}365}
362366
363boost::future<Item> TestProvider::create_folder(367boost::future<Item> TestProvider::create_folder(
364 string const& parent_id, string const& name, Context const& ctx)368 string const& parent_id, string const& name, vector<string> const& keys, Context const& ctx)
365{369{
370 Q_UNUSED(keys);
366 Q_UNUSED(ctx);371 Q_UNUSED(ctx);
367372
368 boost::promise<Item> p;373 boost::promise<Item> p;
@@ -373,11 +378,12 @@
373378
374boost::future<unique_ptr<UploadJob>> TestProvider::create_file(379boost::future<unique_ptr<UploadJob>> TestProvider::create_file(
375 string const& parent_id, string const& name,380 string const& parent_id, string const& name,
376 int64_t size, string const& content_type, bool allow_overwrite,381 int64_t size, string const& content_type, bool allow_overwrite, vector<string> const& keys,
377 Context const& ctx)382 Context const& ctx)
378{383{
379 Q_UNUSED(content_type);384 Q_UNUSED(content_type);
380 Q_UNUSED(allow_overwrite);385 Q_UNUSED(allow_overwrite);
386 Q_UNUSED(keys);
381 Q_UNUSED(ctx);387 Q_UNUSED(ctx);
382388
383 boost::promise<unique_ptr<UploadJob>> p;389 boost::promise<unique_ptr<UploadJob>> p;
@@ -387,11 +393,12 @@
387}393}
388394
389boost::future<unique_ptr<UploadJob>> TestProvider::update(395boost::future<unique_ptr<UploadJob>> TestProvider::update(
390 string const& item_id, int64_t size, string const& old_etag,396 string const& item_id, int64_t size, string const& old_etag, vector<string> const& keys,
391 Context const& ctx)397 Context const& ctx)
392{398{
393 Q_UNUSED(item_id);399 Q_UNUSED(item_id);
394 Q_UNUSED(old_etag);400 Q_UNUSED(old_etag);
401 Q_UNUSED(keys);
395 Q_UNUSED(ctx);402 Q_UNUSED(ctx);
396403
397 boost::promise<unique_ptr<UploadJob>> p;404 boost::promise<unique_ptr<UploadJob>> p;
@@ -438,8 +445,9 @@
438445
439boost::future<Item> TestProvider::move(446boost::future<Item> TestProvider::move(
440 string const& item_id, string const& new_parent_id,447 string const& item_id, string const& new_parent_id,
441 string const& new_name, Context const& ctx)448 string const& new_name, vector<string> const& keys, Context const& ctx)
442{449{
450 Q_UNUSED(keys);
443 Q_UNUSED(ctx);451 Q_UNUSED(ctx);
444452
445 boost::promise<Item> p;453 boost::promise<Item> p;
@@ -450,9 +458,10 @@
450458
451boost::future<Item> TestProvider::copy(459boost::future<Item> TestProvider::copy(
452 string const& item_id, string const& new_parent_id,460 string const& item_id, string const& new_parent_id,
453 string const& new_name, Context const& ctx)461 string const& new_name, vector<string> const& keys, Context const& ctx)
454{462{
455 Q_UNUSED(item_id);463 Q_UNUSED(item_id);
464 Q_UNUSED(keys);
456 Q_UNUSED(ctx);465 Q_UNUSED(ctx);
457466
458 boost::promise<Item> p;467 boost::promise<Item> p;
459468
=== modified file 'tests/provider-ProviderInterface/TestProvider.h'
--- tests/provider-ProviderInterface/TestProvider.h 2016-08-11 05:13:00 +0000
+++ tests/provider-ProviderInterface/TestProvider.h 2016-11-02 04:28:58 +0000
@@ -30,25 +30,25 @@
3030
31class TestProvider : public ProviderBase {31class TestProvider : public ProviderBase {
32public:32public:
33 boost::future<ItemList> roots(Context const& ctx) override;33 boost::future<ItemList> roots(vector<string> const& keys, Context const& ctx) override;
34 boost::future<tuple<ItemList,string>> list(34 boost::future<tuple<ItemList,string>> list(
35 string const& item_id, string const& page_token,35 string const& item_id, string const& page_token, vector<string> const& keys,
36 Context const& ctx) override;36 Context const& ctx) override;
37 boost::future<ItemList> lookup(37 boost::future<ItemList> lookup(
38 string const& parent_id, string const& name,38 string const& parent_id, string const& name, vector<string> const& keys,
39 Context const& ctx) override;39 Context const& ctx) override;
40 boost::future<Item> metadata(40 boost::future<Item> metadata(
41 string const& item_id, Context const& ctx) override;41 string const& item_id, vector<string> const& keys, Context const& ctx) override;
42 boost::future<Item> create_folder(42 boost::future<Item> create_folder(
43 string const& parent_id, string const& name,43 string const& parent_id, string const& name, vector<string> const& keys,
44 Context const& ctx) override;44 Context const& ctx) override;
4545
46 boost::future<unique_ptr<UploadJob>> create_file(46 boost::future<unique_ptr<UploadJob>> create_file(
47 string const& parent_id, string const& name,47 string const& parent_id, string const& name,
48 int64_t size, string const& content_type, bool allow_overwrite,48 int64_t size, string const& content_type, bool allow_overwrite, vector<string> const& keys,
49 Context const& ctx) override;49 Context const& ctx) override;
50 boost::future<unique_ptr<UploadJob>> update(50 boost::future<unique_ptr<UploadJob>> update(
51 string const& item_id, int64_t size, string const& old_etag,51 string const& item_id, int64_t size, string const& old_etag, vector<string> const& keys,
52 Context const& ctx) override;52 Context const& ctx) override;
5353
54 boost::future<unique_ptr<DownloadJob>> download(54 boost::future<unique_ptr<DownloadJob>> download(
@@ -58,8 +58,8 @@
58 string const& item_id, Context const& ctx) override;58 string const& item_id, Context const& ctx) override;
59 boost::future<Item> move(59 boost::future<Item> move(
60 string const& item_id, string const& new_parent_id,60 string const& item_id, string const& new_parent_id,
61 string const& new_name, Context const& ctx) override;61 string const& new_name, vector<string> const& keys, Context const& ctx) override;
62 boost::future<Item> copy(62 boost::future<Item> copy(
63 string const& item_id, string const& new_parent_id,63 string const& item_id, string const& new_parent_id,
64 string const& new_name, Context const& ctx) override;64 string const& new_name, vector<string> const& keys, Context const& ctx) override;
65};65};
6666
=== modified file 'tests/remote-client-v1/MockProvider.cpp'
--- tests/remote-client-v1/MockProvider.cpp 2016-08-22 06:04:06 +0000
+++ tests/remote-client-v1/MockProvider.cpp 2016-11-02 04:28:58 +0000
@@ -44,7 +44,7 @@
44{44{
45}45}
4646
47boost::future<ItemList> MockProvider::roots(Context const&)47boost::future<ItemList> MockProvider::roots(vector<string> const&, Context const&)
48{48{
49 ItemList roots =49 ItemList roots =
50 {50 {
@@ -54,7 +54,7 @@
54}54}
5555
56boost::future<tuple<ItemList,string>> MockProvider::list(56boost::future<tuple<ItemList,string>> MockProvider::list(
57 string const& item_id, string const& page_token,57 string const& item_id, string const& page_token, vector<string> const&,
58 Context const&)58 Context const&)
59{59{
60 if (item_id != "root_id")60 if (item_id != "root_id")
@@ -80,7 +80,7 @@
80}80}
8181
82boost::future<ItemList> MockProvider::lookup(82boost::future<ItemList> MockProvider::lookup(
83 string const& parent_id, string const& name, Context const&)83 string const& parent_id, string const& name, vector<string> const&, Context const&)
84{84{
85 if (parent_id != "root_id")85 if (parent_id != "root_id")
86 {86 {
@@ -100,7 +100,7 @@
100 return make_ready_future<ItemList>(children);100 return make_ready_future<ItemList>(children);
101}101}
102102
103boost::future<Item> MockProvider::metadata(string const& item_id, Context const&)103boost::future<Item> MockProvider::metadata(string const& item_id, vector<string> const&, Context const&)
104{104{
105 if (item_id == "root_id")105 if (item_id == "root_id")
106 {106 {
@@ -125,7 +125,7 @@
125}125}
126126
127boost::future<Item> MockProvider::create_folder(127boost::future<Item> MockProvider::create_folder(
128 string const& parent_id, string const& name,128 string const& parent_id, string const& name, vector<string> const&,
129 Context const&)129 Context const&)
130{130{
131 Item metadata{"new_folder_id", { parent_id }, name, "etag", ItemType::folder, {}};131 Item metadata{"new_folder_id", { parent_id }, name, "etag", ItemType::folder, {}};
@@ -140,13 +140,13 @@
140140
141boost::future<unique_ptr<UploadJob>> MockProvider::create_file(141boost::future<unique_ptr<UploadJob>> MockProvider::create_file(
142 string const&, string const&,142 string const&, string const&,
143 int64_t, string const&, bool, Context const&)143 int64_t, string const&, bool, vector<string> const&, Context const&)
144{144{
145 return make_ready_future<unique_ptr<UploadJob>>(new MockUploadJob(make_job_id()));145 return make_ready_future<unique_ptr<UploadJob>>(new MockUploadJob(make_job_id()));
146}146}
147147
148boost::future<unique_ptr<UploadJob>> MockProvider::update(148boost::future<unique_ptr<UploadJob>> MockProvider::update(
149 string const&, int64_t, string const&, Context const&)149 string const&, int64_t, string const&, vector<string> const&, Context const&)
150{150{
151 return make_ready_future<unique_ptr<UploadJob>>(new MockUploadJob(make_job_id()));151 return make_ready_future<unique_ptr<UploadJob>>(new MockUploadJob(make_job_id()));
152}152}
@@ -174,7 +174,7 @@
174174
175boost::future<Item> MockProvider::move(175boost::future<Item> MockProvider::move(
176 string const& item_id, string const& new_parent_id,176 string const& item_id, string const& new_parent_id,
177 string const& new_name, Context const&)177 string const& new_name, vector<string> const&, Context const&)
178{178{
179 Item metadata{item_id, { new_parent_id }, new_name, "etag", ItemType::file, {}};179 Item metadata{item_id, { new_parent_id }, new_name, "etag", ItemType::file, {}};
180 return make_ready_future(metadata);180 return make_ready_future(metadata);
@@ -182,7 +182,7 @@
182182
183boost::future<Item> MockProvider::copy(183boost::future<Item> MockProvider::copy(
184 string const&, string const& new_parent_id,184 string const&, string const& new_parent_id,
185 string const& new_name, Context const&)185 string const& new_name, vector<string> const&, Context const&)
186{186{
187 Item metadata{"new_item_id", { new_parent_id }, new_name, "etag", ItemType::file, {}};187 Item metadata{"new_item_id", { new_parent_id }, new_name, "etag", ItemType::file, {}};
188 return make_ready_future(metadata);188 return make_ready_future(metadata);
189189
=== modified file 'tests/remote-client-v1/MockProvider.h'
--- tests/remote-client-v1/MockProvider.h 2016-08-22 04:56:44 +0000
+++ tests/remote-client-v1/MockProvider.h 2016-11-02 04:28:58 +0000
@@ -28,25 +28,27 @@
28 MockProvider();28 MockProvider();
29 MockProvider(std::string const& cmd);29 MockProvider(std::string const& cmd);
3030
31 boost::future<unity::storage::provider::ItemList> roots(unity::storage::provider::Context const& ctx) override;31 boost::future<unity::storage::provider::ItemList> roots(std::vector<std::string> const& keys,
32 unity::storage::provider::Context const& ctx) override;
32 boost::future<std::tuple<unity::storage::provider::ItemList, std::string>> list(33 boost::future<std::tuple<unity::storage::provider::ItemList, std::string>> list(
33 std::string const& item_id, std::string const& page_token,34 std::string const& item_id, std::string const& page_token, std::vector<std::string> const& keys,
34 unity::storage::provider::Context const& ctx) override;35 unity::storage::provider::Context const& ctx) override;
35 boost::future<unity::storage::provider::ItemList> lookup(36 boost::future<unity::storage::provider::ItemList> lookup(
36 std::string const& parent_id, std::string const& name,37 std::string const& parent_id, std::string const& name, std::vector<std::string> const& keys,
37 unity::storage::provider::Context const& ctx) override;38 unity::storage::provider::Context const& ctx) override;
38 boost::future<unity::storage::provider::Item> metadata(39 boost::future<unity::storage::provider::Item> metadata(
39 std::string const& item_id, unity::storage::provider::Context const& ctx) override;40 std::string const& item_id, std::vector<std::string> const& keys,
41 unity::storage::provider::Context const& ctx) override;
40 boost::future<unity::storage::provider::Item> create_folder(42 boost::future<unity::storage::provider::Item> create_folder(
41 std::string const& parent_id, std::string const& name,43 std::string const& parent_id, std::string const& name, std::vector<std::string> const& keys,
42 unity::storage::provider::Context const& ctx) override;44 unity::storage::provider::Context const& ctx) override;
4345
44 boost::future<std::unique_ptr<unity::storage::provider::UploadJob>> create_file(46 boost::future<std::unique_ptr<unity::storage::provider::UploadJob>> create_file(
45 std::string const& parent_id, std::string const& name,47 std::string const& parent_id, std::string const& name,
46 int64_t size, std::string const& content_type, bool allow_overwrite,48 int64_t size, std::string const& content_type, bool allow_overwrite, std::vector<std::string> const& keys,
47 unity::storage::provider::Context const& ctx) override;49 unity::storage::provider::Context const& ctx) override;
48 boost::future<std::unique_ptr<unity::storage::provider::UploadJob>> update(50 boost::future<std::unique_ptr<unity::storage::provider::UploadJob>> update(
49 std::string const& item_id, int64_t size, std::string const& old_etag,51 std::string const& item_id, int64_t size, std::string const& old_etag, std::vector<std::string> const& keys,
50 unity::storage::provider::Context const& ctx) override;52 unity::storage::provider::Context const& ctx) override;
5153
52 boost::future<std::unique_ptr<unity::storage::provider::DownloadJob>> download(54 boost::future<std::unique_ptr<unity::storage::provider::DownloadJob>> download(
@@ -56,10 +58,12 @@
56 std::string const& item_id, unity::storage::provider::Context const& ctx) override;58 std::string const& item_id, unity::storage::provider::Context const& ctx) override;
57 boost::future<unity::storage::provider::Item> move(59 boost::future<unity::storage::provider::Item> move(
58 std::string const& item_id, std::string const& new_parent_id,60 std::string const& item_id, std::string const& new_parent_id,
59 std::string const& new_name, unity::storage::provider::Context const& ctx) override;61 std::string const& new_name, std::vector<std::string> const& keys,
62 unity::storage::provider::Context const& ctx) override;
60 boost::future<unity::storage::provider::Item> copy(63 boost::future<unity::storage::provider::Item> copy(
61 std::string const& item_id, std::string const& new_parent_id,64 std::string const& item_id, std::string const& new_parent_id,
62 std::string const& new_name, unity::storage::provider::Context const& ctx) override;65 std::string const& new_name, std::vector<std::string> const& keys,
66 unity::storage::provider::Context const& ctx) override;
6367
64private:68private:
65 std::string cmd_;69 std::string cmd_;
6670
=== modified file 'tests/remote-client/MockProvider.cpp'
--- tests/remote-client/MockProvider.cpp 2016-10-17 12:40:31 +0000
+++ tests/remote-client/MockProvider.cpp 2016-11-02 04:28:58 +0000
@@ -44,7 +44,7 @@
44{44{
45}45}
4646
47boost::future<ItemList> MockProvider::roots(Context const&)47boost::future<ItemList> MockProvider::roots(vector<string> const& keys, Context const&)
48{48{
49 if (cmd_ == "roots_slow")49 if (cmd_ == "roots_slow")
50 {50 {
@@ -72,7 +72,7 @@
72}72}
7373
74boost::future<tuple<ItemList,string>> MockProvider::list(74boost::future<tuple<ItemList,string>> MockProvider::list(
75 string const& item_id, string const& page_token,75 string const& item_id, string const& page_token, vector<string> const& keys,
76 Context const&)76 Context const&)
77{77{
78 if (cmd_ == "list_slow")78 if (cmd_ == "list_slow")
@@ -156,7 +156,7 @@
156}156}
157157
158boost::future<ItemList> MockProvider::lookup(158boost::future<ItemList> MockProvider::lookup(
159 string const& parent_id, string const& name, Context const&)159 string const& parent_id, string const& name, vector<string> const& keys, Context const&)
160{160{
161 if (parent_id != "root_id")161 if (parent_id != "root_id")
162 {162 {
@@ -176,7 +176,7 @@
176 return make_ready_future<ItemList>(children);176 return make_ready_future<ItemList>(children);
177}177}
178178
179boost::future<Item> MockProvider::metadata(string const& item_id, Context const&)179boost::future<Item> MockProvider::metadata(string const& item_id, vector<string> const& keys, Context const&)
180{180{
181 static int num_calls = 0;181 static int num_calls = 0;
182182
@@ -246,7 +246,7 @@
246}246}
247247
248boost::future<Item> MockProvider::create_folder(248boost::future<Item> MockProvider::create_folder(
249 string const& parent_id, string const& name,249 string const& parent_id, string const& name, vector<string> const& keys,
250 Context const&)250 Context const&)
251{251{
252 if (cmd_ == "create_folder_returns_file")252 if (cmd_ == "create_folder_returns_file")
@@ -260,13 +260,13 @@
260260
261boost::future<unique_ptr<UploadJob>> MockProvider::create_file(261boost::future<unique_ptr<UploadJob>> MockProvider::create_file(
262 string const&, string const&,262 string const&, string const&,
263 int64_t, string const&, bool, Context const&)263 int64_t, string const&, bool, vector<string> const&, Context const&)
264{264{
265 return make_ready_future<unique_ptr<UploadJob>>(new MockUploadJob(cmd_));265 return make_ready_future<unique_ptr<UploadJob>>(new MockUploadJob(cmd_));
266}266}
267267
268boost::future<unique_ptr<UploadJob>> MockProvider::update(268boost::future<unique_ptr<UploadJob>> MockProvider::update(
269 string const&, int64_t, string const&, Context const&)269 string const&, int64_t, string const&, vector<string> const&, Context const&)
270{270{
271 if (cmd_ == "upload_slow")271 if (cmd_ == "upload_slow")
272 {272 {
@@ -328,7 +328,7 @@
328328
329boost::future<Item> MockProvider::move(329boost::future<Item> MockProvider::move(
330 string const& item_id, string const& new_parent_id,330 string const& item_id, string const& new_parent_id,
331 string const& new_name, Context const&)331 string const& new_name, vector<string> const& keys, Context const&)
332{332{
333 if (cmd_ == "move_returns_root")333 if (cmd_ == "move_returns_root")
334 {334 {
@@ -358,7 +358,7 @@
358358
359boost::future<Item> MockProvider::copy(359boost::future<Item> MockProvider::copy(
360 string const&, string const& new_parent_id,360 string const&, string const& new_parent_id,
361 string const& new_name, Context const&)361 string const& new_name, vector<string> const& keys, Context const&)
362{362{
363 if (cmd_ == "copy_type_mismatch")363 if (cmd_ == "copy_type_mismatch")
364 {364 {
365365
=== modified file 'tests/remote-client/MockProvider.h'
--- tests/remote-client/MockProvider.h 2016-09-08 08:33:59 +0000
+++ tests/remote-client/MockProvider.h 2016-11-02 04:28:58 +0000
@@ -28,25 +28,27 @@
28 MockProvider();28 MockProvider();
29 MockProvider(std::string const& cmd);29 MockProvider(std::string const& cmd);
3030
31 boost::future<unity::storage::provider::ItemList> roots(unity::storage::provider::Context const& ctx) override;31 boost::future<unity::storage::provider::ItemList> roots(std::vector<std::string> const& keys,
32 unity::storage::provider::Context const& ctx) override;
32 boost::future<std::tuple<unity::storage::provider::ItemList, std::string>> list(33 boost::future<std::tuple<unity::storage::provider::ItemList, std::string>> list(
33 std::string const& item_id, std::string const& page_token,34 std::string const& item_id, std::string const& page_token, std::vector<std::string> const& keys,
34 unity::storage::provider::Context const& ctx) override;35 unity::storage::provider::Context const& ctx) override;
35 boost::future<unity::storage::provider::ItemList> lookup(36 boost::future<unity::storage::provider::ItemList> lookup(
36 std::string const& parent_id, std::string const& name,37 std::string const& parent_id, std::string const& name, std::vector<std::string> const& keys,
37 unity::storage::provider::Context const& ctx) override;38 unity::storage::provider::Context const& ctx) override;
38 boost::future<unity::storage::provider::Item> metadata(39 boost::future<unity::storage::provider::Item> metadata(
39 std::string const& item_id, unity::storage::provider::Context const& ctx) override;40 std::string const& item_id, std::vector<std::string> const& keys,
41 unity::storage::provider::Context const& ctx) override;
40 boost::future<unity::storage::provider::Item> create_folder(42 boost::future<unity::storage::provider::Item> create_folder(
41 std::string const& parent_id, std::string const& name,43 std::string const& parent_id, std::string const& name, std::vector<std::string> const& keys,
42 unity::storage::provider::Context const& ctx) override;44 unity::storage::provider::Context const& ctx) override;
4345
44 boost::future<std::unique_ptr<unity::storage::provider::UploadJob>> create_file(46 boost::future<std::unique_ptr<unity::storage::provider::UploadJob>> create_file(
45 std::string const& parent_id, std::string const& name,47 std::string const& parent_id, std::string const& name,
46 int64_t size, std::string const& content_type, bool allow_overwrite,48 int64_t size, std::string const& content_type, bool allow_overwrite, std::vector<std::string> const& keys,
47 unity::storage::provider::Context const& ctx) override;49 unity::storage::provider::Context const& ctx) override;
48 boost::future<std::unique_ptr<unity::storage::provider::UploadJob>> update(50 boost::future<std::unique_ptr<unity::storage::provider::UploadJob>> update(
49 std::string const& item_id, int64_t size, std::string const& old_etag,51 std::string const& item_id, int64_t size, std::string const& old_etag, std::vector<std::string> const& keys,
50 unity::storage::provider::Context const& ctx) override;52 unity::storage::provider::Context const& ctx) override;
5153
52 boost::future<std::unique_ptr<unity::storage::provider::DownloadJob>> download(54 boost::future<std::unique_ptr<unity::storage::provider::DownloadJob>> download(
@@ -56,10 +58,12 @@
56 std::string const& item_id, unity::storage::provider::Context const& ctx) override;58 std::string const& item_id, unity::storage::provider::Context const& ctx) override;
57 boost::future<unity::storage::provider::Item> move(59 boost::future<unity::storage::provider::Item> move(
58 std::string const& item_id, std::string const& new_parent_id,60 std::string const& item_id, std::string const& new_parent_id,
59 std::string const& new_name, unity::storage::provider::Context const& ctx) override;61 std::string const& new_name, std::vector<std::string> const& keys,
62 unity::storage::provider::Context const& ctx) override;
60 boost::future<unity::storage::provider::Item> copy(63 boost::future<unity::storage::provider::Item> copy(
61 std::string const& item_id, std::string const& new_parent_id,64 std::string const& item_id, std::string const& new_parent_id,
62 std::string const& new_name, unity::storage::provider::Context const& ctx) override;65 std::string const& new_name, std::vector<std::string> const& keys,
66 unity::storage::provider::Context const& ctx) override;
6367
64private:68private:
65 std::string cmd_;69 std::string cmd_;

Subscribers

People subscribed via source and target branches

to all changes: