Merge lp:~michihenning/storage-framework/parent-ids into lp:storage-framework/devel

Proposed by Michi Henning
Status: Merged
Approved by: Michi Henning
Approved revision: 91
Merged at revision: 51
Proposed branch: lp:~michihenning/storage-framework/parent-ids
Merge into: lp:storage-framework/devel
Prerequisite: lp:~michihenning/storage-framework/marshal-metadata
Diff against target: 474 lines (+77/-54)
10 files modified
data/provider.xml (+12/-9)
demo/provider_test/provider-test.cpp (+10/-10)
include/unity/storage/internal/ItemMetadata.h (+2/-1)
include/unity/storage/provider/ProviderBase.h (+1/-1)
src/internal/dbusmarshal.cpp (+2/-2)
src/provider/internal/dbusmarshal.cpp (+16/-7)
src/qt/client/internal/remote_client/ItemImpl.cpp (+1/-1)
src/qt/client/internal/remote_client/validate.cpp (+14/-4)
tests/provider-ProviderInterface/ProviderInterface_test.cpp (+7/-7)
tests/provider-ProviderInterface/TestProvider.cpp (+12/-12)
To merge this branch: bzr merge lp:~michihenning/storage-framework/parent-ids
Reviewer Review Type Date Requested Status
unity-api-1-bot continuous-integration Approve
James Henstridge Approve
Review via email: mp+302376@code.launchpad.net

Commit message

Changed single parent_id to vector<parent_id>.

Description of the change

Changed single parent_id to vector<parent_id>.

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

FAILED: Continuous integration, rev:87
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/57/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build/326/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/332
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=vivid+overlay/259
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=xenial+overlay/259
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=yakkety/259
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/188/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/188/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/188/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/188/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/188/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/188/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/188/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/188/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/188/console

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

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

This looks good, except for the dict entry problem in the type signatures I've noted below.

review: Needs Fixing
Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

PASSED: Continuous integration, rev:89
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/64/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/351
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/357
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=vivid+overlay/278
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=xenial+overlay/278
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=yakkety/278
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/208
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/208/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/208
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/208/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/208
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/208/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/208
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/208/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/208
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/208/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/208
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/208/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/208
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/208/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/208
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/208/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/208
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/208/artifact/output/*zip*/output.zip

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

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

Looks good.

review: Approve
Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

PASSED: Continuous integration, rev:90
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/72/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/363
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/369
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=vivid+overlay/287
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=xenial+overlay/287
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=yakkety/287
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/217
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/217/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/217
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/217/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/217
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/217/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/217
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/217/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/217
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/217/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/217
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/217/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/217
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/217/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/217
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/217/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/217
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/217/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

FAILED: Autolanding.
Merging failed. More details in the following jenkins job:
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-autoland/21/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/365
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/371
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=vivid+overlay/289
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=xenial+overlay/289
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=yakkety/289
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/219
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/219/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/219
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/219/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/219
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/219/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/219
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/219/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/219
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/219/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/219
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/219/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/219
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/219/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/219
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/219/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/219
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/219/artifact/output/*zip*/output.zip

review: Needs Fixing (continuous-integration)
Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :
review: Needs Fixing (continuous-integration)
91. By Michi Henning

Merged devel and resolved conflict.

Revision history for this message
unity-api-1-bot (unity-api-1-bot) :
review: Approve (continuous-integration)

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-07-11 07:17:04 +0000
+++ data/provider.xml 2016-08-11 12:22:58 +0000
@@ -5,14 +5,17 @@
5 com.canonical.StorageFramework.Provider:5 com.canonical.StorageFramework.Provider:
6 @short_description: Interface providing access to a storage account6 @short_description: Interface providing access to a storage account
77
8 For methods dealing with metadata, the representation8 For methods returning metadata, the representation
9 "(ssssia{sv})" is used, where the struct members are:9 "(sasssia{sv})" is used, where the struct members are:
10 - item_id10 - item_id
11 - parent_id11 - parent_ids
12 - name12 - name
13 - etag13 - etag
14 - type (enum: file, folder, root)14 - type (enum: file, folder, root)
15 - metadata15 - metadata
16
17 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.
16 -->19 -->
17 <interface name="com.canonical.StorageFramework.Provider">20 <interface name="com.canonical.StorageFramework.Provider">
18 <!--21 <!--
@@ -25,7 +28,7 @@
25 of files, this list will contain a single item.28 of files, this list will contain a single item.
26 -->29 -->
27 <method name="Roots">30 <method name="Roots">
28 <arg type="a(ssssia{sv})" name="roots" direction="out"/>31 <arg type="a(sasssia{sv})" name="roots" direction="out"/>
29 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList&lt;unity::storage::internal::ItemMetadata&gt;"/>32 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList&lt;unity::storage::internal::ItemMetadata&gt;"/>
30 </method>33 </method>
3134
@@ -45,7 +48,7 @@
45 <method name="List">48 <method name="List">
46 <arg type="s" name="item_id" direction="in"/>49 <arg type="s" name="item_id" direction="in"/>
47 <arg type="s" name="page_token" direction="in"/>50 <arg type="s" name="page_token" direction="in"/>
48 <arg type="a(ssssia{sv})" name="children" direction="out"/>51 <arg type="a(sasssia{sv})" name="children" direction="out"/>
49 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList&lt;unity::storage::internal::ItemMetadata&gt;"/>52 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList&lt;unity::storage::internal::ItemMetadata&gt;"/>
50 <arg type="s" name="next_token" direction="out"/>53 <arg type="s" name="next_token" direction="out"/>
51 </method>54 </method>
@@ -60,7 +63,7 @@
60 <method name="Lookup">63 <method name="Lookup">
61 <arg type="s" name="parent_id" direction="in"/>64 <arg type="s" name="parent_id" direction="in"/>
62 <arg type="s" name="name" direction="in"/>65 <arg type="s" name="name" direction="in"/>
63 <arg type="a(ssssia{sv})" name="items" direction="out"/>66 <arg type="a(sasssia{sv})" name="items" direction="out"/>
64 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList&lt;unity::storage::internal::ItemMetadata&gt;"/>67 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList&lt;unity::storage::internal::ItemMetadata&gt;"/>
65 </method>68 </method>
6669
@@ -72,7 +75,7 @@
72 -->75 -->
73 <method name="Metadata">76 <method name="Metadata">
74 <arg type="s" name="item_id" direction="in"/>77 <arg type="s" name="item_id" direction="in"/>
75 <arg type="(ssssia{sv})" name="metadata" direction="out"/>78 <arg type="(sasssia{sv})" name="metadata" direction="out"/>
76 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="unity::storage::internal::ItemMetadata"/>79 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="unity::storage::internal::ItemMetadata"/>
77 </method>80 </method>
7881
@@ -86,7 +89,7 @@
86 <method name="CreateFolder">89 <method name="CreateFolder">
87 <arg type="s" name="parent_id" direction="in"/>90 <arg type="s" name="parent_id" direction="in"/>
88 <arg type="s" name="name" direction="in"/>91 <arg type="s" name="name" direction="in"/>
89 <arg type="(ssssia{sv})" name="metadata" direction="out"/>92 <arg type="(sasssia{sv})" name="metadata" direction="out"/>
90 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="unity::storage::internal::ItemMetadata"/>93 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="unity::storage::internal::ItemMetadata"/>
91 </method>94 </method>
9295
@@ -160,7 +163,7 @@
160 -->163 -->
161 <method name="FinishUpload">164 <method name="FinishUpload">
162 <arg type="s" name="upload_id" direction="in"/>165 <arg type="s" name="upload_id" direction="in"/>
163 <arg type="(ssssia{sv})" name="metadata" direction="out"/>166 <arg type="(sasssia{sv})" name="metadata" direction="out"/>
164 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="unity::storage::internal::ItemMetadata"/>167 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="unity::storage::internal::ItemMetadata"/>
165 </method>168 </method>
166169
167170
=== modified file 'demo/provider_test/provider-test.cpp'
--- demo/provider_test/provider-test.cpp 2016-08-11 04:07:55 +0000
+++ demo/provider_test/provider-test.cpp 2016-08-11 12:22:58 +0000
@@ -141,7 +141,7 @@
141{141{
142 printf("roots() called by %s (%d)\n", ctx.security_label.c_str(), ctx.pid);142 printf("roots() called by %s (%d)\n", ctx.security_label.c_str(), ctx.pid);
143 ItemList roots = {143 ItemList roots = {
144 {"root_id", "", "Root", "etag", ItemType::root, {}},144 {"root_id", {}, "Root", "etag", ItemType::root, {}},
145 };145 };
146 return make_ready_future<ItemList>(roots);146 return make_ready_future<ItemList>(roots);
147}147}
@@ -162,7 +162,7 @@
162 ItemList children =162 ItemList children =
163 {163 {
164 {164 {
165 "child_id", "root_id", "Child", "etag", ItemType::file,165 "child_id", { "root_id" }, "Child", "etag", ItemType::file,
166 { { SIZE_IN_BYTES, 0 }, { LAST_MODIFIED_TIME, "2007-04-05T14:30Z" } }166 { { SIZE_IN_BYTES, 0 }, { LAST_MODIFIED_TIME, "2007-04-05T14:30Z" } }
167 }167 }
168 };168 };
@@ -181,7 +181,7 @@
181 }181 }
182 ItemList children =182 ItemList children =
183 {183 {
184 { "child_id", "root_id", "Child", "etag", ItemType::file,184 { "child_id", { "root_id" }, "Child", "etag", ItemType::file,
185 { { SIZE_IN_BYTES, 0 }, { LAST_MODIFIED_TIME, "2007-04-05T14:30Z" } } }185 { { SIZE_IN_BYTES, 0 }, { LAST_MODIFIED_TIME, "2007-04-05T14:30Z" } } }
186 };186 };
187 return make_ready_future<ItemList>(children);187 return make_ready_future<ItemList>(children);
@@ -193,21 +193,21 @@
193 printf("metadata('%s') called by %s (%d)\n", item_id.c_str(), ctx.security_label.c_str(), ctx.pid);193 printf("metadata('%s') called by %s (%d)\n", item_id.c_str(), ctx.security_label.c_str(), ctx.pid);
194 if (item_id == "root_id")194 if (item_id == "root_id")
195 {195 {
196 Item metadata{"root_id", "", "Root", "etag", ItemType::root, {}};196 Item metadata{"root_id", {}, "Root", "etag", ItemType::root, {}};
197 return make_ready_future<Item>(metadata);197 return make_ready_future<Item>(metadata);
198 }198 }
199 else if (item_id == "child_id")199 else if (item_id == "child_id")
200 {200 {
201 Item metadata201 Item metadata
202 {202 {
203 "child_id", "root_id", "Child", "etag", ItemType::file,203 "child_id", { "root_id" }, "Child", "etag", ItemType::file,
204 { { SIZE_IN_BYTES, 0 }, { LAST_MODIFIED_TIME, "2007-04-05T14:30Z" } }204 { { SIZE_IN_BYTES, 0 }, { LAST_MODIFIED_TIME, "2007-04-05T14:30Z" } }
205 };205 };
206 return make_ready_future<Item>(metadata);206 return make_ready_future<Item>(metadata);
207 }207 }
208 else if (item_id == "child_folder_id")208 else if (item_id == "child_folder_id")
209 {209 {
210 Item metadata{"child_folder_id", "root_id", "Child_Folder", "etag", ItemType::folder, {}};210 Item metadata{"child_folder_id", { "root_id" }, "Child_Folder", "etag", ItemType::folder, {}};
211 return make_ready_future<Item>(metadata);211 return make_ready_future<Item>(metadata);
212 }212 }
213 return make_exceptional_future<Item>(NotExistsException("metadata(): no such item: " + item_id, item_id));213 return make_exceptional_future<Item>(NotExistsException("metadata(): no such item: " + item_id, item_id));
@@ -218,7 +218,7 @@
218 Context const& ctx)218 Context const& ctx)
219{219{
220 printf("create_folder('%s', '%s') called by %s (%d)\n", parent_id.c_str(), name.c_str(), ctx.security_label.c_str(), ctx.pid);220 printf("create_folder('%s', '%s') called by %s (%d)\n", parent_id.c_str(), name.c_str(), ctx.security_label.c_str(), ctx.pid);
221 Item metadata{"new_folder_id", parent_id, name, "etag", ItemType::folder, {}};221 Item metadata{"new_folder_id", { parent_id }, name, "etag", ItemType::folder, {}};
222 return make_ready_future<Item>(metadata);222 return make_ready_future<Item>(metadata);
223}223}
224224
@@ -273,7 +273,7 @@
273 string const& new_name, Context const& ctx)273 string const& new_name, Context const& ctx)
274{274{
275 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);275 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);
276 Item metadata{item_id, new_parent_id, new_name, "etag", ItemType::file, {}};276 Item metadata{item_id, { new_parent_id }, new_name, "etag", ItemType::file, {}};
277 return make_ready_future(metadata);277 return make_ready_future(metadata);
278}278}
279279
@@ -282,7 +282,7 @@
282 string const& new_name, Context const& ctx)282 string const& new_name, Context const& ctx)
283{283{
284 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);284 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);
285 Item metadata{"new_item_id", new_parent_id, new_name, "etag", ItemType::file, {}};285 Item metadata{"new_item_id", { new_parent_id }, new_name, "etag", ItemType::file, {}};
286 return make_ready_future(metadata);286 return make_ready_future(metadata);
287}287}
288288
@@ -304,7 +304,7 @@
304304
305 Item metadata305 Item metadata
306 {306 {
307 "some_id", "root_id", "some_upload", "etag", ItemType::file,307 "some_id", { "root_id" }, "some_upload", "etag", ItemType::file,
308 { { SIZE_IN_BYTES, 10 }, { LAST_MODIFIED_TIME, "2011-04-05T14:30:10.005Z" } }308 { { SIZE_IN_BYTES, 10 }, { LAST_MODIFIED_TIME, "2011-04-05T14:30:10.005Z" } }
309 };309 };
310 return make_ready_future(metadata);310 return make_ready_future(metadata);
311311
=== modified file 'include/unity/storage/internal/ItemMetadata.h'
--- include/unity/storage/internal/ItemMetadata.h 2016-08-03 03:55:20 +0000
+++ include/unity/storage/internal/ItemMetadata.h 2016-08-11 12:22:58 +0000
@@ -25,6 +25,7 @@
25#pragma GCC diagnostic ignored "-Wswitch-default"25#pragma GCC diagnostic ignored "-Wswitch-default"
26#include <QMap>26#include <QMap>
27#include <QVariant>27#include <QVariant>
28#include <QVector>
28#pragma GCC diagnostic pop29#pragma GCC diagnostic pop
2930
30namespace unity31namespace unity
@@ -37,7 +38,7 @@
37struct ItemMetadata38struct ItemMetadata
38{39{
39 QString item_id;40 QString item_id;
40 QString parent_id;41 QVector<QString> parent_ids;
41 QString name;42 QString name;
42 QString etag;43 QString etag;
43 ItemType type;44 ItemType type;
4445
=== modified file 'include/unity/storage/provider/ProviderBase.h'
--- include/unity/storage/provider/ProviderBase.h 2016-08-09 02:25:13 +0000
+++ include/unity/storage/provider/ProviderBase.h 2016-08-11 12:22:58 +0000
@@ -56,7 +56,7 @@
56struct UNITY_STORAGE_EXPORT Item56struct UNITY_STORAGE_EXPORT Item
57{57{
58 std::string item_id;58 std::string item_id;
59 std::string parent_id;59 std::vector<std::string> parent_ids;
60 std::string name;60 std::string name;
61 std::string etag;61 std::string etag;
62 unity::storage::ItemType type;62 unity::storage::ItemType type;
6363
=== modified file 'src/internal/dbusmarshal.cpp'
--- src/internal/dbusmarshal.cpp 2016-08-11 06:53:25 +0000
+++ src/internal/dbusmarshal.cpp 2016-08-11 12:22:58 +0000
@@ -34,7 +34,7 @@
34{34{
35 argument.beginStructure();35 argument.beginStructure();
36 argument << metadata.item_id;36 argument << metadata.item_id;
37 argument << metadata.parent_id;37 argument << metadata.parent_ids;
38 argument << metadata.name;38 argument << metadata.name;
39 argument << metadata.etag;39 argument << metadata.etag;
40 argument << static_cast<int32_t>(metadata.type);40 argument << static_cast<int32_t>(metadata.type);
@@ -56,7 +56,7 @@
56{56{
57 argument.beginStructure();57 argument.beginStructure();
58 argument >> metadata.item_id;58 argument >> metadata.item_id;
59 argument >> metadata.parent_id;59 argument >> metadata.parent_ids;
60 argument >> metadata.name;60 argument >> metadata.name;
61 argument >> metadata.etag;61 argument >> metadata.etag;
62 int32_t enum_val;62 int32_t enum_val;
6363
=== modified file 'src/provider/internal/dbusmarshal.cpp'
--- src/provider/internal/dbusmarshal.cpp 2016-08-09 02:25:13 +0000
+++ src/provider/internal/dbusmarshal.cpp 2016-08-11 12:22:58 +0000
@@ -53,18 +53,27 @@
53{53{
54 argument.beginStructure();54 argument.beginStructure();
55 argument << QString::fromStdString(item.item_id);55 argument << QString::fromStdString(item.item_id);
56 argument << QString::fromStdString(item.parent_id);56 {
57 argument.beginArray(qMetaTypeId<QString>());
58 for (auto const& id : item.parent_ids)
59 {
60 argument << QString::fromStdString(id);
61 }
62 argument.endArray();
63 }
57 argument << QString::fromStdString(item.name);64 argument << QString::fromStdString(item.name);
58 argument << QString::fromStdString(item.etag);65 argument << QString::fromStdString(item.etag);
59 argument << static_cast<int32_t>(item.type);66 argument << static_cast<int32_t>(item.type);
60 argument.beginMap(QVariant::String, qMetaTypeId<QDBusVariant>());
61 for (auto const& pair : item.metadata)
62 {67 {
63 argument.beginMapEntry();68 argument.beginMap(QVariant::String, qMetaTypeId<QDBusVariant>());
64 argument << QString::fromStdString(pair.first) << to_qdbus_variant(pair.second);69 for (auto const& pair : item.metadata)
65 argument.endMapEntry();70 {
71 argument.beginMapEntry();
72 argument << QString::fromStdString(pair.first) << to_qdbus_variant(pair.second);
73 argument.endMapEntry();
74 }
75 argument.endMap();
66 }76 }
67 argument.endMap();
68 argument.endStructure();77 argument.endStructure();
69 return argument;78 return argument;
70}79}
7180
=== modified file 'src/qt/client/internal/remote_client/ItemImpl.cpp'
--- src/qt/client/internal/remote_client/ItemImpl.cpp 2016-08-09 02:25:13 +0000
+++ src/qt/client/internal/remote_client/ItemImpl.cpp 2016-08-11 12:22:58 +0000
@@ -209,7 +209,7 @@
209{209{
210 throw_if_destroyed("Item::parent_ids()");210 throw_if_destroyed("Item::parent_ids()");
211 // TODO, need different metadata representation, affects xml211 // TODO, need different metadata representation, affects xml
212 return QVector<QString>();212 return md_.parent_ids;
213}213}
214214
215QFuture<void> ItemImpl::delete_item()215QFuture<void> ItemImpl::delete_item()
216216
=== modified file 'src/qt/client/internal/remote_client/validate.cpp'
--- src/qt/client/internal/remote_client/validate.cpp 2016-08-11 04:07:55 +0000
+++ src/qt/client/internal/remote_client/validate.cpp 2016-08-11 12:22:58 +0000
@@ -103,13 +103,23 @@
103 {103 {
104 throw LocalCommsException(prefix + "item_id cannot be empty");104 throw LocalCommsException(prefix + "item_id cannot be empty");
105 }105 }
106 if (md.parent_id.isEmpty() && md.type != ItemType::root)106 if (md.type != ItemType::root)
107 {107 {
108 throw LocalCommsException(prefix + "parent_id of file or folder cannot be empty");108 if (md.parent_ids.isEmpty())
109 {
110 throw LocalCommsException(prefix + "file or folder must have at least one parent ID");
111 }
112 for (int i = 0; i < md.parent_ids.size(); ++i)
113 {
114 if (md.parent_ids.at(i).isEmpty())
115 {
116 throw LocalCommsException(prefix + "parent_id of file or folder cannot be empty");
117 }
118 }
109 }119 }
110 if (!md.parent_id.isEmpty() && md.type == ItemType::root)120 if (md.type == ItemType::root && !md.parent_ids.isEmpty())
111 {121 {
112 throw LocalCommsException(prefix + "metadata: parent_id of root cannot be non-empty");122 throw LocalCommsException(prefix + "metadata: parent_ids of root must be empty");
113 }123 }
114 if (md.name.isEmpty())124 if (md.name.isEmpty())
115 {125 {
116126
=== modified file 'tests/provider-ProviderInterface/ProviderInterface_test.cpp'
--- tests/provider-ProviderInterface/ProviderInterface_test.cpp 2016-08-11 06:18:17 +0000
+++ tests/provider-ProviderInterface/ProviderInterface_test.cpp 2016-08-11 12:22:58 +0000
@@ -125,7 +125,7 @@
125 EXPECT_EQ(1, reply.value().size());125 EXPECT_EQ(1, reply.value().size());
126 auto root = reply.value()[0];126 auto root = reply.value()[0];
127 EXPECT_EQ("root_id", root.item_id);127 EXPECT_EQ("root_id", root.item_id);
128 EXPECT_EQ("", root.parent_id);128 EXPECT_EQ(QVector<QString>(), root.parent_ids);
129 EXPECT_EQ("Root", root.name);129 EXPECT_EQ("Root", root.name);
130 EXPECT_EQ("etag", root.etag);130 EXPECT_EQ("etag", root.etag);
131 EXPECT_EQ(ItemType::root, root.type);131 EXPECT_EQ(ItemType::root, root.type);
@@ -180,7 +180,7 @@
180 ASSERT_EQ(1, items.size());180 ASSERT_EQ(1, items.size());
181 auto item = items[0];181 auto item = items[0];
182 EXPECT_EQ("child_id", item.item_id);182 EXPECT_EQ("child_id", item.item_id);
183 EXPECT_EQ("root_id", item.parent_id);183 EXPECT_EQ(QVector<QString>{ "root_id"}, item.parent_ids);
184 EXPECT_EQ("Filename", item.name);184 EXPECT_EQ("Filename", item.name);
185 EXPECT_EQ(ItemType::file, item.type);185 EXPECT_EQ(ItemType::file, item.type);
186}186}
@@ -194,7 +194,7 @@
194 ASSERT_TRUE(reply.isValid());194 ASSERT_TRUE(reply.isValid());
195 auto item = reply.value();195 auto item = reply.value();
196 EXPECT_EQ("root_id", item.item_id);196 EXPECT_EQ("root_id", item.item_id);
197 EXPECT_EQ("", item.parent_id);197 EXPECT_EQ(QVector<QString>(), item.parent_ids);
198 EXPECT_EQ("Root", item.name);198 EXPECT_EQ("Root", item.name);
199 EXPECT_EQ(ItemType::root, item.type);199 EXPECT_EQ(ItemType::root, item.type);
200}200}
@@ -208,7 +208,7 @@
208 ASSERT_TRUE(reply.isValid());208 ASSERT_TRUE(reply.isValid());
209 auto item = reply.value();209 auto item = reply.value();
210 EXPECT_EQ("new_folder_id", item.item_id);210 EXPECT_EQ("new_folder_id", item.item_id);
211 EXPECT_EQ("root_id", item.parent_id);211 EXPECT_EQ(QVector<QString>{ "root_id" }, item.parent_ids);
212 EXPECT_EQ("New Folder", item.name);212 EXPECT_EQ("New Folder", item.name);
213 EXPECT_EQ(ItemType::folder, item.type);213 EXPECT_EQ(ItemType::folder, item.type);
214}214}
@@ -257,7 +257,7 @@
257 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();257 ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString();
258 auto item = reply.value();258 auto item = reply.value();
259 EXPECT_EQ("new_file_id", item.item_id);259 EXPECT_EQ("new_file_id", item.item_id);
260 EXPECT_EQ("parent_id", item.parent_id);260 EXPECT_EQ(QVector<QString>{ "parent_id" }, item.parent_ids);
261 EXPECT_EQ("file name", item.name);261 EXPECT_EQ("file name", item.name);
262}262}
263263
@@ -493,7 +493,7 @@
493 ASSERT_TRUE(reply.isValid());493 ASSERT_TRUE(reply.isValid());
494 auto item = reply.value();494 auto item = reply.value();
495 EXPECT_EQ("child_id", item.item_id);495 EXPECT_EQ("child_id", item.item_id);
496 EXPECT_EQ("new_parent_id", item.parent_id);496 EXPECT_EQ(QVector<QString>{ "new_parent_id" }, item.parent_ids);
497 EXPECT_EQ("New name", item.name);497 EXPECT_EQ("New name", item.name);
498 EXPECT_EQ(ItemType::file, item.type);498 EXPECT_EQ(ItemType::file, item.type);
499}499}
@@ -507,7 +507,7 @@
507 ASSERT_TRUE(reply.isValid());507 ASSERT_TRUE(reply.isValid());
508 auto item = reply.value();508 auto item = reply.value();
509 EXPECT_EQ("new_id", item.item_id);509 EXPECT_EQ("new_id", item.item_id);
510 EXPECT_EQ("new_parent_id", item.parent_id);510 EXPECT_EQ(QVector<QString>{ "new_parent_id" }, item.parent_ids);
511 EXPECT_EQ("New name", item.name);511 EXPECT_EQ("New name", item.name);
512 EXPECT_EQ(ItemType::file, item.type);512 EXPECT_EQ(ItemType::file, item.type);
513}513}
514514
=== modified file 'tests/provider-ProviderInterface/TestProvider.cpp'
--- tests/provider-ProviderInterface/TestProvider.cpp 2016-08-11 01:36:26 +0000
+++ tests/provider-ProviderInterface/TestProvider.cpp 2016-08-11 12:22:58 +0000
@@ -184,7 +184,7 @@
184 Q_UNUSED(ctx);184 Q_UNUSED(ctx);
185185
186 ItemList roots = {186 ItemList roots = {
187 {"root_id", "", "Root", "etag", ItemType::root, {}},187 {"root_id", {}, "Root", "etag", ItemType::root, {}},
188 };188 };
189 boost::promise<ItemList> p;189 boost::promise<ItemList> p;
190 p.set_value(roots);190 p.set_value(roots);
@@ -205,16 +205,16 @@
205 else if (page_token == "")205 else if (page_token == "")
206 {206 {
207 ItemList children = {207 ItemList children = {
208 {"child1_id", "root_id", "Child 1", "etag", ItemType::file, {}},208 {"child1_id", { "root_id" }, "Child 1", "etag", ItemType::file, {}},
209 {"child2_id", "root_id", "Child 2", "etag", ItemType::file, {}},209 {"child2_id", { "root_id" }, "Child 2", "etag", ItemType::file, {}},
210 };210 };
211 p.set_value(make_tuple(children, "page_token"));211 p.set_value(make_tuple(children, "page_token"));
212 }212 }
213 else if (page_token == "page_token")213 else if (page_token == "page_token")
214 {214 {
215 ItemList children = {215 ItemList children = {
216 {"child3_id", "root_id", "Child 4", "etag", ItemType::file, {}},216 {"child3_id", { "root_id" }, "Child 4", "etag", ItemType::file, {}},
217 {"child4_id", "root_id", "Child 3", "etag", ItemType::file, {}},217 {"child4_id", { "root_id" }, "Child 3", "etag", ItemType::file, {}},
218 };218 };
219 p.set_value(make_tuple(children, ""));219 p.set_value(make_tuple(children, ""));
220 }220 }
@@ -232,7 +232,7 @@
232232
233 boost::promise<ItemList> p;233 boost::promise<ItemList> p;
234 ItemList items = {234 ItemList items = {
235 {"child_id", parent_id, name, "etag", ItemType::file, {}},235 {"child_id", { parent_id }, name, "etag", ItemType::file, {}},
236 };236 };
237 p.set_value(items);237 p.set_value(items);
238 return p.get_future();238 return p.get_future();
@@ -246,7 +246,7 @@
246 boost::promise<Item> p;246 boost::promise<Item> p;
247 if (item_id == "root_id")247 if (item_id == "root_id")
248 {248 {
249 Item item = {"root_id", "", "Root", "etag", ItemType::root, {}};249 Item item = {"root_id", {}, "Root", "etag", ItemType::root, {}};
250 p.set_value(item);250 p.set_value(item);
251 }251 }
252 else252 else
@@ -262,7 +262,7 @@
262 Q_UNUSED(ctx);262 Q_UNUSED(ctx);
263263
264 boost::promise<Item> p;264 boost::promise<Item> p;
265 Item item = {"new_folder_id", parent_id, name, "etag", ItemType::folder, {}};265 Item item = {"new_folder_id", { parent_id }, name, "etag", ItemType::folder, {}};
266 p.set_value(item);266 p.set_value(item);
267 return p.get_future();267 return p.get_future();
268}268}
@@ -277,7 +277,7 @@
277 Q_UNUSED(ctx);277 Q_UNUSED(ctx);
278278
279 boost::promise<unique_ptr<UploadJob>> p;279 boost::promise<unique_ptr<UploadJob>> p;
280 Item item = {"new_file_id", parent_id, name, "etag", ItemType::file, {}};280 Item item = {"new_file_id", { parent_id }, name, "etag", ItemType::file, {}};
281 p.set_value(unique_ptr<UploadJob>(new TestUploadJob("upload_id", item, size)));281 p.set_value(unique_ptr<UploadJob>(new TestUploadJob("upload_id", item, size)));
282 return p.get_future();282 return p.get_future();
283}283}
@@ -291,7 +291,7 @@
291 Q_UNUSED(ctx);291 Q_UNUSED(ctx);
292292
293 boost::promise<unique_ptr<UploadJob>> p;293 boost::promise<unique_ptr<UploadJob>> p;
294 Item item = {"item_id", "parent_id", "file name", "etag", ItemType::file, {}};294 Item item = {"item_id", { "parent_id" }, "file name", "etag", ItemType::file, {}};
295 p.set_value(unique_ptr<UploadJob>(new TestUploadJob("upload_id", item, size)));295 p.set_value(unique_ptr<UploadJob>(new TestUploadJob("upload_id", item, size)));
296 return p.get_future();296 return p.get_future();
297}297}
@@ -332,7 +332,7 @@
332 Q_UNUSED(ctx);332 Q_UNUSED(ctx);
333333
334 boost::promise<Item> p;334 boost::promise<Item> p;
335 Item item = {item_id, new_parent_id, new_name, "etag", ItemType::file, {}};335 Item item = {item_id, { new_parent_id }, new_name, "etag", ItemType::file, {}};
336 p.set_value(item);336 p.set_value(item);
337 return p.get_future();337 return p.get_future();
338}338}
@@ -345,7 +345,7 @@
345 Q_UNUSED(ctx);345 Q_UNUSED(ctx);
346346
347 boost::promise<Item> p;347 boost::promise<Item> p;
348 Item item = {"new_id", new_parent_id, new_name, "etag", ItemType::file, {}};348 Item item = {"new_id", { new_parent_id }, new_name, "etag", ItemType::file, {}};
349 p.set_value(item);349 p.set_value(item);
350 return p.get_future();350 return p.get_future();
351}351}

Subscribers

People subscribed via source and target branches

to all changes: