Merge lp:~michihenning/storage-framework/parent-ids into lp:storage-framework/devel
- parent-ids
- Merge into devel
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 |
Related bugs: |
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>.
unity-api-1-bot (unity-api-1-bot) wrote : | # |
James Henstridge (jamesh) wrote : | # |
This looks good, except for the dict entry problem in the type signatures I've noted below.
unity-api-1-bot (unity-api-1-bot) wrote : | # |
FAILED: Continuous integration, rev:88
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
unity-api-1-bot (unity-api-1-bot) wrote : | # |
PASSED: Continuous integration, rev:89
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
unity-api-1-bot (unity-api-1-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
unity-api-1-bot (unity-api-1-bot) wrote : | # |
PASSED: Continuous integration, rev:90
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
unity-api-1-bot (unity-api-1-bot) wrote : | # |
FAILED: Autolanding.
Merging failed. More details in the following jenkins job:
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
unity-api-1-bot (unity-api-1-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
- 91. By Michi Henning
-
Merged devel and resolved conflict.
unity-api-1-bot (unity-api-1-bot) : | # |
Preview Diff
1 | === modified file 'data/provider.xml' | |||
2 | --- data/provider.xml 2016-07-11 07:17:04 +0000 | |||
3 | +++ data/provider.xml 2016-08-11 12:22:58 +0000 | |||
4 | @@ -5,14 +5,17 @@ | |||
5 | 5 | com.canonical.StorageFramework.Provider: | 5 | com.canonical.StorageFramework.Provider: |
6 | 6 | @short_description: Interface providing access to a storage account | 6 | @short_description: Interface providing access to a storage account |
7 | 7 | 7 | ||
10 | 8 | For methods dealing with metadata, the representation | 8 | For methods returning metadata, the representation |
11 | 9 | "(ssssia{sv})" is used, where the struct members are: | 9 | "(sasssia{sv})" is used, where the struct members are: |
12 | 10 | - item_id | 10 | - item_id |
14 | 11 | - parent_id | 11 | - parent_ids |
15 | 12 | - name | 12 | - name |
16 | 13 | - etag | 13 | - etag |
17 | 14 | - type (enum: file, folder, root) | 14 | - type (enum: file, folder, root) |
18 | 15 | - metadata | 15 | - metadata |
19 | 16 | |||
20 | 17 | Note that parent_ids is a sequence of IDs instead of a single ID to allow the client to | ||
21 | 18 | navigate items in Google Drive, which permits more than one parent for a file or folder. | ||
22 | 16 | --> | 19 | --> |
23 | 17 | <interface name="com.canonical.StorageFramework.Provider"> | 20 | <interface name="com.canonical.StorageFramework.Provider"> |
24 | 18 | <!-- | 21 | <!-- |
25 | @@ -25,7 +28,7 @@ | |||
26 | 25 | of files, this list will contain a single item. | 28 | of files, this list will contain a single item. |
27 | 26 | --> | 29 | --> |
28 | 27 | <method name="Roots"> | 30 | <method name="Roots"> |
30 | 28 | <arg type="a(ssssia{sv})" name="roots" direction="out"/> | 31 | <arg type="a(sasssia{sv})" name="roots" direction="out"/> |
31 | 29 | <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList<unity::storage::internal::ItemMetadata>"/> | 32 | <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList<unity::storage::internal::ItemMetadata>"/> |
32 | 30 | </method> | 33 | </method> |
33 | 31 | 34 | ||
34 | @@ -45,7 +48,7 @@ | |||
35 | 45 | <method name="List"> | 48 | <method name="List"> |
36 | 46 | <arg type="s" name="item_id" direction="in"/> | 49 | <arg type="s" name="item_id" direction="in"/> |
37 | 47 | <arg type="s" name="page_token" direction="in"/> | 50 | <arg type="s" name="page_token" direction="in"/> |
39 | 48 | <arg type="a(ssssia{sv})" name="children" direction="out"/> | 51 | <arg type="a(sasssia{sv})" name="children" direction="out"/> |
40 | 49 | <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList<unity::storage::internal::ItemMetadata>"/> | 52 | <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList<unity::storage::internal::ItemMetadata>"/> |
41 | 50 | <arg type="s" name="next_token" direction="out"/> | 53 | <arg type="s" name="next_token" direction="out"/> |
42 | 51 | </method> | 54 | </method> |
43 | @@ -60,7 +63,7 @@ | |||
44 | 60 | <method name="Lookup"> | 63 | <method name="Lookup"> |
45 | 61 | <arg type="s" name="parent_id" direction="in"/> | 64 | <arg type="s" name="parent_id" direction="in"/> |
46 | 62 | <arg type="s" name="name" direction="in"/> | 65 | <arg type="s" name="name" direction="in"/> |
48 | 63 | <arg type="a(ssssia{sv})" name="items" direction="out"/> | 66 | <arg type="a(sasssia{sv})" name="items" direction="out"/> |
49 | 64 | <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList<unity::storage::internal::ItemMetadata>"/> | 67 | <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList<unity::storage::internal::ItemMetadata>"/> |
50 | 65 | </method> | 68 | </method> |
51 | 66 | 69 | ||
52 | @@ -72,7 +75,7 @@ | |||
53 | 72 | --> | 75 | --> |
54 | 73 | <method name="Metadata"> | 76 | <method name="Metadata"> |
55 | 74 | <arg type="s" name="item_id" direction="in"/> | 77 | <arg type="s" name="item_id" direction="in"/> |
57 | 75 | <arg type="(ssssia{sv})" name="metadata" direction="out"/> | 78 | <arg type="(sasssia{sv})" name="metadata" direction="out"/> |
58 | 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"/> |
59 | 77 | </method> | 80 | </method> |
60 | 78 | 81 | ||
61 | @@ -86,7 +89,7 @@ | |||
62 | 86 | <method name="CreateFolder"> | 89 | <method name="CreateFolder"> |
63 | 87 | <arg type="s" name="parent_id" direction="in"/> | 90 | <arg type="s" name="parent_id" direction="in"/> |
64 | 88 | <arg type="s" name="name" direction="in"/> | 91 | <arg type="s" name="name" direction="in"/> |
66 | 89 | <arg type="(ssssia{sv})" name="metadata" direction="out"/> | 92 | <arg type="(sasssia{sv})" name="metadata" direction="out"/> |
67 | 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"/> |
68 | 91 | </method> | 94 | </method> |
69 | 92 | 95 | ||
70 | @@ -160,7 +163,7 @@ | |||
71 | 160 | --> | 163 | --> |
72 | 161 | <method name="FinishUpload"> | 164 | <method name="FinishUpload"> |
73 | 162 | <arg type="s" name="upload_id" direction="in"/> | 165 | <arg type="s" name="upload_id" direction="in"/> |
75 | 163 | <arg type="(ssssia{sv})" name="metadata" direction="out"/> | 166 | <arg type="(sasssia{sv})" name="metadata" direction="out"/> |
76 | 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"/> |
77 | 165 | </method> | 168 | </method> |
78 | 166 | 169 | ||
79 | 167 | 170 | ||
80 | === modified file 'demo/provider_test/provider-test.cpp' | |||
81 | --- demo/provider_test/provider-test.cpp 2016-08-11 04:07:55 +0000 | |||
82 | +++ demo/provider_test/provider-test.cpp 2016-08-11 12:22:58 +0000 | |||
83 | @@ -141,7 +141,7 @@ | |||
84 | 141 | { | 141 | { |
85 | 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); |
86 | 143 | ItemList roots = { | 143 | ItemList roots = { |
88 | 144 | {"root_id", "", "Root", "etag", ItemType::root, {}}, | 144 | {"root_id", {}, "Root", "etag", ItemType::root, {}}, |
89 | 145 | }; | 145 | }; |
90 | 146 | return make_ready_future<ItemList>(roots); | 146 | return make_ready_future<ItemList>(roots); |
91 | 147 | } | 147 | } |
92 | @@ -162,7 +162,7 @@ | |||
93 | 162 | ItemList children = | 162 | ItemList children = |
94 | 163 | { | 163 | { |
95 | 164 | { | 164 | { |
97 | 165 | "child_id", "root_id", "Child", "etag", ItemType::file, | 165 | "child_id", { "root_id" }, "Child", "etag", ItemType::file, |
98 | 166 | { { SIZE_IN_BYTES, 0 }, { LAST_MODIFIED_TIME, "2007-04-05T14:30Z" } } | 166 | { { SIZE_IN_BYTES, 0 }, { LAST_MODIFIED_TIME, "2007-04-05T14:30Z" } } |
99 | 167 | } | 167 | } |
100 | 168 | }; | 168 | }; |
101 | @@ -181,7 +181,7 @@ | |||
102 | 181 | } | 181 | } |
103 | 182 | ItemList children = | 182 | ItemList children = |
104 | 183 | { | 183 | { |
106 | 184 | { "child_id", "root_id", "Child", "etag", ItemType::file, | 184 | { "child_id", { "root_id" }, "Child", "etag", ItemType::file, |
107 | 185 | { { SIZE_IN_BYTES, 0 }, { LAST_MODIFIED_TIME, "2007-04-05T14:30Z" } } } | 185 | { { SIZE_IN_BYTES, 0 }, { LAST_MODIFIED_TIME, "2007-04-05T14:30Z" } } } |
108 | 186 | }; | 186 | }; |
109 | 187 | return make_ready_future<ItemList>(children); | 187 | return make_ready_future<ItemList>(children); |
110 | @@ -193,21 +193,21 @@ | |||
111 | 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); |
112 | 194 | if (item_id == "root_id") | 194 | if (item_id == "root_id") |
113 | 195 | { | 195 | { |
115 | 196 | Item metadata{"root_id", "", "Root", "etag", ItemType::root, {}}; | 196 | Item metadata{"root_id", {}, "Root", "etag", ItemType::root, {}}; |
116 | 197 | return make_ready_future<Item>(metadata); | 197 | return make_ready_future<Item>(metadata); |
117 | 198 | } | 198 | } |
118 | 199 | else if (item_id == "child_id") | 199 | else if (item_id == "child_id") |
119 | 200 | { | 200 | { |
120 | 201 | Item metadata | 201 | Item metadata |
121 | 202 | { | 202 | { |
123 | 203 | "child_id", "root_id", "Child", "etag", ItemType::file, | 203 | "child_id", { "root_id" }, "Child", "etag", ItemType::file, |
124 | 204 | { { SIZE_IN_BYTES, 0 }, { LAST_MODIFIED_TIME, "2007-04-05T14:30Z" } } | 204 | { { SIZE_IN_BYTES, 0 }, { LAST_MODIFIED_TIME, "2007-04-05T14:30Z" } } |
125 | 205 | }; | 205 | }; |
126 | 206 | return make_ready_future<Item>(metadata); | 206 | return make_ready_future<Item>(metadata); |
127 | 207 | } | 207 | } |
128 | 208 | else if (item_id == "child_folder_id") | 208 | else if (item_id == "child_folder_id") |
129 | 209 | { | 209 | { |
131 | 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, {}}; |
132 | 211 | return make_ready_future<Item>(metadata); | 211 | return make_ready_future<Item>(metadata); |
133 | 212 | } | 212 | } |
134 | 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)); |
135 | @@ -218,7 +218,7 @@ | |||
136 | 218 | Context const& ctx) | 218 | Context const& ctx) |
137 | 219 | { | 219 | { |
138 | 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); |
140 | 221 | Item metadata{"new_folder_id", parent_id, name, "etag", ItemType::folder, {}}; | 221 | Item metadata{"new_folder_id", { parent_id }, name, "etag", ItemType::folder, {}}; |
141 | 222 | return make_ready_future<Item>(metadata); | 222 | return make_ready_future<Item>(metadata); |
142 | 223 | } | 223 | } |
143 | 224 | 224 | ||
144 | @@ -273,7 +273,7 @@ | |||
145 | 273 | string const& new_name, Context const& ctx) | 273 | string const& new_name, Context const& ctx) |
146 | 274 | { | 274 | { |
147 | 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); |
149 | 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, {}}; |
150 | 277 | return make_ready_future(metadata); | 277 | return make_ready_future(metadata); |
151 | 278 | } | 278 | } |
152 | 279 | 279 | ||
153 | @@ -282,7 +282,7 @@ | |||
154 | 282 | string const& new_name, Context const& ctx) | 282 | string const& new_name, Context const& ctx) |
155 | 283 | { | 283 | { |
156 | 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); |
158 | 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, {}}; |
159 | 286 | return make_ready_future(metadata); | 286 | return make_ready_future(metadata); |
160 | 287 | } | 287 | } |
161 | 288 | 288 | ||
162 | @@ -304,7 +304,7 @@ | |||
163 | 304 | 304 | ||
164 | 305 | Item metadata | 305 | Item metadata |
165 | 306 | { | 306 | { |
167 | 307 | "some_id", "root_id", "some_upload", "etag", ItemType::file, | 307 | "some_id", { "root_id" }, "some_upload", "etag", ItemType::file, |
168 | 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" } } |
169 | 309 | }; | 309 | }; |
170 | 310 | return make_ready_future(metadata); | 310 | return make_ready_future(metadata); |
171 | 311 | 311 | ||
172 | === modified file 'include/unity/storage/internal/ItemMetadata.h' | |||
173 | --- include/unity/storage/internal/ItemMetadata.h 2016-08-03 03:55:20 +0000 | |||
174 | +++ include/unity/storage/internal/ItemMetadata.h 2016-08-11 12:22:58 +0000 | |||
175 | @@ -25,6 +25,7 @@ | |||
176 | 25 | #pragma GCC diagnostic ignored "-Wswitch-default" | 25 | #pragma GCC diagnostic ignored "-Wswitch-default" |
177 | 26 | #include <QMap> | 26 | #include <QMap> |
178 | 27 | #include <QVariant> | 27 | #include <QVariant> |
179 | 28 | #include <QVector> | ||
180 | 28 | #pragma GCC diagnostic pop | 29 | #pragma GCC diagnostic pop |
181 | 29 | 30 | ||
182 | 30 | namespace unity | 31 | namespace unity |
183 | @@ -37,7 +38,7 @@ | |||
184 | 37 | struct ItemMetadata | 38 | struct ItemMetadata |
185 | 38 | { | 39 | { |
186 | 39 | QString item_id; | 40 | QString item_id; |
188 | 40 | QString parent_id; | 41 | QVector<QString> parent_ids; |
189 | 41 | QString name; | 42 | QString name; |
190 | 42 | QString etag; | 43 | QString etag; |
191 | 43 | ItemType type; | 44 | ItemType type; |
192 | 44 | 45 | ||
193 | === modified file 'include/unity/storage/provider/ProviderBase.h' | |||
194 | --- include/unity/storage/provider/ProviderBase.h 2016-08-09 02:25:13 +0000 | |||
195 | +++ include/unity/storage/provider/ProviderBase.h 2016-08-11 12:22:58 +0000 | |||
196 | @@ -56,7 +56,7 @@ | |||
197 | 56 | struct UNITY_STORAGE_EXPORT Item | 56 | struct UNITY_STORAGE_EXPORT Item |
198 | 57 | { | 57 | { |
199 | 58 | std::string item_id; | 58 | std::string item_id; |
201 | 59 | std::string parent_id; | 59 | std::vector<std::string> parent_ids; |
202 | 60 | std::string name; | 60 | std::string name; |
203 | 61 | std::string etag; | 61 | std::string etag; |
204 | 62 | unity::storage::ItemType type; | 62 | unity::storage::ItemType type; |
205 | 63 | 63 | ||
206 | === modified file 'src/internal/dbusmarshal.cpp' | |||
207 | --- src/internal/dbusmarshal.cpp 2016-08-11 06:53:25 +0000 | |||
208 | +++ src/internal/dbusmarshal.cpp 2016-08-11 12:22:58 +0000 | |||
209 | @@ -34,7 +34,7 @@ | |||
210 | 34 | { | 34 | { |
211 | 35 | argument.beginStructure(); | 35 | argument.beginStructure(); |
212 | 36 | argument << metadata.item_id; | 36 | argument << metadata.item_id; |
214 | 37 | argument << metadata.parent_id; | 37 | argument << metadata.parent_ids; |
215 | 38 | argument << metadata.name; | 38 | argument << metadata.name; |
216 | 39 | argument << metadata.etag; | 39 | argument << metadata.etag; |
217 | 40 | argument << static_cast<int32_t>(metadata.type); | 40 | argument << static_cast<int32_t>(metadata.type); |
218 | @@ -56,7 +56,7 @@ | |||
219 | 56 | { | 56 | { |
220 | 57 | argument.beginStructure(); | 57 | argument.beginStructure(); |
221 | 58 | argument >> metadata.item_id; | 58 | argument >> metadata.item_id; |
223 | 59 | argument >> metadata.parent_id; | 59 | argument >> metadata.parent_ids; |
224 | 60 | argument >> metadata.name; | 60 | argument >> metadata.name; |
225 | 61 | argument >> metadata.etag; | 61 | argument >> metadata.etag; |
226 | 62 | int32_t enum_val; | 62 | int32_t enum_val; |
227 | 63 | 63 | ||
228 | === modified file 'src/provider/internal/dbusmarshal.cpp' | |||
229 | --- src/provider/internal/dbusmarshal.cpp 2016-08-09 02:25:13 +0000 | |||
230 | +++ src/provider/internal/dbusmarshal.cpp 2016-08-11 12:22:58 +0000 | |||
231 | @@ -53,18 +53,27 @@ | |||
232 | 53 | { | 53 | { |
233 | 54 | argument.beginStructure(); | 54 | argument.beginStructure(); |
234 | 55 | argument << QString::fromStdString(item.item_id); | 55 | argument << QString::fromStdString(item.item_id); |
236 | 56 | argument << QString::fromStdString(item.parent_id); | 56 | { |
237 | 57 | argument.beginArray(qMetaTypeId<QString>()); | ||
238 | 58 | for (auto const& id : item.parent_ids) | ||
239 | 59 | { | ||
240 | 60 | argument << QString::fromStdString(id); | ||
241 | 61 | } | ||
242 | 62 | argument.endArray(); | ||
243 | 63 | } | ||
244 | 57 | argument << QString::fromStdString(item.name); | 64 | argument << QString::fromStdString(item.name); |
245 | 58 | argument << QString::fromStdString(item.etag); | 65 | argument << QString::fromStdString(item.etag); |
246 | 59 | argument << static_cast<int32_t>(item.type); | 66 | argument << static_cast<int32_t>(item.type); |
247 | 60 | argument.beginMap(QVariant::String, qMetaTypeId<QDBusVariant>()); | ||
248 | 61 | for (auto const& pair : item.metadata) | ||
249 | 62 | { | 67 | { |
253 | 63 | argument.beginMapEntry(); | 68 | argument.beginMap(QVariant::String, qMetaTypeId<QDBusVariant>()); |
254 | 64 | argument << QString::fromStdString(pair.first) << to_qdbus_variant(pair.second); | 69 | for (auto const& pair : item.metadata) |
255 | 65 | argument.endMapEntry(); | 70 | { |
256 | 71 | argument.beginMapEntry(); | ||
257 | 72 | argument << QString::fromStdString(pair.first) << to_qdbus_variant(pair.second); | ||
258 | 73 | argument.endMapEntry(); | ||
259 | 74 | } | ||
260 | 75 | argument.endMap(); | ||
261 | 66 | } | 76 | } |
262 | 67 | argument.endMap(); | ||
263 | 68 | argument.endStructure(); | 77 | argument.endStructure(); |
264 | 69 | return argument; | 78 | return argument; |
265 | 70 | } | 79 | } |
266 | 71 | 80 | ||
267 | === modified file 'src/qt/client/internal/remote_client/ItemImpl.cpp' | |||
268 | --- src/qt/client/internal/remote_client/ItemImpl.cpp 2016-08-09 02:25:13 +0000 | |||
269 | +++ src/qt/client/internal/remote_client/ItemImpl.cpp 2016-08-11 12:22:58 +0000 | |||
270 | @@ -209,7 +209,7 @@ | |||
271 | 209 | { | 209 | { |
272 | 210 | throw_if_destroyed("Item::parent_ids()"); | 210 | throw_if_destroyed("Item::parent_ids()"); |
273 | 211 | // TODO, need different metadata representation, affects xml | 211 | // TODO, need different metadata representation, affects xml |
275 | 212 | return QVector<QString>(); | 212 | return md_.parent_ids; |
276 | 213 | } | 213 | } |
277 | 214 | 214 | ||
278 | 215 | QFuture<void> ItemImpl::delete_item() | 215 | QFuture<void> ItemImpl::delete_item() |
279 | 216 | 216 | ||
280 | === modified file 'src/qt/client/internal/remote_client/validate.cpp' | |||
281 | --- src/qt/client/internal/remote_client/validate.cpp 2016-08-11 04:07:55 +0000 | |||
282 | +++ src/qt/client/internal/remote_client/validate.cpp 2016-08-11 12:22:58 +0000 | |||
283 | @@ -103,13 +103,23 @@ | |||
284 | 103 | { | 103 | { |
285 | 104 | throw LocalCommsException(prefix + "item_id cannot be empty"); | 104 | throw LocalCommsException(prefix + "item_id cannot be empty"); |
286 | 105 | } | 105 | } |
288 | 106 | if (md.parent_id.isEmpty() && md.type != ItemType::root) | 106 | if (md.type != ItemType::root) |
289 | 107 | { | 107 | { |
291 | 108 | throw LocalCommsException(prefix + "parent_id of file or folder cannot be empty"); | 108 | if (md.parent_ids.isEmpty()) |
292 | 109 | { | ||
293 | 110 | throw LocalCommsException(prefix + "file or folder must have at least one parent ID"); | ||
294 | 111 | } | ||
295 | 112 | for (int i = 0; i < md.parent_ids.size(); ++i) | ||
296 | 113 | { | ||
297 | 114 | if (md.parent_ids.at(i).isEmpty()) | ||
298 | 115 | { | ||
299 | 116 | throw LocalCommsException(prefix + "parent_id of file or folder cannot be empty"); | ||
300 | 117 | } | ||
301 | 118 | } | ||
302 | 109 | } | 119 | } |
304 | 110 | if (!md.parent_id.isEmpty() && md.type == ItemType::root) | 120 | if (md.type == ItemType::root && !md.parent_ids.isEmpty()) |
305 | 111 | { | 121 | { |
307 | 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"); |
308 | 113 | } | 123 | } |
309 | 114 | if (md.name.isEmpty()) | 124 | if (md.name.isEmpty()) |
310 | 115 | { | 125 | { |
311 | 116 | 126 | ||
312 | === modified file 'tests/provider-ProviderInterface/ProviderInterface_test.cpp' | |||
313 | --- tests/provider-ProviderInterface/ProviderInterface_test.cpp 2016-08-11 06:18:17 +0000 | |||
314 | +++ tests/provider-ProviderInterface/ProviderInterface_test.cpp 2016-08-11 12:22:58 +0000 | |||
315 | @@ -125,7 +125,7 @@ | |||
316 | 125 | EXPECT_EQ(1, reply.value().size()); | 125 | EXPECT_EQ(1, reply.value().size()); |
317 | 126 | auto root = reply.value()[0]; | 126 | auto root = reply.value()[0]; |
318 | 127 | EXPECT_EQ("root_id", root.item_id); | 127 | EXPECT_EQ("root_id", root.item_id); |
320 | 128 | EXPECT_EQ("", root.parent_id); | 128 | EXPECT_EQ(QVector<QString>(), root.parent_ids); |
321 | 129 | EXPECT_EQ("Root", root.name); | 129 | EXPECT_EQ("Root", root.name); |
322 | 130 | EXPECT_EQ("etag", root.etag); | 130 | EXPECT_EQ("etag", root.etag); |
323 | 131 | EXPECT_EQ(ItemType::root, root.type); | 131 | EXPECT_EQ(ItemType::root, root.type); |
324 | @@ -180,7 +180,7 @@ | |||
325 | 180 | ASSERT_EQ(1, items.size()); | 180 | ASSERT_EQ(1, items.size()); |
326 | 181 | auto item = items[0]; | 181 | auto item = items[0]; |
327 | 182 | EXPECT_EQ("child_id", item.item_id); | 182 | EXPECT_EQ("child_id", item.item_id); |
329 | 183 | EXPECT_EQ("root_id", item.parent_id); | 183 | EXPECT_EQ(QVector<QString>{ "root_id"}, item.parent_ids); |
330 | 184 | EXPECT_EQ("Filename", item.name); | 184 | EXPECT_EQ("Filename", item.name); |
331 | 185 | EXPECT_EQ(ItemType::file, item.type); | 185 | EXPECT_EQ(ItemType::file, item.type); |
332 | 186 | } | 186 | } |
333 | @@ -194,7 +194,7 @@ | |||
334 | 194 | ASSERT_TRUE(reply.isValid()); | 194 | ASSERT_TRUE(reply.isValid()); |
335 | 195 | auto item = reply.value(); | 195 | auto item = reply.value(); |
336 | 196 | EXPECT_EQ("root_id", item.item_id); | 196 | EXPECT_EQ("root_id", item.item_id); |
338 | 197 | EXPECT_EQ("", item.parent_id); | 197 | EXPECT_EQ(QVector<QString>(), item.parent_ids); |
339 | 198 | EXPECT_EQ("Root", item.name); | 198 | EXPECT_EQ("Root", item.name); |
340 | 199 | EXPECT_EQ(ItemType::root, item.type); | 199 | EXPECT_EQ(ItemType::root, item.type); |
341 | 200 | } | 200 | } |
342 | @@ -208,7 +208,7 @@ | |||
343 | 208 | ASSERT_TRUE(reply.isValid()); | 208 | ASSERT_TRUE(reply.isValid()); |
344 | 209 | auto item = reply.value(); | 209 | auto item = reply.value(); |
345 | 210 | EXPECT_EQ("new_folder_id", item.item_id); | 210 | EXPECT_EQ("new_folder_id", item.item_id); |
347 | 211 | EXPECT_EQ("root_id", item.parent_id); | 211 | EXPECT_EQ(QVector<QString>{ "root_id" }, item.parent_ids); |
348 | 212 | EXPECT_EQ("New Folder", item.name); | 212 | EXPECT_EQ("New Folder", item.name); |
349 | 213 | EXPECT_EQ(ItemType::folder, item.type); | 213 | EXPECT_EQ(ItemType::folder, item.type); |
350 | 214 | } | 214 | } |
351 | @@ -257,7 +257,7 @@ | |||
352 | 257 | ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString(); | 257 | ASSERT_TRUE(reply.isValid()) << reply.error().message().toStdString(); |
353 | 258 | auto item = reply.value(); | 258 | auto item = reply.value(); |
354 | 259 | EXPECT_EQ("new_file_id", item.item_id); | 259 | EXPECT_EQ("new_file_id", item.item_id); |
356 | 260 | EXPECT_EQ("parent_id", item.parent_id); | 260 | EXPECT_EQ(QVector<QString>{ "parent_id" }, item.parent_ids); |
357 | 261 | EXPECT_EQ("file name", item.name); | 261 | EXPECT_EQ("file name", item.name); |
358 | 262 | } | 262 | } |
359 | 263 | 263 | ||
360 | @@ -493,7 +493,7 @@ | |||
361 | 493 | ASSERT_TRUE(reply.isValid()); | 493 | ASSERT_TRUE(reply.isValid()); |
362 | 494 | auto item = reply.value(); | 494 | auto item = reply.value(); |
363 | 495 | EXPECT_EQ("child_id", item.item_id); | 495 | EXPECT_EQ("child_id", item.item_id); |
365 | 496 | EXPECT_EQ("new_parent_id", item.parent_id); | 496 | EXPECT_EQ(QVector<QString>{ "new_parent_id" }, item.parent_ids); |
366 | 497 | EXPECT_EQ("New name", item.name); | 497 | EXPECT_EQ("New name", item.name); |
367 | 498 | EXPECT_EQ(ItemType::file, item.type); | 498 | EXPECT_EQ(ItemType::file, item.type); |
368 | 499 | } | 499 | } |
369 | @@ -507,7 +507,7 @@ | |||
370 | 507 | ASSERT_TRUE(reply.isValid()); | 507 | ASSERT_TRUE(reply.isValid()); |
371 | 508 | auto item = reply.value(); | 508 | auto item = reply.value(); |
372 | 509 | EXPECT_EQ("new_id", item.item_id); | 509 | EXPECT_EQ("new_id", item.item_id); |
374 | 510 | EXPECT_EQ("new_parent_id", item.parent_id); | 510 | EXPECT_EQ(QVector<QString>{ "new_parent_id" }, item.parent_ids); |
375 | 511 | EXPECT_EQ("New name", item.name); | 511 | EXPECT_EQ("New name", item.name); |
376 | 512 | EXPECT_EQ(ItemType::file, item.type); | 512 | EXPECT_EQ(ItemType::file, item.type); |
377 | 513 | } | 513 | } |
378 | 514 | 514 | ||
379 | === modified file 'tests/provider-ProviderInterface/TestProvider.cpp' | |||
380 | --- tests/provider-ProviderInterface/TestProvider.cpp 2016-08-11 01:36:26 +0000 | |||
381 | +++ tests/provider-ProviderInterface/TestProvider.cpp 2016-08-11 12:22:58 +0000 | |||
382 | @@ -184,7 +184,7 @@ | |||
383 | 184 | Q_UNUSED(ctx); | 184 | Q_UNUSED(ctx); |
384 | 185 | 185 | ||
385 | 186 | ItemList roots = { | 186 | ItemList roots = { |
387 | 187 | {"root_id", "", "Root", "etag", ItemType::root, {}}, | 187 | {"root_id", {}, "Root", "etag", ItemType::root, {}}, |
388 | 188 | }; | 188 | }; |
389 | 189 | boost::promise<ItemList> p; | 189 | boost::promise<ItemList> p; |
390 | 190 | p.set_value(roots); | 190 | p.set_value(roots); |
391 | @@ -205,16 +205,16 @@ | |||
392 | 205 | else if (page_token == "") | 205 | else if (page_token == "") |
393 | 206 | { | 206 | { |
394 | 207 | ItemList children = { | 207 | ItemList children = { |
397 | 208 | {"child1_id", "root_id", "Child 1", "etag", ItemType::file, {}}, | 208 | {"child1_id", { "root_id" }, "Child 1", "etag", ItemType::file, {}}, |
398 | 209 | {"child2_id", "root_id", "Child 2", "etag", ItemType::file, {}}, | 209 | {"child2_id", { "root_id" }, "Child 2", "etag", ItemType::file, {}}, |
399 | 210 | }; | 210 | }; |
400 | 211 | p.set_value(make_tuple(children, "page_token")); | 211 | p.set_value(make_tuple(children, "page_token")); |
401 | 212 | } | 212 | } |
402 | 213 | else if (page_token == "page_token") | 213 | else if (page_token == "page_token") |
403 | 214 | { | 214 | { |
404 | 215 | ItemList children = { | 215 | ItemList children = { |
407 | 216 | {"child3_id", "root_id", "Child 4", "etag", ItemType::file, {}}, | 216 | {"child3_id", { "root_id" }, "Child 4", "etag", ItemType::file, {}}, |
408 | 217 | {"child4_id", "root_id", "Child 3", "etag", ItemType::file, {}}, | 217 | {"child4_id", { "root_id" }, "Child 3", "etag", ItemType::file, {}}, |
409 | 218 | }; | 218 | }; |
410 | 219 | p.set_value(make_tuple(children, "")); | 219 | p.set_value(make_tuple(children, "")); |
411 | 220 | } | 220 | } |
412 | @@ -232,7 +232,7 @@ | |||
413 | 232 | 232 | ||
414 | 233 | boost::promise<ItemList> p; | 233 | boost::promise<ItemList> p; |
415 | 234 | ItemList items = { | 234 | ItemList items = { |
417 | 235 | {"child_id", parent_id, name, "etag", ItemType::file, {}}, | 235 | {"child_id", { parent_id }, name, "etag", ItemType::file, {}}, |
418 | 236 | }; | 236 | }; |
419 | 237 | p.set_value(items); | 237 | p.set_value(items); |
420 | 238 | return p.get_future(); | 238 | return p.get_future(); |
421 | @@ -246,7 +246,7 @@ | |||
422 | 246 | boost::promise<Item> p; | 246 | boost::promise<Item> p; |
423 | 247 | if (item_id == "root_id") | 247 | if (item_id == "root_id") |
424 | 248 | { | 248 | { |
426 | 249 | Item item = {"root_id", "", "Root", "etag", ItemType::root, {}}; | 249 | Item item = {"root_id", {}, "Root", "etag", ItemType::root, {}}; |
427 | 250 | p.set_value(item); | 250 | p.set_value(item); |
428 | 251 | } | 251 | } |
429 | 252 | else | 252 | else |
430 | @@ -262,7 +262,7 @@ | |||
431 | 262 | Q_UNUSED(ctx); | 262 | Q_UNUSED(ctx); |
432 | 263 | 263 | ||
433 | 264 | boost::promise<Item> p; | 264 | boost::promise<Item> p; |
435 | 265 | Item item = {"new_folder_id", parent_id, name, "etag", ItemType::folder, {}}; | 265 | Item item = {"new_folder_id", { parent_id }, name, "etag", ItemType::folder, {}}; |
436 | 266 | p.set_value(item); | 266 | p.set_value(item); |
437 | 267 | return p.get_future(); | 267 | return p.get_future(); |
438 | 268 | } | 268 | } |
439 | @@ -277,7 +277,7 @@ | |||
440 | 277 | Q_UNUSED(ctx); | 277 | Q_UNUSED(ctx); |
441 | 278 | 278 | ||
442 | 279 | boost::promise<unique_ptr<UploadJob>> p; | 279 | boost::promise<unique_ptr<UploadJob>> p; |
444 | 280 | Item item = {"new_file_id", parent_id, name, "etag", ItemType::file, {}}; | 280 | Item item = {"new_file_id", { parent_id }, name, "etag", ItemType::file, {}}; |
445 | 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))); |
446 | 282 | return p.get_future(); | 282 | return p.get_future(); |
447 | 283 | } | 283 | } |
448 | @@ -291,7 +291,7 @@ | |||
449 | 291 | Q_UNUSED(ctx); | 291 | Q_UNUSED(ctx); |
450 | 292 | 292 | ||
451 | 293 | boost::promise<unique_ptr<UploadJob>> p; | 293 | boost::promise<unique_ptr<UploadJob>> p; |
453 | 294 | Item item = {"item_id", "parent_id", "file name", "etag", ItemType::file, {}}; | 294 | Item item = {"item_id", { "parent_id" }, "file name", "etag", ItemType::file, {}}; |
454 | 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))); |
455 | 296 | return p.get_future(); | 296 | return p.get_future(); |
456 | 297 | } | 297 | } |
457 | @@ -332,7 +332,7 @@ | |||
458 | 332 | Q_UNUSED(ctx); | 332 | Q_UNUSED(ctx); |
459 | 333 | 333 | ||
460 | 334 | boost::promise<Item> p; | 334 | boost::promise<Item> p; |
462 | 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, {}}; |
463 | 336 | p.set_value(item); | 336 | p.set_value(item); |
464 | 337 | return p.get_future(); | 337 | return p.get_future(); |
465 | 338 | } | 338 | } |
466 | @@ -345,7 +345,7 @@ | |||
467 | 345 | Q_UNUSED(ctx); | 345 | Q_UNUSED(ctx); |
468 | 346 | 346 | ||
469 | 347 | boost::promise<Item> p; | 347 | boost::promise<Item> p; |
471 | 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, {}}; |
472 | 349 | p.set_value(item); | 349 | p.set_value(item); |
473 | 350 | return p.get_future(); | 350 | return p.get_future(); |
474 | 351 | } | 351 | } |
FAILED: Continuous integration, rev:87 /jenkins. canonical. com/unity- api-1/job/ lp-storage- framework- ci/57/ /jenkins. canonical. com/unity- api-1/job/ build/326/ console /jenkins. canonical. com/unity- api-1/job/ build-0- fetch/332 /jenkins. canonical. com/unity- api-1/job/ build-1- sourcepkg/ release= vivid+overlay/ 259 /jenkins. canonical. com/unity- api-1/job/ build-1- sourcepkg/ release= xenial+ overlay/ 259 /jenkins. canonical. com/unity- api-1/job/ build-1- sourcepkg/ release= yakkety/ 259 /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=amd64, release= vivid+overlay/ 188/console /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=amd64, release= xenial+ overlay/ 188/console /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=amd64, release= yakkety/ 188/console /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=armhf, release= vivid+overlay/ 188/console /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 188/console /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=armhf, release= yakkety/ 188/console /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=i386, release= vivid+overlay/ 188/console /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 188/console /jenkins. canonical. com/unity- api-1/job/ build-2- binpkg/ arch=i386, release= yakkety/ 188/console
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild: /jenkins. canonical. com/unity- api-1/job/ lp-storage- framework- ci/57/rebuild
https:/