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
1=== modified file 'data/provider.xml'
2--- data/provider.xml 2016-08-11 01:56:11 +0000
3+++ data/provider.xml 2016-11-02 04:28:58 +0000
4@@ -16,11 +16,21 @@
5
6 Note that parent_ids is a sequence of IDs instead of a single ID to allow the client to
7 navigate items in Google Drive, which permits more than one parent for a file or folder.
8+
9+ The metadata_keys parameter allows the caller to select which metadata values should be returned
10+ for an item. If the list is empty, the provider will return a "reasonable" default set of metadata
11+ values. (Note that this may not be the same set for each provider.) If the caller specifies one or
12+ more keys, the provider will return the requested values. Note that not all providers may support
13+ all values, so some of the requested values may be missing. Also, providers are free to return
14+ additional values that were not requested.
15+ Passing a single-element list with the value "__ALL__" indicates that the provider should return
16+ all available metadata.
17 -->
18 <interface name="com.canonical.StorageFramework.Provider">
19 <!--
20 Roots:
21 @short_description: Get the list of roots for the storage account
22+ @metadata_keys: what metadata to return for the roots
23 @roots: Returned list of roots.
24
25 Returns the list of top level root items provided by the
26@@ -28,6 +38,7 @@
27 of files, this list will contain a single item.
28 -->
29 <method name="Roots">
30+ <arg type="as" name="metadata_keys" direction="in"/>
31 <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;"/>
33 </method>
34@@ -37,6 +48,7 @@
35 @short_description: list the children of the given folder
36 @item_id: the ID identifying the folder
37 @page_token: if not empty, return the page of results identified by this token.
38+ @metadata_keys: what metadata to return for the children
39 @children: returned list of children
40 @next_token: if not empty, a token that can be used to request more results.
41
42@@ -48,6 +60,7 @@
43 <method name="List">
44 <arg type="s" name="item_id" direction="in"/>
45 <arg type="s" name="page_token" direction="in"/>
46+ <arg type="as" name="metadata_keys" direction="in"/>
47 <arg type="a(sasssia{sv})" name="children" direction="out"/>
48 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList&lt;unity::storage::internal::ItemMetadata&gt;"/>
49 <arg type="s" name="next_token" direction="out"/>
50@@ -58,11 +71,13 @@
51 @short_description: lookup a child in a folder by name
52 @parent_id: the ID of the parent folder
53 @name: the name of the child
54+ @metadata_keys: what metadata to return for the item(s)
55 @items: the matching items in the folder
56 -->
57 <method name="Lookup">
58 <arg type="s" name="parent_id" direction="in"/>
59 <arg type="s" name="name" direction="in"/>
60+ <arg type="as" name="metadata_keys" direction="in"/>
61 <arg type="a(sasssia{sv})" name="items" direction="out"/>
62 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList&lt;unity::storage::internal::ItemMetadata&gt;"/>
63 </method>
64@@ -71,10 +86,12 @@
65 Metadata:
66 @short_description: get metadata for an item
67 @item_id: the ID of the item
68+ @metadata_keys: what metadata to return for the item
69 @metadata: the item metadata
70 -->
71 <method name="Metadata">
72 <arg type="s" name="item_id" direction="in"/>
73+ <arg type="as" name="metadata_keys" direction="in"/>
74 <arg type="(sasssia{sv})" name="metadata" direction="out"/>
75 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="unity::storage::internal::ItemMetadata"/>
76 </method>
77@@ -84,11 +101,13 @@
78 @short_description: create a new folder
79 @parent_id: the ID of the parent folder
80 @name: the name of the new folder
81+ @metadata_keys: what metadata to return for the new folder
82 @metadata: the metadata for the new folder
83 -->
84 <method name="CreateFolder">
85 <arg type="s" name="parent_id" direction="in"/>
86 <arg type="s" name="name" direction="in"/>
87+ <arg type="as" name="metadata_keys" direction="in"/>
88 <arg type="(sasssia{sv})" name="metadata" direction="out"/>
89 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="unity::storage::internal::ItemMetadata"/>
90 </method>
91@@ -102,6 +121,7 @@
92 @content_type: the content type of the new file
93 @allow_overwrite: if false, the file creation will fail if it
94 would overwrite an existing file.
95+ @metadata_keys: what metadata to return for the new file
96 @upload_id: the identifier for this upload job
97 @file_descriptor: a file descriptor to write the file contents to
98
99@@ -116,6 +136,7 @@
100 <arg type="x" name="size" direction="in"/>
101 <arg type="s" name="content_type" direction="in"/>
102 <arg type="b" name="allow_overwrite" direction="in"/>
103+ <arg type="as" name="metadata_keys" direction="in"/>
104 <arg type="s" name="upload_id" direction="out"/>
105 <arg type="h" name="file_descriptor" direction="out"/>
106 </method>
107@@ -127,6 +148,7 @@
108 @size: the size of the upload
109 @old_etag: if not empty, the expected etag of the old version
110 of the file.
111+ @metadata_keys: what metadata to return for the updated file
112 @upload_id: the identifier for this upload job
113 @file_descriptor: a file descriptor to write the file contents to
114
115@@ -144,6 +166,7 @@
116 <arg type="s" name="item_id" direction="in"/>
117 <arg type="x" name="size" direction="in"/>
118 <arg type="s" name="old_etag" direction="in"/>
119+ <arg type="as" name="metadata_keys" direction="in"/>
120 <arg type="s" name="upload_id" direction="out"/>
121 <arg type="h" name="file_descriptor" direction="out"/>
122 </method>
123@@ -233,12 +256,14 @@
124 @item_id: the ID for the item
125 @new_parent_id: the ID for the new parent folder
126 @new_name: the new name for the item
127+ @metadata_keys: what metadata to return for the moved item
128 @metadata: the metadata for the file in the new location
129 -->
130 <method name="Move">
131 <arg type="s" name="item_id" direction="in"/>
132 <arg type="s" name="new_parent_id" direction="in"/>
133 <arg type="s" name="new_name" direction="in"/>
134+ <arg type="as" name="metadata_keys" direction="in"/>
135 <arg type="(ssssia{sv})" name="metadata" direction="out"/>
136 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="unity::storage::internal::ItemMetadata"/>
137 </method>
138@@ -249,12 +274,14 @@
139 @item_id: the ID for the item
140 @new_parent_id: the ID for the new parent folder
141 @new_name: the new name for the item
142+ @metadata_keys: what metadata to return for the copied item
143 @metadata: the metadata for the file in the new location
144 -->
145 <method name="Copy">
146 <arg type="s" name="item_id" direction="in"/>
147 <arg type="s" name="new_parent_id" direction="in"/>
148 <arg type="s" name="new_name" direction="in"/>
149+ <arg type="as" name="metadata_keys" direction="in"/>
150 <arg type="(ssssia{sv})" name="metadata" direction="out"/>
151 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="unity::storage::internal::ItemMetadata"/>
152 </method>
153
154=== modified file 'demo/provider_test/provider-test.cpp'
155--- demo/provider_test/provider-test.cpp 2016-09-03 00:53:43 +0000
156+++ demo/provider_test/provider-test.cpp 2016-11-02 04:28:58 +0000
157@@ -42,25 +42,25 @@
158 public:
159 MyProvider();
160
161- boost::future<ItemList> roots(Context const& ctx) override;
162+ boost::future<ItemList> roots(vector<string> const& keys, Context const& ctx) override;
163 boost::future<tuple<ItemList,string>> list(
164- string const& item_id, string const& page_token,
165+ string const& item_id, string const& page_token, vector<string> const& keys,
166 Context const& ctx) override;
167 boost::future<ItemList> lookup(
168- string const& parent_id, string const& name,
169+ string const& parent_id, string const& name, vector<string> const& keys,
170 Context const& ctx) override;
171 boost::future<Item> metadata(
172- string const& item_id, Context const& ctx) override;
173+ string const& item_id, vector<string> const& keys, Context const& ctx) override;
174 boost::future<Item> create_folder(
175- string const& parent_id, string const& name,
176+ string const& parent_id, string const& name, vector<string> const& keys,
177 Context const& ctx) override;
178
179 boost::future<unique_ptr<UploadJob>> create_file(
180 string const& parent_id, string const& name,
181- int64_t size, string const& content_type, bool allow_overwrite,
182+ int64_t size, string const& content_type, bool allow_overwrite, vector<string> const& keys,
183 Context const& ctx) override;
184 boost::future<unique_ptr<UploadJob>> update(
185- string const& item_id, int64_t size, string const& old_etag,
186+ string const& item_id, int64_t size, string const& old_etag, vector<string> const& keys,
187 Context const& ctx) override;
188
189 boost::future<unique_ptr<DownloadJob>> download(
190@@ -70,10 +70,10 @@
191 string const& item_id, Context const& ctx) override;
192 boost::future<Item> move(
193 string const& item_id, string const& new_parent_id,
194- string const& new_name, Context const& ctx) override;
195+ string const& new_name, vector<string> const& keys, Context const& ctx) override;
196 boost::future<Item> copy(
197 string const& item_id, string const& new_parent_id,
198- string const& new_name, Context const& ctx) override;
199+ string const& new_name, vector<string> const& keys, Context const& ctx) override;
200 };
201
202 class MyUploadJob : public TempfileUploadJob
203@@ -98,7 +98,7 @@
204 {
205 }
206
207-boost::future<ItemList> MyProvider::roots(Context const& ctx)
208+boost::future<ItemList> MyProvider::roots(vector<string> const& keys, Context const& ctx)
209 {
210 printf("roots() called by %s (%d)\n", ctx.security_label.c_str(), ctx.pid);
211 fflush(stdout);
212@@ -109,7 +109,7 @@
213 }
214
215 boost::future<tuple<ItemList,string>> MyProvider::list(
216- string const& item_id, string const& page_token,
217+ string const& item_id, string const& page_token, vector<string> const& keys,
218 Context const& ctx)
219 {
220 printf("list('%s', '%s') called by %s (%d)\n", item_id.c_str(), page_token.c_str(), ctx.security_label.c_str(), ctx.pid);
221@@ -137,7 +137,7 @@
222 }
223
224 boost::future<ItemList> MyProvider::lookup(
225- string const& parent_id, string const& name, Context const& ctx)
226+ string const& parent_id, string const& name, vector<string> const& keys, Context const& ctx)
227 {
228 printf("lookup('%s', '%s') called by %s (%d)\n", parent_id.c_str(), name.c_str(), ctx.security_label.c_str(), ctx.pid);
229 fflush(stdout);
230@@ -160,6 +160,7 @@
231 }
232
233 boost::future<Item> MyProvider::metadata(string const& item_id,
234+ vector<string> const& keys,
235 Context const& ctx)
236 {
237 printf("metadata('%s') called by %s (%d)\n", item_id.c_str(), ctx.security_label.c_str(), ctx.pid);
238@@ -187,7 +188,7 @@
239 }
240
241 boost::future<Item> MyProvider::create_folder(
242- string const& parent_id, string const& name,
243+ string const& parent_id, string const& name, vector<string> const& keys,
244 Context const& ctx)
245 {
246 printf("create_folder('%s', '%s') called by %s (%d)\n", parent_id.c_str(), name.c_str(), ctx.security_label.c_str(), ctx.pid);
247@@ -204,7 +205,7 @@
248
249 boost::future<unique_ptr<UploadJob>> MyProvider::create_file(
250 string const& parent_id, string const& name,
251- int64_t size, string const& content_type, bool allow_overwrite,
252+ int64_t size, string const& content_type, bool allow_overwrite, vector<string> const& keys,
253 Context const& ctx)
254 {
255 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);
256@@ -213,7 +214,7 @@
257 }
258
259 boost::future<unique_ptr<UploadJob>> MyProvider::update(
260- string const& item_id, int64_t size, string const& old_etag, Context const& ctx)
261+ string const& item_id, int64_t size, string const& old_etag, vector<string> const& keys, Context const& ctx)
262 {
263 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);
264 fflush(stdout);
265@@ -248,7 +249,7 @@
266
267 boost::future<Item> MyProvider::move(
268 string const& item_id, string const& new_parent_id,
269- string const& new_name, Context const& ctx)
270+ string const& new_name, vector<string> const& keys, Context const& ctx)
271 {
272 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);
273 fflush(stdout);
274@@ -258,7 +259,7 @@
275
276 boost::future<Item> MyProvider::copy(
277 string const& item_id, string const& new_parent_id,
278- string const& new_name, Context const& ctx)
279+ string const& new_name, vector<string> const& keys, Context const& ctx)
280 {
281 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);
282 fflush(stdout);
283
284=== modified file 'include/unity/storage/provider/ProviderBase.h'
285--- include/unity/storage/provider/ProviderBase.h 2016-09-28 07:04:41 +0000
286+++ include/unity/storage/provider/ProviderBase.h 2016-11-02 04:28:58 +0000
287@@ -75,26 +75,27 @@
288 ProviderBase(ProviderBase const& other) = delete;
289 ProviderBase& operator=(ProviderBase const& other) = delete;
290
291- virtual boost::future<ItemList> roots(Context const& context) = 0;
292+ virtual boost::future<ItemList> roots(std::vector<std::string> const& keys, Context const& context) = 0;
293 virtual boost::future<std::tuple<ItemList,std::string>> list(
294 std::string const& item_id, std::string const& page_token,
295+ std::vector<std::string> const& keys,
296 Context const& context) = 0;
297 virtual boost::future<ItemList> lookup(
298- std::string const& parent_id, std::string const& name,
299+ std::string const& parent_id, std::string const& name, std::vector<std::string> const& keys,
300 Context const& context) = 0;
301- virtual boost::future<Item> metadata(std::string const& item_id,
302+ virtual boost::future<Item> metadata(std::string const& item_id, std::vector<std::string> const& keys,
303 Context const& context) = 0;
304
305 virtual boost::future<Item> create_folder(
306- std::string const& parent_id, std::string const& name,
307+ std::string const& parent_id, std::string const& name, std::vector<std::string> const& keys,
308 Context const& context) = 0;
309
310 virtual boost::future<std::unique_ptr<UploadJob>> create_file(
311 std::string const& parent_id, std::string const& name,
312- int64_t size, std::string const& content_type, bool allow_overwrite,
313+ int64_t size, std::string const& content_type, bool allow_overwrite, std::vector<std::string> const& keys,
314 Context const& context) = 0;
315 virtual boost::future<std::unique_ptr<UploadJob>> update(
316- std::string const& item_id, int64_t size, std::string const& old_etag,
317+ std::string const& item_id, int64_t size, std::string const& old_etag, std::vector<std::string> const& keys,
318 Context const& context) = 0;
319
320 virtual boost::future<std::unique_ptr<DownloadJob>> download(
321@@ -104,10 +105,10 @@
322 std::string const& item_id, Context const& context) = 0;
323 virtual boost::future<Item> move(
324 std::string const& item_id, std::string const& new_parent_id,
325- std::string const& new_name, Context const& context) = 0;
326+ std::string const& new_name, std::vector<std::string> const& keys, Context const& context) = 0;
327 virtual boost::future<Item> copy(
328 std::string const& item_id, std::string const& new_parent_id,
329- std::string const& new_name, Context const& context) = 0;
330+ std::string const& new_name, std::vector<std::string> const& keys, Context const& context) = 0;
331 };
332
333 }
334
335=== modified file 'include/unity/storage/provider/internal/ProviderInterface.h'
336--- include/unity/storage/provider/internal/ProviderInterface.h 2016-08-25 23:56:02 +0000
337+++ include/unity/storage/provider/internal/ProviderInterface.h 2016-11-02 04:28:58 +0000
338@@ -59,20 +59,36 @@
339 typedef unity::storage::internal::ItemMetadata IMD; // To keep things readable
340
341 public Q_SLOTS:
342- QList<IMD> Roots();
343- QList<IMD> List(QString const& item_id, QString const& page_token, QString& next_token);
344- QList<IMD> Lookup(QString const& parent_id, QString const& name);
345- IMD Metadata(QString const& item_id);
346- IMD CreateFolder(QString const& parent_id, QString const& name);
347- QString CreateFile(QString const& parent_id, QString const& name, int64_t size, QString const& content_type, bool allow_overwrite, QDBusUnixFileDescriptor& file_descriptor);
348- QString Update(QString const& item_id, int64_t size, QString const& old_etag, QDBusUnixFileDescriptor& file_descriptor);
349+ QList<IMD> Roots(QList<QString> const& keys);
350+ QList<IMD> List(QString const& item_id, QString const& page_token, QList<QString> const& keys, QString& next_token);
351+ QList<IMD> Lookup(QString const& parent_id, QString const& name, QList<QString> const& keys);
352+ IMD Metadata(QString const& item_id, QList<QString> const& keys);
353+ IMD CreateFolder(QString const& parent_id, QString const& name, QList<QString> const& keys);
354+ QString CreateFile(QString const& parent_id,
355+ QString const& name,
356+ int64_t size,
357+ QString const& content_type,
358+ bool allow_overwrite,
359+ QList<QString> const& keys,
360+ QDBusUnixFileDescriptor& file_descriptor);
361+ QString Update(QString const& item_id,
362+ int64_t size,
363+ QString const& old_etag,
364+ QList<QString> const& keys,
365+ QDBusUnixFileDescriptor& file_descriptor);
366 IMD FinishUpload(QString const& upload_id);
367 void CancelUpload(QString const& upload_id);
368 QString Download(QString const& item_id, QDBusUnixFileDescriptor& file_descriptor);
369 void FinishDownload(QString const& download_id);
370 void Delete(QString const& item_id);
371- IMD Move(QString const& item_id, QString const& new_parent_id, QString const& new_name);
372- IMD Copy(QString const& item_id, QString const& new_parent_id, QString const& new_name);
373+ IMD Move(QString const& item_id,
374+ QString const& new_parent_id,
375+ QString const& new_name,
376+ QList<QString> const& metadata_keys);
377+ IMD Copy(QString const& item_id,
378+ QString const& new_parent_id,
379+ QString const& new_name,
380+ QList<QString> const& metadata_keys);
381
382 private Q_SLOTS:
383 void request_finished();
384
385=== modified file 'include/unity/storage/qt/Account.h'
386--- include/unity/storage/qt/Account.h 2016-10-10 05:24:16 +0000
387+++ include/unity/storage/qt/Account.h 2016-11-02 04:28:58 +0000
388@@ -18,9 +18,8 @@
389
390 #pragma once
391
392-#include <QList>
393 #include <QMetaType>
394-#include <QString>
395+#include <QStringList>
396
397 #include <memory>
398
399@@ -62,8 +61,8 @@
400 QString ownerId() const;
401 QString description() const;
402
403- Q_INVOKABLE ItemListJob* roots() const;
404- Q_INVOKABLE ItemJob* get(QString const& itemId) const;
405+ Q_INVOKABLE ItemListJob* roots(QStringList const& keys = QStringList()) const;
406+ Q_INVOKABLE ItemJob* get(QString const& itemId, QStringList const& keys = QStringList()) const;
407
408 bool operator==(Account const&) const;
409 bool operator!=(Account const&) const;
410
411=== modified file 'include/unity/storage/qt/Item.h'
412--- include/unity/storage/qt/Item.h 2016-10-13 07:59:12 +0000
413+++ include/unity/storage/qt/Item.h 2016-11-02 04:28:58 +0000
414@@ -62,7 +62,7 @@
415 Q_PROPERTY(unity::storage::qt::Item::Type type READ type FINAL)
416 Q_PROPERTY(QVariantMap metadata READ metadata FINAL)
417 Q_PROPERTY(QDateTime lastModifiedTime READ lastModifiedTime FINAL)
418- Q_PROPERTY(QList<QString> parentIds READ parentIds FINAL)
419+ Q_PROPERTY(QStringList parentIds READ parentIds FINAL)
420
421 public:
422 Item();
423@@ -95,23 +95,30 @@
424 Type type() const;
425 QVariantMap metadata() const;
426 QDateTime lastModifiedTime() const;
427- QList<QString> parentIds() const;
428+ QStringList parentIds() const;
429
430- Q_INVOKABLE ItemListJob* parents() const;
431- Q_INVOKABLE ItemJob* copy(Item const& newParent, QString const& newName) const;
432- Q_INVOKABLE ItemJob* move(Item const& newParent, QString const& newName) const;
433+ Q_INVOKABLE ItemListJob* parents(QStringList const& keys = QStringList()) const;
434+ Q_INVOKABLE ItemJob* copy(Item const& newParent,
435+ QString const& newName,
436+ QStringList const& keys = QStringList()) const;
437+ Q_INVOKABLE ItemJob* move(Item const& newParent,
438+ QString const& newName,
439+ QStringList const& keys = QStringList()) const;
440 Q_INVOKABLE VoidJob* deleteItem() const;
441
442- Q_INVOKABLE Uploader* createUploader(ConflictPolicy policy, qint64 sizeInBytes) const;
443+ Q_INVOKABLE Uploader* createUploader(ConflictPolicy policy,
444+ qint64 sizeInBytes,
445+ QStringList const& keys = QStringList()) const;
446 Q_INVOKABLE Downloader* createDownloader() const;
447
448- Q_INVOKABLE ItemListJob* list() const;
449- Q_INVOKABLE ItemListJob* lookup(QString const& name) const;
450- Q_INVOKABLE ItemJob* createFolder(QString const& name) const;
451+ Q_INVOKABLE ItemListJob* list(QStringList const& keys = QStringList()) const;
452+ Q_INVOKABLE ItemListJob* lookup(QString const& name, QStringList const& = QStringList()) const;
453+ Q_INVOKABLE ItemJob* createFolder(QString const& name, QStringList const& = QStringList()) const;
454 Q_INVOKABLE Uploader* createFile(QString const& name,
455 ConflictPolicy policy,
456 qint64 sizeInBytes,
457- QString const& contentType) const;
458+ QString const& contentType,
459+ QStringList const& keys = QStringList()) const;
460
461 Q_INVOKABLE IntJob* freeSpaceBytes() const;
462 Q_INVOKABLE IntJob* usedSpaceBytes() const;
463
464=== modified file 'include/unity/storage/qt/internal/AccountImpl.h'
465--- include/unity/storage/qt/internal/AccountImpl.h 2016-10-12 05:25:20 +0000
466+++ include/unity/storage/qt/internal/AccountImpl.h 2016-11-02 04:28:58 +0000
467@@ -51,8 +51,8 @@
468 QString owner() const;
469 QString description() const;
470
471- ItemListJob* roots() const;
472- ItemJob* get(QString const& itemId) const;
473+ ItemListJob* roots(QStringList const& keys) const;
474+ ItemJob* get(QString const& itemId, QStringList const& keys) const;
475
476 bool operator==(AccountImpl const&) const;
477 bool operator!=(AccountImpl const&) const;
478
479=== modified file 'include/unity/storage/qt/internal/ItemImpl.h'
480--- include/unity/storage/qt/internal/ItemImpl.h 2016-10-13 07:59:12 +0000
481+++ include/unity/storage/qt/internal/ItemImpl.h 2016-11-02 04:28:58 +0000
482@@ -58,20 +58,21 @@
483 QDateTime lastModifiedTime() const;
484 QList<QString> parentIds() const;
485
486- ItemListJob* parents() const;
487- ItemJob* copy(Item const& newParent, QString const& newName) const;
488- ItemJob* move(Item const& newParent, QString const& newName) const;
489+ ItemListJob* parents(QStringList const& keys) const;
490+ ItemJob* copy(Item const& newParent, QString const& newName, QStringList const& keys) const;
491+ ItemJob* move(Item const& newParent, QString const& newName, QStringList const& keys) const;
492 VoidJob* deleteItem() const;
493- Uploader* createUploader(Item::ConflictPolicy policy, qint64 sizeInBytes) const;
494+ Uploader* createUploader(Item::ConflictPolicy policy, qint64 sizeInBytes, QStringList const& keys) const;
495 Downloader* createDownloader() const;
496- ItemListJob* list() const;
497- ItemListJob* lookup(QString const& name) const;
498- ItemJob* createFolder(QString const& name) const;
499+ ItemListJob* list(QStringList const& keys) const;
500+ ItemListJob* lookup(QString const& name, QStringList const& keys) const;
501+ ItemJob* createFolder(QString const& name, QStringList const& keys) const;
502 Uploader* createFile(QString const& name) const;
503 Uploader* createFile(QString const& name,
504 Item::ConflictPolicy policy,
505 qint64 sizeInBytes,
506- QString const& contentType) const;
507+ QString const& contentType,
508+ QStringList const& keys) const;
509 IntJob* freeSpaceBytes() const;
510 IntJob* usedSpaceBytes() const;
511
512
513=== modified file 'src/provider/internal/ProviderInterface.cpp'
514--- src/provider/internal/ProviderInterface.cpp 2016-09-02 13:51:37 +0000
515+++ src/provider/internal/ProviderInterface.cpp 2016-11-02 04:28:58 +0000
516@@ -33,6 +33,21 @@
517
518 using namespace std;
519
520+namespace
521+{
522+
523+vector<string> to_vector(QList<QString> const& l)
524+{
525+ vector<string> v;
526+ for (auto const& s : l)
527+ {
528+ v.push_back(s.toStdString());
529+ }
530+ return v;
531+}
532+
533+}
534+
535 namespace unity {
536 namespace storage {
537 namespace provider {
538@@ -86,10 +101,10 @@
539 handler->deleteLater();
540 }
541
542-QList<ProviderInterface::IMD> ProviderInterface::Roots()
543+QList<ProviderInterface::IMD> ProviderInterface::Roots(QList<QString> const& keys)
544 {
545- queue_request([](shared_ptr<AccountData> const& account, Context const& ctx, QDBusMessage const& message) {
546- auto f = account->provider().roots(ctx);
547+ queue_request([keys](shared_ptr<AccountData> const& account, Context const& ctx, QDBusMessage const& message) {
548+ auto f = account->provider().roots(to_vector(keys), ctx);
549 return f.then(
550 EXEC_IN_MAIN
551 [account, message](decltype(f) f) -> QDBusMessage {
552@@ -100,10 +115,15 @@
553 return {};
554 }
555
556-QList<ProviderInterface::IMD> ProviderInterface::List(QString const& item_id, QString const& page_token, QString& /*next_token*/)
557+QList<ProviderInterface::IMD> ProviderInterface::List(QString const& item_id,
558+ QString const& page_token,
559+ QList<QString> const& keys,
560+ QString& /*next_token*/)
561 {
562- queue_request([item_id, page_token](shared_ptr<AccountData> const& account, Context const& ctx, QDBusMessage const& message) {
563- auto f = account->provider().list(item_id.toStdString(), page_token.toStdString(), ctx);
564+ queue_request([item_id, page_token, keys](shared_ptr<AccountData> const& account,
565+ Context const& ctx,
566+ QDBusMessage const& message) {
567+ auto f = account->provider().list(item_id.toStdString(), page_token.toStdString(), to_vector(keys), ctx);
568 return f.then(
569 EXEC_IN_MAIN
570 [account, message](decltype(f) f) -> QDBusMessage {
571@@ -119,10 +139,14 @@
572 return {};
573 }
574
575-QList<ProviderInterface::IMD> ProviderInterface::Lookup(QString const& parent_id, QString const& name)
576+QList<ProviderInterface::IMD> ProviderInterface::Lookup(QString const& parent_id,
577+ QString const& name,
578+ QList<QString> const& keys)
579 {
580- queue_request([parent_id, name](shared_ptr<AccountData> const& account, Context const& ctx, QDBusMessage const& message) {
581- auto f = account->provider().lookup(parent_id.toStdString(), name.toStdString(), ctx);
582+ queue_request([parent_id, name, keys](shared_ptr<AccountData> const& account,
583+ Context const& ctx,
584+ QDBusMessage const& message) {
585+ auto f = account->provider().lookup(parent_id.toStdString(), name.toStdString(), to_vector(keys), ctx);
586 return f.then(
587 EXEC_IN_MAIN
588 [account, message](decltype(f) f) -> QDBusMessage {
589@@ -133,10 +157,12 @@
590 return {};
591 }
592
593-ProviderInterface::IMD ProviderInterface::Metadata(QString const& item_id)
594+ProviderInterface::IMD ProviderInterface::Metadata(QString const& item_id, QList<QString> const& keys)
595 {
596- queue_request([item_id](shared_ptr<AccountData> const& account, Context const& ctx, QDBusMessage const& message) {
597- auto f = account->provider().metadata(item_id.toStdString(), ctx);
598+ queue_request([item_id, keys](shared_ptr<AccountData> const& account,
599+ Context const& ctx,
600+ QDBusMessage const& message) {
601+ auto f = account->provider().metadata(item_id.toStdString(), to_vector(keys), ctx);
602 return f.then(
603 EXEC_IN_MAIN
604 [account, message](decltype(f) f) -> QDBusMessage {
605@@ -147,11 +173,15 @@
606 return {};
607 }
608
609-ProviderInterface::IMD ProviderInterface::CreateFolder(QString const& parent_id, QString const& name)
610+ProviderInterface::IMD ProviderInterface::CreateFolder(QString const& parent_id,
611+ QString const& name,
612+ QList<QString> const& keys)
613 {
614- queue_request([parent_id, name](shared_ptr<AccountData> const& account, Context const& ctx, QDBusMessage const& message) {
615+ queue_request([parent_id, name, keys](shared_ptr<AccountData> const& account,
616+ Context const& ctx,
617+ QDBusMessage const& message) {
618 auto f = account->provider().create_folder(
619- parent_id.toStdString(), name.toStdString(), ctx);
620+ parent_id.toStdString(), name.toStdString(), to_vector(keys), ctx);
621 return f.then(
622 EXEC_IN_MAIN
623 [account, message](decltype(f) f) -> QDBusMessage {
624@@ -162,12 +192,20 @@
625 return {};
626 }
627
628-QString ProviderInterface::CreateFile(QString const& parent_id, QString const& name, int64_t size, QString const& content_type, bool allow_overwrite, QDBusUnixFileDescriptor& /*file_descriptor*/)
629+QString ProviderInterface::CreateFile(QString const& parent_id,
630+ QString const& name,
631+ int64_t size,
632+ QString const& content_type,
633+ bool allow_overwrite,
634+ QList<QString> const& keys,
635+ QDBusUnixFileDescriptor& /*file_descriptor*/)
636 {
637- queue_request([parent_id, name, size, content_type, allow_overwrite](shared_ptr<AccountData> const& account, Context const& ctx, QDBusMessage const& message) {
638+ queue_request([parent_id, name, size, content_type, allow_overwrite, keys](shared_ptr<AccountData> const& account,
639+ Context const& ctx,
640+ QDBusMessage const& message) {
641 auto f = account->provider().create_file(
642 parent_id.toStdString(), name.toStdString(),
643- size, content_type.toStdString(), allow_overwrite, ctx);
644+ size, content_type.toStdString(), allow_overwrite, to_vector(keys), ctx);
645 return f.then(
646 EXEC_IN_MAIN
647 [account, message](decltype(f) f) -> QDBusMessage {
648@@ -188,11 +226,17 @@
649 return "";
650 }
651
652-QString ProviderInterface::Update(QString const& item_id, int64_t size, QString const& old_etag, QDBusUnixFileDescriptor& /*file_descriptor*/)
653+QString ProviderInterface::Update(QString const& item_id,
654+ int64_t size,
655+ QString const& old_etag,
656+ QList<QString> const& keys,
657+ QDBusUnixFileDescriptor& /*file_descriptor*/)
658 {
659- queue_request([item_id, size, old_etag](shared_ptr<AccountData> const& account, Context const& ctx, QDBusMessage const& message) {
660+ queue_request([item_id, size, old_etag, keys](shared_ptr<AccountData> const& account,
661+ Context const& ctx,
662+ QDBusMessage const& message) {
663 auto f = account->provider().update(
664- item_id.toStdString(), size, old_etag.toStdString(), ctx);
665+ item_id.toStdString(), size, old_etag.toStdString(), to_vector(keys), ctx);
666 return f.then(
667 EXEC_IN_MAIN
668 [account, message](decltype(f) f) -> QDBusMessage {
669@@ -215,7 +259,9 @@
670
671 ProviderInterface::IMD ProviderInterface::FinishUpload(QString const& upload_id)
672 {
673- queue_request([upload_id](shared_ptr<AccountData> const& account, Context const& /*ctx*/, QDBusMessage const& message) {
674+ queue_request([upload_id](shared_ptr<AccountData> const& account,
675+ Context const& /*ctx*/,
676+ QDBusMessage const& message) {
677 // FIXME: removing the job at this point means we can't
678 // cancel during finish().
679 // Throws if job is not available
680@@ -233,7 +279,9 @@
681
682 void ProviderInterface::CancelUpload(QString const& upload_id)
683 {
684- queue_request([upload_id](shared_ptr<AccountData> const& account, Context const& /*ctx*/, QDBusMessage const& message) {
685+ queue_request([upload_id](shared_ptr<AccountData> const& account,
686+ Context const& /*ctx*/,
687+ QDBusMessage const& message) {
688 // Throws if job is not available
689 auto job = account->jobs().remove_upload(message.service(), upload_id.toStdString());
690 auto f = job->p_->cancel(*job);
691@@ -273,7 +321,9 @@
692
693 void ProviderInterface::FinishDownload(QString const& download_id)
694 {
695- queue_request([download_id](shared_ptr<AccountData> const& account, Context const& /*ctx*/, QDBusMessage const& message) {
696+ queue_request([download_id](shared_ptr<AccountData> const& account,
697+ Context const& /*ctx*/,
698+ QDBusMessage const& message) {
699 // FIXME: removing the job at this point means we can't
700 // cancel during finish().
701 // Throws if job is not available
702@@ -302,12 +352,17 @@
703 });
704 }
705
706-ProviderInterface::IMD ProviderInterface::Move(QString const& item_id, QString const& new_parent_id, QString const& new_name)
707+ProviderInterface::IMD ProviderInterface::Move(QString const& item_id,
708+ QString const& new_parent_id,
709+ QString const& new_name,
710+ QList<QString> const& keys)
711 {
712- queue_request([item_id, new_parent_id, new_name](shared_ptr<AccountData> const& account, Context const& ctx, QDBusMessage const& message) {
713+ queue_request([item_id, new_parent_id, new_name, keys](shared_ptr<AccountData> const& account,
714+ Context const& ctx,
715+ QDBusMessage const& message) {
716 auto f = account->provider().move(
717 item_id.toStdString(), new_parent_id.toStdString(),
718- new_name.toStdString(), ctx);
719+ new_name.toStdString(), to_vector(keys), ctx);
720 return f.then(
721 EXEC_IN_MAIN
722 [account, message](decltype(f) f) -> QDBusMessage {
723@@ -318,12 +373,17 @@
724 return {};
725 }
726
727-ProviderInterface::IMD ProviderInterface::Copy(QString const& item_id, QString const& new_parent_id, QString const& new_name)
728+ProviderInterface::IMD ProviderInterface::Copy(QString const& item_id,
729+ QString const& new_parent_id,
730+ QString const& new_name,
731+ QList<QString> const& keys)
732 {
733- queue_request([item_id, new_parent_id, new_name](shared_ptr<AccountData> const& account, Context const& ctx, QDBusMessage const& message) {
734+ queue_request([item_id, new_parent_id, new_name, keys](shared_ptr<AccountData> const& account,
735+ Context const& ctx,
736+ QDBusMessage const& message) {
737 auto f = account->provider().copy(
738 item_id.toStdString(), new_parent_id.toStdString(),
739- new_name.toStdString(), ctx);
740+ new_name.toStdString(), to_vector(keys), ctx);
741 return f.then(
742 EXEC_IN_MAIN
743 [account, message](decltype(f) f) -> QDBusMessage {
744
745=== modified file 'src/qt/Account.cpp'
746--- src/qt/Account.cpp 2016-09-22 01:52:20 +0000
747+++ src/qt/Account.cpp 2016-11-02 04:28:58 +0000
748@@ -93,14 +93,14 @@
749 return p_->description();
750 }
751
752-ItemListJob* Account::roots() const
753+ItemListJob* Account::roots(QStringList const& keys) const
754 {
755- return p_->roots();
756+ return p_->roots(keys);
757 }
758
759-ItemJob* Account::get(QString const& itemId) const
760+ItemJob* Account::get(QString const& itemId, QStringList const& keys) const
761 {
762- return p_->get(itemId);
763+ return p_->get(itemId, keys);
764 }
765
766 bool Account::operator==(Account const& other) const
767
768=== modified file 'src/qt/Item.cpp'
769--- src/qt/Item.cpp 2016-10-13 07:59:12 +0000
770+++ src/qt/Item.cpp 2016-11-02 04:28:58 +0000
771@@ -112,24 +112,24 @@
772 return p_->lastModifiedTime();
773 }
774
775-QList<QString> Item::parentIds() const
776+QStringList Item::parentIds() const
777 {
778 return p_->parentIds();
779 }
780
781-ItemListJob* Item::parents() const
782-{
783- return p_->parents();
784-}
785-
786-ItemJob* Item::copy(Item const& newParent, QString const& newName) const
787-{
788- return p_->copy(newParent, newName);
789-}
790-
791-ItemJob* Item::move(Item const& newParent, QString const& newName) const
792-{
793- return p_->move(newParent, newName);
794+ItemListJob* Item::parents(QStringList const& keys) const
795+{
796+ return p_->parents(keys);
797+}
798+
799+ItemJob* Item::copy(Item const& newParent, QString const& newName, QStringList const& keys) const
800+{
801+ return p_->copy(newParent, newName, keys);
802+}
803+
804+ItemJob* Item::move(Item const& newParent, QString const& newName, QStringList const& keys) const
805+{
806+ return p_->move(newParent, newName, keys);
807 }
808
809 VoidJob* Item::deleteItem() const
810@@ -137,9 +137,9 @@
811 return p_->deleteItem();
812 }
813
814-Uploader* Item::createUploader(ConflictPolicy policy, qint64 sizeInBytes) const
815+Uploader* Item::createUploader(ConflictPolicy policy, qint64 sizeInBytes, QStringList const& keys) const
816 {
817- return p_->createUploader(policy, sizeInBytes);
818+ return p_->createUploader(policy, sizeInBytes, keys);
819 }
820
821 Downloader* Item::createDownloader() const
822@@ -147,27 +147,28 @@
823 return p_->createDownloader();
824 }
825
826-ItemListJob* Item::list() const
827-{
828- return p_->list();
829-}
830-
831-ItemListJob* Item::lookup(QString const& name) const
832-{
833- return p_->lookup(name);
834-}
835-
836-ItemJob* Item::createFolder(QString const& name) const
837-{
838- return p_->createFolder(name);
839+ItemListJob* Item::list(QStringList const& keys) const
840+{
841+ return p_->list(keys);
842+}
843+
844+ItemListJob* Item::lookup(QString const& name, QStringList const& keys) const
845+{
846+ return p_->lookup(name, keys);
847+}
848+
849+ItemJob* Item::createFolder(QString const& name, QStringList const& keys) const
850+{
851+ return p_->createFolder(name, keys);
852 }
853
854 Uploader* Item::createFile(QString const& name,
855 ConflictPolicy policy,
856 qint64 sizeInBytes,
857- QString const& contentType) const
858+ QString const& contentType,
859+ QStringList const& keys) const
860 {
861- return p_->createFile(name, policy, sizeInBytes, contentType);
862+ return p_->createFile(name, policy, sizeInBytes, contentType, keys);
863 }
864
865 IntJob* Item::freeSpaceBytes() const
866
867=== modified file 'src/qt/client/internal/remote_client/AccountImpl.cpp'
868--- src/qt/client/internal/remote_client/AccountImpl.cpp 2016-08-26 04:45:56 +0000
869+++ src/qt/client/internal/remote_client/AccountImpl.cpp 2016-11-02 04:28:58 +0000
870@@ -86,7 +86,7 @@
871 return make_exceptional_future<QVector<Root::SPtr>>(RuntimeDestroyedException("Account::roots()"));
872 }
873
874- auto reply = provider_->Roots();
875+ auto reply = provider_->Roots(QList<QString>());
876
877 auto process_reply = [this](decltype(reply) const& reply, QFutureInterface<QVector<Root::SPtr>>& qf)
878 {
879
880=== modified file 'src/qt/client/internal/remote_client/FileImpl.cpp'
881--- src/qt/client/internal/remote_client/FileImpl.cpp 2016-08-26 04:45:56 +0000
882+++ src/qt/client/internal/remote_client/FileImpl.cpp 2016-11-02 04:28:58 +0000
883@@ -72,7 +72,7 @@
884
885 QString old_etag = policy == ConflictPolicy::overwrite ? "" : md_.etag;
886 auto prov = provider();
887- auto reply = prov->Update(md_.item_id, size, old_etag);
888+ auto reply = prov->Update(md_.item_id, size, old_etag, QList<QString>());
889
890 auto process_reply = [this, size, old_etag, prov](decltype(reply) const& reply,
891 QFutureInterface<std::shared_ptr<Uploader>>& qf)
892
893=== modified file 'src/qt/client/internal/remote_client/FolderImpl.cpp'
894--- src/qt/client/internal/remote_client/FolderImpl.cpp 2016-08-26 04:45:56 +0000
895+++ src/qt/client/internal/remote_client/FolderImpl.cpp 2016-11-02 04:28:58 +0000
896@@ -68,7 +68,7 @@
897 }
898
899 auto prov = provider();
900- auto reply = prov->List(md_.item_id, "");
901+ auto reply = prov->List(md_.item_id, "", QList<QString>());
902
903 // Sorry for the mess, but we can't use auto for the lambda because it calls itself,
904 // and the compiler can't deduce the type of the lambda while it's still parsing the lambda body.
905@@ -114,7 +114,7 @@
906 else
907 {
908 // Request next lot.
909- auto next_reply = prov->List(md_.item_id, token);
910+ auto next_reply = prov->List(md_.item_id, token, QList<QString>());
911 new Handler<QVector<shared_ptr<Item>>>(const_cast<FolderImpl*>(this), next_reply, process_reply);
912 }
913 };
914@@ -135,7 +135,7 @@
915 }
916
917 auto prov = provider();
918- auto reply = prov->Lookup(md_.item_id, name);
919+ auto reply = prov->Lookup(md_.item_id, name, QList<QString>());
920
921 auto process_reply = [this, name](decltype(reply) const& reply, QFutureInterface<QVector<shared_ptr<Item>>>& qf)
922 {
923@@ -194,7 +194,7 @@
924 }
925
926 auto prov = provider();
927- auto reply = prov->CreateFolder(md_.item_id, name);
928+ auto reply = prov->CreateFolder(md_.item_id, name, QList<QString>());
929
930 auto process_reply = [this](decltype(reply) const& reply, QFutureInterface<shared_ptr<Folder>>& qf)
931 {
932@@ -252,7 +252,7 @@
933 }
934
935 auto prov = provider();
936- auto reply = prov->CreateFile(md_.item_id, name, size, "application/octet-stream", false);
937+ auto reply = prov->CreateFile(md_.item_id, name, size, "application/octet-stream", false, QList<QString>());
938
939 auto process_reply = [this, size](decltype(reply) const& reply, QFutureInterface<shared_ptr<Uploader>>& qf)
940 {
941
942=== modified file 'src/qt/client/internal/remote_client/ItemImpl.cpp'
943--- src/qt/client/internal/remote_client/ItemImpl.cpp 2016-09-28 04:37:14 +0000
944+++ src/qt/client/internal/remote_client/ItemImpl.cpp 2016-11-02 04:28:58 +0000
945@@ -95,7 +95,7 @@
946 }
947
948 auto prov = provider();
949- auto reply = prov->Copy(md_.item_id, new_parent->native_identity(), new_name);
950+ auto reply = prov->Copy(md_.item_id, new_parent->native_identity(), new_name, QList<QString>());
951
952 auto process_reply = [this](decltype(reply) const& reply, QFutureInterface<std::shared_ptr<Item>>& qf)
953 {
954@@ -160,7 +160,7 @@
955 {
956 return make_exceptional_future<shared_ptr<Item>>(RuntimeDestroyedException("Item::move()"));
957 }
958- auto reply = prov->Move(md_.item_id, new_parent->native_identity(), new_name);
959+ auto reply = prov->Move(md_.item_id, new_parent->native_identity(), new_name, QList<QString>());
960
961 auto process_reply = [this](decltype(reply) const& reply, QFutureInterface<std::shared_ptr<Item>>& qf)
962 {
963
964=== modified file 'src/qt/client/internal/remote_client/RootImpl.cpp'
965--- src/qt/client/internal/remote_client/RootImpl.cpp 2016-08-26 04:45:56 +0000
966+++ src/qt/client/internal/remote_client/RootImpl.cpp 2016-11-02 04:28:58 +0000
967@@ -122,7 +122,7 @@
968 }
969
970 auto prov = provider();
971- auto reply = prov->Metadata(native_identity);
972+ auto reply = prov->Metadata(native_identity, QList<QString>());
973
974 auto process_reply = [this](decltype(reply) const& reply, QFutureInterface<Item::SPtr>& qf)
975 {
976
977=== modified file 'src/qt/internal/AccountImpl.cpp'
978--- src/qt/internal/AccountImpl.cpp 2016-10-12 05:25:20 +0000
979+++ src/qt/internal/AccountImpl.cpp 2016-11-02 04:28:58 +0000
980@@ -81,7 +81,7 @@
981 return is_valid_ ? description_ : "";
982 }
983
984-ItemListJob* AccountImpl::roots() const
985+ItemListJob* AccountImpl::roots(QStringList const& keys) const
986 {
987 QString const method = "Account::roots()";
988
989@@ -107,12 +107,12 @@
990 }
991 };
992
993- auto reply = provider_->Roots();
994+ auto reply = provider_->Roots(keys);
995 auto This = const_pointer_cast<AccountImpl>(shared_from_this());
996 return ItemListJobImpl::make_job(This, method, reply, validate);
997 }
998
999-ItemJob* AccountImpl::get(QString const& itemId) const
1000+ItemJob* AccountImpl::get(QString const& itemId, QStringList const& keys) const
1001 {
1002 QString const method = "Account::get()";
1003
1004@@ -132,7 +132,7 @@
1005 {
1006 };
1007
1008- auto reply = provider_->Metadata(itemId);
1009+ auto reply = provider_->Metadata(itemId, keys);
1010 auto This = const_pointer_cast<AccountImpl>(shared_from_this());
1011 return ItemJobImpl::make_job(This, method, reply, validate);
1012 }
1013
1014=== modified file 'src/qt/internal/ItemImpl.cpp'
1015--- src/qt/internal/ItemImpl.cpp 2016-10-17 12:23:12 +0000
1016+++ src/qt/internal/ItemImpl.cpp 2016-11-02 04:28:58 +0000
1017@@ -115,7 +115,7 @@
1018 return md_.parent_ids;
1019 }
1020
1021-ItemListJob* ItemImpl::parents() const
1022+ItemListJob* ItemImpl::parents(QStringList const& keys) const
1023 {
1024 QString const method = "Item::parents()";
1025
1026@@ -135,7 +135,7 @@
1027 QList<QDBusPendingReply<storage::internal::ItemMetadata>> replies;
1028 for (auto const& id : md_.parent_ids)
1029 {
1030- auto reply = account_impl_->provider()->Metadata(id);
1031+ auto reply = account_impl_->provider()->Metadata(id, keys);
1032 replies.append(reply);
1033 }
1034
1035@@ -152,7 +152,7 @@
1036 return MultiItemJobImpl::make_job(account_impl_, method, replies, validate);
1037 }
1038
1039-ItemJob* ItemImpl::copy(Item const& newParent, QString const& newName) const
1040+ItemJob* ItemImpl::copy(Item const& newParent, QString const& newName, QStringList const& keys) const
1041 {
1042 QString const method = "Item::copy()";
1043
1044@@ -174,12 +174,12 @@
1045 }
1046 };
1047
1048- auto reply = account_impl_->provider()->Copy(md_.item_id, newParent.itemId(), newName);
1049+ auto reply = account_impl_->provider()->Copy(md_.item_id, newParent.itemId(), newName, keys);
1050 auto This = const_pointer_cast<ItemImpl>(shared_from_this());
1051 return ItemJobImpl::make_job(This, method, reply, validate);
1052 }
1053
1054-ItemJob* ItemImpl::move(Item const& newParent, QString const& newName) const
1055+ItemJob* ItemImpl::move(Item const& newParent, QString const& newName, QStringList const& keys) const
1056 {
1057 QString const method = "Item::move()";
1058
1059@@ -207,7 +207,7 @@
1060 }
1061 };
1062
1063- auto reply = account_impl_->provider()->Move(md_.item_id, newParent.itemId(), newName);
1064+ auto reply = account_impl_->provider()->Move(md_.item_id, newParent.itemId(), newName, keys);
1065 auto This = const_pointer_cast<ItemImpl>(shared_from_this());
1066 return ItemJobImpl::make_job(This, method, reply, validate);
1067 }
1068@@ -232,7 +232,7 @@
1069 return VoidJobImpl::make_job(This, method, reply);
1070 }
1071
1072-Uploader* ItemImpl::createUploader(Item::ConflictPolicy policy, qint64 sizeInBytes) const
1073+Uploader* ItemImpl::createUploader(Item::ConflictPolicy policy, qint64 sizeInBytes, QStringList const& keys) const
1074 {
1075 QString const method = "Item::createUploader()";
1076
1077@@ -263,7 +263,7 @@
1078 };
1079
1080 auto etag = policy == Item::ConflictPolicy::Overwrite ? "" : md_.etag;
1081- auto reply = account_impl_->provider()->Update(md_.item_id, sizeInBytes, etag);
1082+ auto reply = account_impl_->provider()->Update(md_.item_id, sizeInBytes, etag, keys);
1083 auto This = const_pointer_cast<ItemImpl>(shared_from_this());
1084 return UploaderImpl::make_job(This, method, reply, validate, policy, sizeInBytes);
1085 }
1086@@ -288,7 +288,7 @@
1087 return DownloaderImpl::make_job(This, method, reply);
1088 }
1089
1090-ItemListJob* ItemImpl::list() const
1091+ItemListJob* ItemImpl::list(QStringList const& keys) const
1092 {
1093 QString const method = "Item::list()";
1094
1095@@ -313,17 +313,17 @@
1096 }
1097 };
1098
1099- auto fetch_next = [this](QString const& page_token)
1100+ auto fetch_next = [this, keys](QString const& page_token)
1101 {
1102- return account_impl_->provider()->List(md_.item_id, page_token);
1103+ return account_impl_->provider()->List(md_.item_id, page_token, keys);
1104 };
1105
1106- auto reply = account_impl_->provider()->List(md_.item_id, "");
1107+ auto reply = account_impl_->provider()->List(md_.item_id, "", keys);
1108 auto This = const_pointer_cast<ItemImpl>(shared_from_this());
1109 return MultiItemListJobImpl::make_job(This, method, reply, validate, fetch_next);
1110 }
1111
1112-ItemListJob* ItemImpl::lookup(QString const& name) const
1113+ItemListJob* ItemImpl::lookup(QString const& name, QStringList const& keys) const
1114 {
1115 QString const method = "Item::lookup()";
1116
1117@@ -342,12 +342,12 @@
1118 {
1119 };
1120
1121- auto reply = account_impl_->provider()->Lookup(md_.item_id, name);
1122+ auto reply = account_impl_->provider()->Lookup(md_.item_id, name, keys);
1123 auto This = const_pointer_cast<ItemImpl>(shared_from_this());
1124 return ItemListJobImpl::make_job(This, method, reply, validate);
1125 }
1126
1127-ItemJob* ItemImpl::createFolder(QString const& name) const
1128+ItemJob* ItemImpl::createFolder(QString const& name, QStringList const& keys) const
1129 {
1130 QString const method = "Item::createFolder()";
1131
1132@@ -373,7 +373,7 @@
1133 throw StorageErrorImpl::local_comms_error(msg);
1134 };
1135
1136- auto reply = account_impl_->provider()->CreateFolder(md_.item_id, name);
1137+ auto reply = account_impl_->provider()->CreateFolder(md_.item_id, name, keys);
1138 auto This = const_pointer_cast<ItemImpl>(shared_from_this());
1139 return ItemJobImpl::make_job(This, method, reply, validate);
1140 }
1141@@ -381,7 +381,8 @@
1142 Uploader* ItemImpl::createFile(QString const& name,
1143 Item::ConflictPolicy policy,
1144 qint64 sizeInBytes,
1145- QString const& contentType) const
1146+ QString const& contentType,
1147+ QStringList const& keys) const
1148 {
1149 QString const method = "Item::createFile()";
1150
1151@@ -418,7 +419,8 @@
1152 };
1153
1154 bool allow_overwrite = policy == Item::ConflictPolicy::Overwrite;
1155- auto reply = account_impl_->provider()->CreateFile(md_.item_id, name, sizeInBytes, contentType, allow_overwrite);
1156+ auto reply = account_impl_->provider()->CreateFile(md_.item_id, name, sizeInBytes,
1157+ contentType, allow_overwrite, keys);
1158 auto This = const_pointer_cast<ItemImpl>(shared_from_this());
1159 return UploaderImpl::make_job(This, method, reply, validate, policy, sizeInBytes);
1160 }
1161
1162=== modified file 'tests/provider-ProviderInterface/ProviderInterface_test.cpp'
1163--- tests/provider-ProviderInterface/ProviderInterface_test.cpp 2016-09-28 04:37:14 +0000
1164+++ tests/provider-ProviderInterface/ProviderInterface_test.cpp 2016-11-02 04:28:58 +0000
1165@@ -85,7 +85,7 @@
1166 {
1167 set_provider(unique_ptr<ProviderBase>(new TestProvider));
1168
1169- auto reply = client_->Roots();
1170+ auto reply = client_->Roots(QList<QString>());
1171 wait_for(reply);
1172 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
1173 EXPECT_EQ(1, reply.value().size());
1174@@ -101,7 +101,7 @@
1175 {
1176 set_provider(unique_ptr<ProviderBase>(new TestProvider));
1177
1178- auto reply = client_->List("root_id", "");
1179+ auto reply = client_->List("root_id", "", QList<QString>());
1180 wait_for(reply);
1181 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
1182 auto items = reply.argumentAt<0>();
1183@@ -111,7 +111,7 @@
1184 EXPECT_EQ("child2_id", items[1].item_id);
1185 EXPECT_EQ("page_token", page_token);
1186
1187- reply = client_->List("root_id", page_token);
1188+ reply = client_->List("root_id", page_token, QList<QString>());
1189 wait_for(reply);
1190 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
1191 items = reply.argumentAt<0>();
1192@@ -122,13 +122,13 @@
1193 EXPECT_EQ("", page_token);
1194
1195 // Try a bad page token
1196- reply = client_->List("root_id", "bad_page_token");
1197+ reply = client_->List("root_id", "bad_page_token", QList<QString>());
1198 wait_for(reply);
1199 EXPECT_TRUE(reply.isError());
1200 EXPECT_EQ(PROVIDER_ERROR + "LogicException", reply.error().name()) << reply.error().name().toStdString();
1201 EXPECT_EQ("Unknown page token", reply.error().message()) << reply.error().message().toStdString();
1202
1203- reply = client_->List("no_such_folder_id", "");
1204+ reply = client_->List("no_such_folder_id", "", QList<QString>());
1205 wait_for(reply);
1206 EXPECT_TRUE(reply.isError());
1207 EXPECT_EQ(PROVIDER_ERROR + "NotExistsException", reply.error().name());
1208@@ -139,7 +139,7 @@
1209 {
1210 set_provider(unique_ptr<ProviderBase>(new TestProvider));
1211
1212- auto reply = client_->Lookup("root_id", "Filename");
1213+ auto reply = client_->Lookup("root_id", "Filename", QList<QString>());
1214 wait_for(reply);
1215 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
1216 auto items = reply.value();
1217@@ -155,7 +155,7 @@
1218 {
1219 set_provider(unique_ptr<ProviderBase>(new TestProvider));
1220
1221- auto reply = client_->Metadata("root_id");
1222+ auto reply = client_->Metadata("root_id", QList<QString>());
1223 wait_for(reply);
1224 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
1225 auto item = reply.value();
1226@@ -169,7 +169,7 @@
1227 {
1228 set_provider(unique_ptr<ProviderBase>(new TestProvider));
1229
1230- auto reply = client_->CreateFolder("root_id", "New Folder");
1231+ auto reply = client_->CreateFolder("root_id", "New Folder", QList<QString>());
1232 wait_for(reply);
1233 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
1234 auto item = reply.value();
1235@@ -186,7 +186,8 @@
1236 QString upload_id;
1237 QDBusUnixFileDescriptor socket;
1238 {
1239- auto reply = client_->CreateFile("parent_id", "file name", file_contents.size(), "text/plain", false);
1240+ auto reply = client_->CreateFile("parent_id", "file name", file_contents.size(),
1241+ "text/plain", false, QList<QString>());
1242 wait_for(reply);
1243 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
1244 upload_id = reply.argumentAt<0>();
1245@@ -235,7 +236,7 @@
1246 QString upload_id;
1247 QDBusUnixFileDescriptor socket;
1248 {
1249- auto reply = client_->Update("item_id", file_contents.size(), "old_etag");
1250+ auto reply = client_->Update("item_id", file_contents.size(), "old_etag", QList<QString>());
1251 wait_for(reply);
1252 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
1253 upload_id = reply.argumentAt<0>();
1254@@ -282,7 +283,7 @@
1255 QString upload_id;
1256 QDBusUnixFileDescriptor socket;
1257 {
1258- auto reply = client_->Update("item_id", 100, "old_etag");
1259+ auto reply = client_->Update("item_id", 100, "old_etag", QList<QString>());
1260 wait_for(reply);
1261 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
1262 upload_id = reply.argumentAt<0>();
1263@@ -305,7 +306,7 @@
1264 QString upload_id;
1265 QDBusUnixFileDescriptor socket;
1266 {
1267- auto reply = client_->Update("item_id", file_contents.size() - 5, "old_etag");
1268+ auto reply = client_->Update("item_id", file_contents.size() - 5, "old_etag", QList<QString>());
1269 wait_for(reply);
1270 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
1271 upload_id = reply.argumentAt<0>();
1272@@ -352,7 +353,7 @@
1273 QString upload_id;
1274 QDBusUnixFileDescriptor socket;
1275 {
1276- auto reply = client_->Update("item_id", 100, "old_etag");
1277+ auto reply = client_->Update("item_id", 100, "old_etag", QList<QString>());
1278 wait_for(reply);
1279 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
1280 upload_id = reply.argumentAt<0>();
1281@@ -372,7 +373,7 @@
1282 QString upload_id;
1283 QDBusUnixFileDescriptor socket;
1284 {
1285- auto reply = client_->Update("item_id", 100, "old_etag");
1286+ auto reply = client_->Update("item_id", 100, "old_etag", QList<QString>());
1287 wait_for(reply);
1288 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
1289 upload_id = reply.argumentAt<0>();
1290@@ -387,7 +388,7 @@
1291 {
1292 set_provider(unique_ptr<ProviderBase>(new TestProvider));
1293
1294- auto upload_reply = client_->Update("item_id", 100, "old_etag");
1295+ auto upload_reply = client_->Update("item_id", 100, "old_etag", QList<QString>());
1296 wait_for(upload_reply);
1297 ASSERT_TRUE(upload_reply.isValid()) << upload_reply.error().message().toStdString();
1298 auto upload_id = upload_reply.argumentAt<0>();
1299@@ -419,7 +420,7 @@
1300 QDBusConnection::disconnectFromBus(SECOND_CONNECTION_NAME);
1301 service_watcher.addWatchedService(connection2.baseService());
1302 ProviderClient client2(bus_name(), object_path(), connection2);
1303- auto reply = client2.Update("item_id", 100, "old_etag");
1304+ auto reply = client2.Update("item_id", 100, "old_etag", QList<QString>());
1305 wait_for(reply);
1306 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
1307 // Store socket so it will remain open past the closing of the
1308@@ -457,7 +458,7 @@
1309 {
1310 set_provider(unique_ptr<ProviderBase>(new TestProvider));
1311
1312- auto upload_reply = client_->Update("item_id", 100, "old_etag");
1313+ auto upload_reply = client_->Update("item_id", 100, "old_etag", QList<QString>());
1314 wait_for(upload_reply);
1315 ASSERT_TRUE(upload_reply.isValid()) << upload_reply.error().message().toStdString();
1316 auto upload_id = upload_reply.argumentAt<0>();
1317@@ -480,7 +481,7 @@
1318 QString upload_id;
1319 QDBusUnixFileDescriptor socket;
1320 {
1321- auto reply = client_->Update("tempfile_item_id", file_contents.size(), "old_etag");
1322+ auto reply = client_->Update("tempfile_item_id", file_contents.size(), "old_etag", QList<QString>());
1323 wait_for(reply);
1324 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
1325 upload_id = reply.argumentAt<0>();
1326@@ -527,7 +528,7 @@
1327 QString upload_id;
1328 QDBusUnixFileDescriptor socket;
1329 {
1330- auto reply = client_->Update("tempfile_item_id", 100, "old_etag");
1331+ auto reply = client_->Update("tempfile_item_id", 100, "old_etag", QList<QString>());
1332 wait_for(reply);
1333 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
1334 upload_id = reply.argumentAt<0>();
1335@@ -550,7 +551,7 @@
1336 QString upload_id;
1337 QDBusUnixFileDescriptor socket;
1338 {
1339- auto reply = client_->Update("tempfile_item_id", file_contents.size() - 5, "old_etag");
1340+ auto reply = client_->Update("tempfile_item_id", file_contents.size() - 5, "old_etag", QList<QString>());
1341 wait_for(reply);
1342 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
1343 upload_id = reply.argumentAt<0>();
1344@@ -597,7 +598,7 @@
1345 QString upload_id;
1346 QDBusUnixFileDescriptor socket;
1347 {
1348- auto reply = client_->Update("tempfile_item_id", 100, "old_etag");
1349+ auto reply = client_->Update("tempfile_item_id", 100, "old_etag", QList<QString>());
1350 wait_for(reply);
1351 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
1352 upload_id = reply.argumentAt<0>();
1353@@ -756,7 +757,7 @@
1354 {
1355 set_provider(unique_ptr<ProviderBase>(new TestProvider));
1356
1357- auto reply = client_->Move("child_id", "new_parent_id", "New name");
1358+ auto reply = client_->Move("child_id", "new_parent_id", "New name", QList<QString>());
1359 wait_for(reply);
1360 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
1361 auto item = reply.value();
1362@@ -770,7 +771,7 @@
1363 {
1364 set_provider(unique_ptr<ProviderBase>(new TestProvider));
1365
1366- auto reply = client_->Copy("child_id", "new_parent_id", "New name");
1367+ auto reply = client_->Copy("child_id", "new_parent_id", "New name", QList<QString>());
1368 wait_for(reply);
1369 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
1370 auto item = reply.value();
1371
1372=== modified file 'tests/provider-ProviderInterface/TestProvider.cpp'
1373--- tests/provider-ProviderInterface/TestProvider.cpp 2016-08-24 10:52:17 +0000
1374+++ tests/provider-ProviderInterface/TestProvider.cpp 2016-11-02 04:28:58 +0000
1375@@ -283,8 +283,9 @@
1376 }
1377
1378
1379-boost::future<ItemList> TestProvider::roots(Context const& ctx)
1380+boost::future<ItemList> TestProvider::roots(vector<string> const& keys, Context const& ctx)
1381 {
1382+ Q_UNUSED(keys);
1383 Q_UNUSED(ctx);
1384
1385 ItemList roots = {
1386@@ -296,8 +297,9 @@
1387 }
1388
1389 boost::future<tuple<ItemList,string>> TestProvider::list(
1390- string const& item_id, string const& page_token, Context const& ctx)
1391+ string const& item_id, string const& page_token, vector<string> const& keys, Context const& ctx)
1392 {
1393+ Q_UNUSED(keys);
1394 Q_UNUSED(ctx);
1395
1396 boost::promise<tuple<ItemList,string>> p;
1397@@ -330,8 +332,9 @@
1398 }
1399
1400 boost::future<ItemList> TestProvider::lookup(
1401- string const& parent_id, string const& name, Context const& ctx)
1402+ string const& parent_id, string const& name, vector<string> const& keys, Context const& ctx)
1403 {
1404+ Q_UNUSED(keys);
1405 Q_UNUSED(ctx);
1406
1407 boost::promise<ItemList> p;
1408@@ -343,8 +346,9 @@
1409 }
1410
1411 boost::future<Item> TestProvider::metadata(
1412- string const& item_id, Context const& ctx)
1413+ string const& item_id, vector<string> const& keys, Context const& ctx)
1414 {
1415+ Q_UNUSED(keys);
1416 Q_UNUSED(ctx);
1417
1418 boost::promise<Item> p;
1419@@ -361,8 +365,9 @@
1420 }
1421
1422 boost::future<Item> TestProvider::create_folder(
1423- string const& parent_id, string const& name, Context const& ctx)
1424+ string const& parent_id, string const& name, vector<string> const& keys, Context const& ctx)
1425 {
1426+ Q_UNUSED(keys);
1427 Q_UNUSED(ctx);
1428
1429 boost::promise<Item> p;
1430@@ -373,11 +378,12 @@
1431
1432 boost::future<unique_ptr<UploadJob>> TestProvider::create_file(
1433 string const& parent_id, string const& name,
1434- int64_t size, string const& content_type, bool allow_overwrite,
1435+ int64_t size, string const& content_type, bool allow_overwrite, vector<string> const& keys,
1436 Context const& ctx)
1437 {
1438 Q_UNUSED(content_type);
1439 Q_UNUSED(allow_overwrite);
1440+ Q_UNUSED(keys);
1441 Q_UNUSED(ctx);
1442
1443 boost::promise<unique_ptr<UploadJob>> p;
1444@@ -387,11 +393,12 @@
1445 }
1446
1447 boost::future<unique_ptr<UploadJob>> TestProvider::update(
1448- string const& item_id, int64_t size, string const& old_etag,
1449+ string const& item_id, int64_t size, string const& old_etag, vector<string> const& keys,
1450 Context const& ctx)
1451 {
1452 Q_UNUSED(item_id);
1453 Q_UNUSED(old_etag);
1454+ Q_UNUSED(keys);
1455 Q_UNUSED(ctx);
1456
1457 boost::promise<unique_ptr<UploadJob>> p;
1458@@ -438,8 +445,9 @@
1459
1460 boost::future<Item> TestProvider::move(
1461 string const& item_id, string const& new_parent_id,
1462- string const& new_name, Context const& ctx)
1463+ string const& new_name, vector<string> const& keys, Context const& ctx)
1464 {
1465+ Q_UNUSED(keys);
1466 Q_UNUSED(ctx);
1467
1468 boost::promise<Item> p;
1469@@ -450,9 +458,10 @@
1470
1471 boost::future<Item> TestProvider::copy(
1472 string const& item_id, string const& new_parent_id,
1473- string const& new_name, Context const& ctx)
1474+ string const& new_name, vector<string> const& keys, Context const& ctx)
1475 {
1476 Q_UNUSED(item_id);
1477+ Q_UNUSED(keys);
1478 Q_UNUSED(ctx);
1479
1480 boost::promise<Item> p;
1481
1482=== modified file 'tests/provider-ProviderInterface/TestProvider.h'
1483--- tests/provider-ProviderInterface/TestProvider.h 2016-08-11 05:13:00 +0000
1484+++ tests/provider-ProviderInterface/TestProvider.h 2016-11-02 04:28:58 +0000
1485@@ -30,25 +30,25 @@
1486
1487 class TestProvider : public ProviderBase {
1488 public:
1489- boost::future<ItemList> roots(Context const& ctx) override;
1490+ boost::future<ItemList> roots(vector<string> const& keys, Context const& ctx) override;
1491 boost::future<tuple<ItemList,string>> list(
1492- string const& item_id, string const& page_token,
1493+ string const& item_id, string const& page_token, vector<string> const& keys,
1494 Context const& ctx) override;
1495 boost::future<ItemList> lookup(
1496- string const& parent_id, string const& name,
1497+ string const& parent_id, string const& name, vector<string> const& keys,
1498 Context const& ctx) override;
1499 boost::future<Item> metadata(
1500- string const& item_id, Context const& ctx) override;
1501+ string const& item_id, vector<string> const& keys, Context const& ctx) override;
1502 boost::future<Item> create_folder(
1503- string const& parent_id, string const& name,
1504+ string const& parent_id, string const& name, vector<string> const& keys,
1505 Context const& ctx) override;
1506
1507 boost::future<unique_ptr<UploadJob>> create_file(
1508 string const& parent_id, string const& name,
1509- int64_t size, string const& content_type, bool allow_overwrite,
1510+ int64_t size, string const& content_type, bool allow_overwrite, vector<string> const& keys,
1511 Context const& ctx) override;
1512 boost::future<unique_ptr<UploadJob>> update(
1513- string const& item_id, int64_t size, string const& old_etag,
1514+ string const& item_id, int64_t size, string const& old_etag, vector<string> const& keys,
1515 Context const& ctx) override;
1516
1517 boost::future<unique_ptr<DownloadJob>> download(
1518@@ -58,8 +58,8 @@
1519 string const& item_id, Context const& ctx) override;
1520 boost::future<Item> move(
1521 string const& item_id, string const& new_parent_id,
1522- string const& new_name, Context const& ctx) override;
1523+ string const& new_name, vector<string> const& keys, Context const& ctx) override;
1524 boost::future<Item> copy(
1525 string const& item_id, string const& new_parent_id,
1526- string const& new_name, Context const& ctx) override;
1527+ string const& new_name, vector<string> const& keys, Context const& ctx) override;
1528 };
1529
1530=== modified file 'tests/remote-client-v1/MockProvider.cpp'
1531--- tests/remote-client-v1/MockProvider.cpp 2016-08-22 06:04:06 +0000
1532+++ tests/remote-client-v1/MockProvider.cpp 2016-11-02 04:28:58 +0000
1533@@ -44,7 +44,7 @@
1534 {
1535 }
1536
1537-boost::future<ItemList> MockProvider::roots(Context const&)
1538+boost::future<ItemList> MockProvider::roots(vector<string> const&, Context const&)
1539 {
1540 ItemList roots =
1541 {
1542@@ -54,7 +54,7 @@
1543 }
1544
1545 boost::future<tuple<ItemList,string>> MockProvider::list(
1546- string const& item_id, string const& page_token,
1547+ string const& item_id, string const& page_token, vector<string> const&,
1548 Context const&)
1549 {
1550 if (item_id != "root_id")
1551@@ -80,7 +80,7 @@
1552 }
1553
1554 boost::future<ItemList> MockProvider::lookup(
1555- string const& parent_id, string const& name, Context const&)
1556+ string const& parent_id, string const& name, vector<string> const&, Context const&)
1557 {
1558 if (parent_id != "root_id")
1559 {
1560@@ -100,7 +100,7 @@
1561 return make_ready_future<ItemList>(children);
1562 }
1563
1564-boost::future<Item> MockProvider::metadata(string const& item_id, Context const&)
1565+boost::future<Item> MockProvider::metadata(string const& item_id, vector<string> const&, Context const&)
1566 {
1567 if (item_id == "root_id")
1568 {
1569@@ -125,7 +125,7 @@
1570 }
1571
1572 boost::future<Item> MockProvider::create_folder(
1573- string const& parent_id, string const& name,
1574+ string const& parent_id, string const& name, vector<string> const&,
1575 Context const&)
1576 {
1577 Item metadata{"new_folder_id", { parent_id }, name, "etag", ItemType::folder, {}};
1578@@ -140,13 +140,13 @@
1579
1580 boost::future<unique_ptr<UploadJob>> MockProvider::create_file(
1581 string const&, string const&,
1582- int64_t, string const&, bool, Context const&)
1583+ int64_t, string const&, bool, vector<string> const&, Context const&)
1584 {
1585 return make_ready_future<unique_ptr<UploadJob>>(new MockUploadJob(make_job_id()));
1586 }
1587
1588 boost::future<unique_ptr<UploadJob>> MockProvider::update(
1589- string const&, int64_t, string const&, Context const&)
1590+ string const&, int64_t, string const&, vector<string> const&, Context const&)
1591 {
1592 return make_ready_future<unique_ptr<UploadJob>>(new MockUploadJob(make_job_id()));
1593 }
1594@@ -174,7 +174,7 @@
1595
1596 boost::future<Item> MockProvider::move(
1597 string const& item_id, string const& new_parent_id,
1598- string const& new_name, Context const&)
1599+ string const& new_name, vector<string> const&, Context const&)
1600 {
1601 Item metadata{item_id, { new_parent_id }, new_name, "etag", ItemType::file, {}};
1602 return make_ready_future(metadata);
1603@@ -182,7 +182,7 @@
1604
1605 boost::future<Item> MockProvider::copy(
1606 string const&, string const& new_parent_id,
1607- string const& new_name, Context const&)
1608+ string const& new_name, vector<string> const&, Context const&)
1609 {
1610 Item metadata{"new_item_id", { new_parent_id }, new_name, "etag", ItemType::file, {}};
1611 return make_ready_future(metadata);
1612
1613=== modified file 'tests/remote-client-v1/MockProvider.h'
1614--- tests/remote-client-v1/MockProvider.h 2016-08-22 04:56:44 +0000
1615+++ tests/remote-client-v1/MockProvider.h 2016-11-02 04:28:58 +0000
1616@@ -28,25 +28,27 @@
1617 MockProvider();
1618 MockProvider(std::string const& cmd);
1619
1620- boost::future<unity::storage::provider::ItemList> roots(unity::storage::provider::Context const& ctx) override;
1621+ boost::future<unity::storage::provider::ItemList> roots(std::vector<std::string> const& keys,
1622+ unity::storage::provider::Context const& ctx) override;
1623 boost::future<std::tuple<unity::storage::provider::ItemList, std::string>> list(
1624- std::string const& item_id, std::string const& page_token,
1625+ std::string const& item_id, std::string const& page_token, std::vector<std::string> const& keys,
1626 unity::storage::provider::Context const& ctx) override;
1627 boost::future<unity::storage::provider::ItemList> lookup(
1628- std::string const& parent_id, std::string const& name,
1629+ std::string const& parent_id, std::string const& name, std::vector<std::string> const& keys,
1630 unity::storage::provider::Context const& ctx) override;
1631 boost::future<unity::storage::provider::Item> metadata(
1632- std::string const& item_id, unity::storage::provider::Context const& ctx) override;
1633+ std::string const& item_id, std::vector<std::string> const& keys,
1634+ unity::storage::provider::Context const& ctx) override;
1635 boost::future<unity::storage::provider::Item> create_folder(
1636- std::string const& parent_id, std::string const& name,
1637+ std::string const& parent_id, std::string const& name, std::vector<std::string> const& keys,
1638 unity::storage::provider::Context const& ctx) override;
1639
1640 boost::future<std::unique_ptr<unity::storage::provider::UploadJob>> create_file(
1641 std::string const& parent_id, std::string const& name,
1642- int64_t size, std::string const& content_type, bool allow_overwrite,
1643+ int64_t size, std::string const& content_type, bool allow_overwrite, std::vector<std::string> const& keys,
1644 unity::storage::provider::Context const& ctx) override;
1645 boost::future<std::unique_ptr<unity::storage::provider::UploadJob>> update(
1646- std::string const& item_id, int64_t size, std::string const& old_etag,
1647+ std::string const& item_id, int64_t size, std::string const& old_etag, std::vector<std::string> const& keys,
1648 unity::storage::provider::Context const& ctx) override;
1649
1650 boost::future<std::unique_ptr<unity::storage::provider::DownloadJob>> download(
1651@@ -56,10 +58,12 @@
1652 std::string const& item_id, unity::storage::provider::Context const& ctx) override;
1653 boost::future<unity::storage::provider::Item> move(
1654 std::string const& item_id, std::string const& new_parent_id,
1655- std::string const& new_name, unity::storage::provider::Context const& ctx) override;
1656+ std::string const& new_name, std::vector<std::string> const& keys,
1657+ unity::storage::provider::Context const& ctx) override;
1658 boost::future<unity::storage::provider::Item> copy(
1659 std::string const& item_id, std::string const& new_parent_id,
1660- std::string const& new_name, unity::storage::provider::Context const& ctx) override;
1661+ std::string const& new_name, std::vector<std::string> const& keys,
1662+ unity::storage::provider::Context const& ctx) override;
1663
1664 private:
1665 std::string cmd_;
1666
1667=== modified file 'tests/remote-client/MockProvider.cpp'
1668--- tests/remote-client/MockProvider.cpp 2016-10-17 12:40:31 +0000
1669+++ tests/remote-client/MockProvider.cpp 2016-11-02 04:28:58 +0000
1670@@ -44,7 +44,7 @@
1671 {
1672 }
1673
1674-boost::future<ItemList> MockProvider::roots(Context const&)
1675+boost::future<ItemList> MockProvider::roots(vector<string> const& keys, Context const&)
1676 {
1677 if (cmd_ == "roots_slow")
1678 {
1679@@ -72,7 +72,7 @@
1680 }
1681
1682 boost::future<tuple<ItemList,string>> MockProvider::list(
1683- string const& item_id, string const& page_token,
1684+ string const& item_id, string const& page_token, vector<string> const& keys,
1685 Context const&)
1686 {
1687 if (cmd_ == "list_slow")
1688@@ -156,7 +156,7 @@
1689 }
1690
1691 boost::future<ItemList> MockProvider::lookup(
1692- string const& parent_id, string const& name, Context const&)
1693+ string const& parent_id, string const& name, vector<string> const& keys, Context const&)
1694 {
1695 if (parent_id != "root_id")
1696 {
1697@@ -176,7 +176,7 @@
1698 return make_ready_future<ItemList>(children);
1699 }
1700
1701-boost::future<Item> MockProvider::metadata(string const& item_id, Context const&)
1702+boost::future<Item> MockProvider::metadata(string const& item_id, vector<string> const& keys, Context const&)
1703 {
1704 static int num_calls = 0;
1705
1706@@ -246,7 +246,7 @@
1707 }
1708
1709 boost::future<Item> MockProvider::create_folder(
1710- string const& parent_id, string const& name,
1711+ string const& parent_id, string const& name, vector<string> const& keys,
1712 Context const&)
1713 {
1714 if (cmd_ == "create_folder_returns_file")
1715@@ -260,13 +260,13 @@
1716
1717 boost::future<unique_ptr<UploadJob>> MockProvider::create_file(
1718 string const&, string const&,
1719- int64_t, string const&, bool, Context const&)
1720+ int64_t, string const&, bool, vector<string> const&, Context const&)
1721 {
1722 return make_ready_future<unique_ptr<UploadJob>>(new MockUploadJob(cmd_));
1723 }
1724
1725 boost::future<unique_ptr<UploadJob>> MockProvider::update(
1726- string const&, int64_t, string const&, Context const&)
1727+ string const&, int64_t, string const&, vector<string> const&, Context const&)
1728 {
1729 if (cmd_ == "upload_slow")
1730 {
1731@@ -328,7 +328,7 @@
1732
1733 boost::future<Item> MockProvider::move(
1734 string const& item_id, string const& new_parent_id,
1735- string const& new_name, Context const&)
1736+ string const& new_name, vector<string> const& keys, Context const&)
1737 {
1738 if (cmd_ == "move_returns_root")
1739 {
1740@@ -358,7 +358,7 @@
1741
1742 boost::future<Item> MockProvider::copy(
1743 string const&, string const& new_parent_id,
1744- string const& new_name, Context const&)
1745+ string const& new_name, vector<string> const& keys, Context const&)
1746 {
1747 if (cmd_ == "copy_type_mismatch")
1748 {
1749
1750=== modified file 'tests/remote-client/MockProvider.h'
1751--- tests/remote-client/MockProvider.h 2016-09-08 08:33:59 +0000
1752+++ tests/remote-client/MockProvider.h 2016-11-02 04:28:58 +0000
1753@@ -28,25 +28,27 @@
1754 MockProvider();
1755 MockProvider(std::string const& cmd);
1756
1757- boost::future<unity::storage::provider::ItemList> roots(unity::storage::provider::Context const& ctx) override;
1758+ boost::future<unity::storage::provider::ItemList> roots(std::vector<std::string> const& keys,
1759+ unity::storage::provider::Context const& ctx) override;
1760 boost::future<std::tuple<unity::storage::provider::ItemList, std::string>> list(
1761- std::string const& item_id, std::string const& page_token,
1762+ std::string const& item_id, std::string const& page_token, std::vector<std::string> const& keys,
1763 unity::storage::provider::Context const& ctx) override;
1764 boost::future<unity::storage::provider::ItemList> lookup(
1765- std::string const& parent_id, std::string const& name,
1766+ std::string const& parent_id, std::string const& name, std::vector<std::string> const& keys,
1767 unity::storage::provider::Context const& ctx) override;
1768 boost::future<unity::storage::provider::Item> metadata(
1769- std::string const& item_id, unity::storage::provider::Context const& ctx) override;
1770+ std::string const& item_id, std::vector<std::string> const& keys,
1771+ unity::storage::provider::Context const& ctx) override;
1772 boost::future<unity::storage::provider::Item> create_folder(
1773- std::string const& parent_id, std::string const& name,
1774+ std::string const& parent_id, std::string const& name, std::vector<std::string> const& keys,
1775 unity::storage::provider::Context const& ctx) override;
1776
1777 boost::future<std::unique_ptr<unity::storage::provider::UploadJob>> create_file(
1778 std::string const& parent_id, std::string const& name,
1779- int64_t size, std::string const& content_type, bool allow_overwrite,
1780+ int64_t size, std::string const& content_type, bool allow_overwrite, std::vector<std::string> const& keys,
1781 unity::storage::provider::Context const& ctx) override;
1782 boost::future<std::unique_ptr<unity::storage::provider::UploadJob>> update(
1783- std::string const& item_id, int64_t size, std::string const& old_etag,
1784+ std::string const& item_id, int64_t size, std::string const& old_etag, std::vector<std::string> const& keys,
1785 unity::storage::provider::Context const& ctx) override;
1786
1787 boost::future<std::unique_ptr<unity::storage::provider::DownloadJob>> download(
1788@@ -56,10 +58,12 @@
1789 std::string const& item_id, unity::storage::provider::Context const& ctx) override;
1790 boost::future<unity::storage::provider::Item> move(
1791 std::string const& item_id, std::string const& new_parent_id,
1792- std::string const& new_name, unity::storage::provider::Context const& ctx) override;
1793+ std::string const& new_name, std::vector<std::string> const& keys,
1794+ unity::storage::provider::Context const& ctx) override;
1795 boost::future<unity::storage::provider::Item> copy(
1796 std::string const& item_id, std::string const& new_parent_id,
1797- std::string const& new_name, unity::storage::provider::Context const& ctx) override;
1798+ std::string const& new_name, std::vector<std::string> const& keys,
1799+ unity::storage::provider::Context const& ctx) override;
1800
1801 private:
1802 std::string cmd_;

Subscribers

People subscribed via source and target branches

to all changes: