Merge lp:~michihenning/storage-framework/qt-cmake-fixes into lp:storage-framework/devel

Proposed by Michi Henning
Status: Merged
Approved by: James Henstridge
Approved revision: 39
Merged at revision: 25
Proposed branch: lp:~michihenning/storage-framework/qt-cmake-fixes
Merge into: lp:storage-framework/devel
Diff against target: 620 lines (+162/-131)
23 files modified
CMakeLists.txt (+2/-1)
debian/control (+1/-0)
debian/source/format (+1/-1)
include/unity/storage/provider/UploadJob.h (+1/-1)
include/unity/storage/provider/internal/Handler.h (+1/-1)
include/unity/storage/qt/client/internal/boost_filesystem.h (+1/-1)
include/unity/storage/qt/client/internal/local_client/AccountImpl.h (+0/-1)
include/unity/storage/qt/client/internal/local_client/ItemImpl.h (+1/-2)
include/unity/storage/qt/client/internal/remote_client/FileImpl.h (+1/-1)
include/unity/storage/qt/client/internal/remote_client/Handler.h (+18/-5)
include/unity/storage/qt/client/internal/remote_client/HandlerBase.h (+9/-3)
include/unity/storage/qt/client/internal/remote_client/RootImpl.h (+1/-1)
src/provider/CMakeLists.txt (+2/-1)
src/provider/internal/dbusmarshal.cpp (+2/-2)
src/qt/client/CMakeLists.txt (+78/-41)
src/qt/client/internal/CMakeLists.txt (+3/-0)
src/qt/client/internal/local_client/CMakeLists.txt (+15/-23)
src/qt/client/internal/remote_client/CMakeLists.txt (+15/-36)
src/qt/client/internal/remote_client/FileImpl.cpp (+5/-5)
src/qt/client/internal/remote_client/HandlerBase.cpp (+2/-2)
tests/local-client/CMakeLists.txt (+1/-1)
tests/local-client/local-client_test.cpp (+2/-1)
tests/remote-client/CMakeLists.txt (+0/-1)
To merge this branch: bzr merge lp:~michihenning/storage-framework/qt-cmake-fixes
Reviewer Review Type Date Requested Status
James Henstridge Approve
unity-api-1-bot continuous-integration Needs Fixing
Review via email: mp+299767@code.launchpad.net

Commit message

Get rid of the old qt5_use_modules macros.
Changed cmake files to build the local and remote libs in the qt/client
dir because we cannot add .moc files to OBJECT libraries on Vivid.
Added GENERATED property to generated files.
Adjusted indentation in a few places.
Fixed a bunch of clang warnings.
Added work-around for gcc 4.9 bug on Vivid.
Fixed build failure with boost::filesystem on Vivid.
Changed source package format back to 1.0 due to bug in Jenkins.

Description of the change

Get rid of the old qt5_use_modules macros.

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:25
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/14/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build/137/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/145
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=vivid+overlay/92
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=xenial+overlay/92
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=yakkety/92
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/74/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/74/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/74/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/74/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/74/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/74/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/74/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/74/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/74/console

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

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

FAILED: Continuous integration, rev:26
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/15/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build/141/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/149
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=vivid+overlay/96
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=xenial+overlay/96
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=yakkety/96
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/78/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/78/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/78/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/78/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/78/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/78/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/78/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/78/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/78/console

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

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

FAILED: Continuous integration, rev:27
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/16/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build/142/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/150
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=vivid+overlay/97
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=xenial+overlay/97
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=yakkety/97
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/79/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/79/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/79/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/79/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/79/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/79/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/79/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/79/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/79/console

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

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

FAILED: Continuous integration, rev:29
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/17/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build/145/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/153
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=vivid+overlay/100
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=xenial+overlay/100
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=yakkety/100
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/81/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/81/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/81/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/81/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/81/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/81/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/81/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/81/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/81/console

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

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

FAILED: Continuous integration, rev:38
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/18/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build/154/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/162
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=vivid+overlay/107
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=xenial+overlay/107
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=yakkety/107
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/88/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/88/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/88/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/88/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/88/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/88/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/88/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/88/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/88/console

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

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

This mostly looks good. I noted a few problems though that I've noted with inline comments.

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

Also, you've added libunity-api-dev to Build-Depends in debian/control. Do we actually need it? I don't see any of its headers included anywhere.

39. By Michi Henning

Fixed broken coverage in top-level cmake file. Simplified boost version check.

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

We need unity-api because I'm using ResourcePtr. It's a build dependency only because ResourcePtr is a template.

I fixed the other two issues, thanks!

Revision history for this message
James Henstridge (jamesh) wrote :

Looks great.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2016-07-11 03:28:40 +0000
3+++ CMakeLists.txt 2016-07-20 01:16:16 +0000
4@@ -106,6 +106,7 @@
5 find_package(Qt5Core REQUIRED)
6 find_package(Qt5DBus REQUIRED)
7 find_package(Qt5Network REQUIRED)
8+find_package(Qt5Test REQUIRED)
9
10 include(FindPkgConfig)
11 pkg_check_modules(APPARMOR_DEPS REQUIRED libapparmor)
12@@ -121,7 +122,7 @@
13
14 enable_coverage_report(
15 TARGETS
16- qt-client-lib-public
17+ qt-client-lib-common
18 storage-framework-qt-client
19 storage-framework-qt-local-client
20 FILTER
21
22=== modified file 'debian/control'
23--- debian/control 2016-07-12 02:22:05 +0000
24+++ debian/control 2016-07-20 01:16:16 +0000
25@@ -16,6 +16,7 @@
26 libglib2.0-dev,
27 libgtest-dev,
28 libonline-accounts-qt-dev,
29+ libunity-api-dev,
30 qtbase5-dev,
31 qtbase5-dev-tools,
32 Homepage: https://launchpad.net/storage-framework
33
34=== modified file 'debian/source/format'
35--- debian/source/format 2016-07-12 02:22:05 +0000
36+++ debian/source/format 2016-07-20 01:16:16 +0000
37@@ -1,1 +1,1 @@
38-3.0 (quilt)
39+1.0
40
41=== modified file 'include/unity/storage/provider/UploadJob.h'
42--- include/unity/storage/provider/UploadJob.h 2016-07-12 02:22:05 +0000
43+++ include/unity/storage/provider/UploadJob.h 2016-07-20 01:16:16 +0000
44@@ -30,7 +30,7 @@
45 namespace provider
46 {
47
48-class Item;
49+struct Item;
50
51 namespace internal
52 {
53
54=== modified file 'include/unity/storage/provider/internal/Handler.h'
55--- include/unity/storage/provider/internal/Handler.h 2016-07-12 02:22:05 +0000
56+++ include/unity/storage/provider/internal/Handler.h 2016-07-20 01:16:16 +0000
57@@ -34,7 +34,7 @@
58 namespace provider
59 {
60
61-class Context;
62+struct Context;
63 class ProviderBase;
64
65 namespace internal
66
67=== modified file 'include/unity/storage/qt/client/internal/boost_filesystem.h'
68--- include/unity/storage/qt/client/internal/boost_filesystem.h 2016-07-12 02:22:05 +0000
69+++ include/unity/storage/qt/client/internal/boost_filesystem.h 2016-07-20 01:16:16 +0000
70@@ -20,7 +20,7 @@
71
72 #include <boost/version.hpp>
73
74-#if BOOST_VERSION / 100000 == 1 && BOOST_VERSION / 100 & 1000 <= 55
75+#if BOOST_VERSION < 105500
76 #define BOOST_NO_CXX11_SCOPED_ENUMS
77 #include <boost/filesystem.hpp>
78 #undef BOOST_NO_CXX11_SCOPED_ENUMS
79
80=== modified file 'include/unity/storage/qt/client/internal/local_client/AccountImpl.h'
81--- include/unity/storage/qt/client/internal/local_client/AccountImpl.h 2016-07-12 02:22:05 +0000
82+++ include/unity/storage/qt/client/internal/local_client/AccountImpl.h 2016-07-20 01:16:16 +0000
83@@ -51,7 +51,6 @@
84 QString owner_id_; // Immutable
85 QString description_; // Immutable
86 QVector<std::shared_ptr<Root>> roots_; // Immutable
87- std::atomic_bool copy_in_progress_;
88 };
89
90 } // namespace local_client
91
92=== modified file 'include/unity/storage/qt/client/internal/local_client/ItemImpl.h'
93--- include/unity/storage/qt/client/internal/local_client/ItemImpl.h 2016-07-12 02:22:05 +0000
94+++ include/unity/storage/qt/client/internal/local_client/ItemImpl.h 2016-07-20 01:16:16 +0000
95@@ -19,10 +19,9 @@
96 #pragma once
97
98 #include <unity/storage/common.h>
99+#include <unity/storage/qt/client/internal/boost_filesystem.h>
100 #include <unity/storage/qt/client/internal/ItemBase.h>
101
102-#include <boost/filesystem.hpp>
103-
104 #include <mutex>
105
106 namespace unity
107
108=== modified file 'include/unity/storage/qt/client/internal/remote_client/FileImpl.h'
109--- include/unity/storage/qt/client/internal/remote_client/FileImpl.h 2016-07-12 02:22:05 +0000
110+++ include/unity/storage/qt/client/internal/remote_client/FileImpl.h 2016-07-20 01:16:16 +0000
111@@ -28,7 +28,7 @@
112 namespace internal
113 {
114
115-class ItemMetadata;
116+struct ItemMetadata;
117
118 } // namespace internal
119
120
121=== modified file 'include/unity/storage/qt/client/internal/remote_client/Handler.h'
122--- include/unity/storage/qt/client/internal/remote_client/Handler.h 2016-07-12 02:22:05 +0000
123+++ include/unity/storage/qt/client/internal/remote_client/Handler.h 2016-07-20 01:16:16 +0000
124@@ -44,8 +44,8 @@
125 public:
126 template<typename ... DBusArgs>
127 Handler(QObject* parent,
128- QDBusPendingReply<DBusArgs...> const& reply,
129- std::function<void(decltype(reply) const&, QFutureInterface<T>&)> closure);
130+ QDBusPendingReply<DBusArgs...>& reply,
131+ std::function<void(decltype(reply)&, QFutureInterface<T>&)> closure);
132
133 QFuture<T> future();
134
135@@ -53,12 +53,23 @@
136 QFutureInterface<T> qf_;
137 };
138
139+// TODO: HACK: The reply argument really should be passed by const reference, which also
140+// would make the explicit conversion of the call to QDBusPendingReply<QDBusArgs...>
141+// unnecessary. But this doesn't work with gcc 4.9: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60420
142+// Once we get rid of Vivid, this should be changed back to
143+//
144+// Handler<T>::Handler(QObject* parent,
145+// QDBusPendingReply<DBusArgs...> const& reply,
146+// std::function<void(decltype(reply) const&, QFutureInterface<T>&)> closure)
147+
148 template<typename T>
149 template<typename ... DBusArgs>
150-Handler<T>::Handler(QObject* parent, QDBusPendingReply<DBusArgs...> const& reply, std::function<void(decltype(reply) const&, QFutureInterface<T>&)> closure)
151+Handler<T>::Handler(QObject* parent,
152+ QDBusPendingReply<DBusArgs...>& reply,
153+ std::function<void(decltype(reply)&, QFutureInterface<T>&)> closure)
154 : HandlerBase(parent,
155 reply,
156- [this, closure](QDBusPendingCallWatcher const& call)
157+ [this, closure](QDBusPendingCallWatcher& call)
158 {
159 if (call.isError())
160 {
161@@ -67,7 +78,9 @@
162 qf_.reportFinished();
163 return;
164 }
165- closure(call, qf_);
166+ // TODO: See HACK above. Should just be closure(call, qf_);
167+ QDBusPendingReply<DBusArgs...> r = call;
168+ closure(r, qf_);
169 })
170 {
171 qf_.reportStarted();
172
173=== modified file 'include/unity/storage/qt/client/internal/remote_client/HandlerBase.h'
174--- include/unity/storage/qt/client/internal/remote_client/HandlerBase.h 2016-07-12 02:22:05 +0000
175+++ include/unity/storage/qt/client/internal/remote_client/HandlerBase.h 2016-07-20 01:16:16 +0000
176@@ -47,9 +47,15 @@
177 Q_OBJECT
178
179 public:
180+ // TODO: HACK: gcc 4.9 bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60420
181+ // Once we get rid of Vivid, this should be changed back to
182+ //
183+ // HandlerBase(QObject* parent,
184+ // QDBusPendingCall const& call,
185+ // std::function<void(QDBusPendingCallWatcher const&)> const& closure);
186 HandlerBase(QObject* parent,
187- QDBusPendingCall const& call,
188- std::function<void(QDBusPendingCallWatcher const&)> closure);
189+ QDBusPendingCall& call,
190+ std::function<void(QDBusPendingCallWatcher&)> const& closure);
191
192 public Q_SLOTS:
193 void finished(QDBusPendingCallWatcher* call);
194@@ -58,7 +64,7 @@
195 QDBusPendingCallWatcher watcher_;
196
197 private:
198- std::function<void(QDBusPendingCallWatcher const&)> closure_;
199+ std::function<void(QDBusPendingCallWatcher&)> closure_;
200 };
201
202 } // namespace remote_client
203
204=== modified file 'include/unity/storage/qt/client/internal/remote_client/RootImpl.h'
205--- include/unity/storage/qt/client/internal/remote_client/RootImpl.h 2016-07-12 02:22:05 +0000
206+++ include/unity/storage/qt/client/internal/remote_client/RootImpl.h 2016-07-20 01:16:16 +0000
207@@ -28,7 +28,7 @@
208 namespace internal
209 {
210
211-class ItemMetadata;
212+struct ItemMetadata;
213
214 } // namespace internal
215
216
217=== modified file 'src/provider/CMakeLists.txt'
218--- src/provider/CMakeLists.txt 2016-07-11 03:28:40 +0000
219+++ src/provider/CMakeLists.txt 2016-07-20 01:16:16 +0000
220@@ -11,6 +11,8 @@
221 set_source_files_properties(bus.xml PROPERTIES CLASSNAME BusInterface)
222 qt5_add_dbus_interface(generated_files bus.xml businterface)
223
224+set_source_files_properties(${generated_files} PROPERTIES GENERATED TRUE)
225+
226 add_library(storage-framework-provider SHARED
227 DownloadJob.cpp
228 ProviderBase.cpp
229@@ -46,7 +48,6 @@
230 SOVERSION ${SF_PROVIDER_SOVERSION}
231 VERSION ${SF_PROVIDER_LIBVERSION}
232 )
233-qt5_use_modules(storage-framework-provider Core DBus Network)
234 target_link_libraries(storage-framework-provider
235 Qt5::Core
236 Qt5::DBus
237
238=== modified file 'src/provider/internal/dbusmarshal.cpp'
239--- src/provider/internal/dbusmarshal.cpp 2016-07-12 02:22:05 +0000
240+++ src/provider/internal/dbusmarshal.cpp 2016-07-20 01:16:16 +0000
241@@ -51,7 +51,7 @@
242 return argument;
243 }
244
245-QDBusArgument const& operator>>(QDBusArgument const& argument, Item& item)
246+QDBusArgument const& operator>>(QDBusArgument const&, Item&)
247 {
248 throw std::runtime_error("Item decode not implemented");
249 }
250@@ -67,7 +67,7 @@
251 return argument;
252 }
253
254-QDBusArgument const& operator>>(QDBusArgument const& argument, ItemList& items)
255+QDBusArgument const& operator>>(QDBusArgument const&, ItemList&)
256 {
257 throw std::runtime_error("std::vector<Item> decode not implemented");
258 }
259
260=== modified file 'src/qt/client/CMakeLists.txt'
261--- src/qt/client/CMakeLists.txt 2016-07-11 03:28:40 +0000
262+++ src/qt/client/CMakeLists.txt 2016-07-20 01:16:16 +0000
263@@ -1,4 +1,7 @@
264-add_library(qt-client-lib-public OBJECT
265+# Create an OBJECT library for the files that are used by both
266+# local and remote client libraries, so we don't compile them twice.
267+
268+add_library(qt-client-lib-common OBJECT
269 Account.cpp
270 Downloader.cpp
271 Exceptions.cpp
272@@ -19,61 +22,95 @@
273 ${CMAKE_SOURCE_DIR}/include/unity/storage/qt/client/internal/DownloaderBase.h
274 ${CMAKE_SOURCE_DIR}/include/unity/storage/qt/client/internal/UploaderBase.h
275 )
276-target_include_directories(qt-client-lib-public PRIVATE
277- ${Qt5Core_INCLUDE_DIRS}
278- ${Qt5Network_INCLUDE_DIRS})
279-set_target_properties(qt-client-lib-public PROPERTIES
280- AUTOMOC TRUE
281- POSITION_INDEPENDENT_CODE TRUE
282-)
283-
284+target_include_directories(qt-client-lib-common PRIVATE
285+ ${Qt5Network_INCLUDE_DIRS}
286+)
287+set_target_properties(qt-client-lib-common PROPERTIES
288+ AUTOMOC TRUE
289+ POSITION_INDEPENDENT_CODE TRUE
290+)
291+
292+# We build both local and remote client libraries here instead
293+# of creating OBJECT libraries for them because cmake 3.0.2 (which
294+# is in the Vivid overlay) cannot handle .moc files in OBJECT libraries.
295+
296+# Descend into the child directories first. The CMakeLists.txt files
297+# there set QT_CLIENT_LIB_LOCAL_SRC and QT_CLIENT_LIB_REMOTE_SRC.
298 add_subdirectory(internal)
299
300 # Build the local loopback client library
301 add_library(storage-framework-qt-local-client SHARED
302- $<TARGET_OBJECTS:qt-client-lib-public>
303- $<TARGET_OBJECTS:qt-client-lib-local>)
304-qt5_use_modules(storage-framework-qt-local-client Concurrent Core Network)
305+ $<TARGET_OBJECTS:qt-client-lib-common>
306+ ${QT_CLIENT_LIB_LOCAL_SRC}
307+)
308+target_include_directories(storage-framework-qt-local-client PRIVATE
309+ ${GLIB_DEPS_INCLUDE_DIRS}
310+ ${Qt5Core_INCLUDE_DIRS}
311+ ${Qt5Network_INCLUDE_DIRS}
312+ ${Qt5Concurrent_INCLUDE_DIRS}
313+)
314 set_target_properties(storage-framework-qt-local-client PROPERTIES
315- AUTOMOC TRUE
316- LINK_FLAGS "-Wl,--no-undefined"
317- OUTPUT_NAME "storage-framework-qt-local-client-${SF_CLIENT_API_VERSION}"
318- SOVERSION ${SF_CLIENT_SOVERSION}
319- VERSION ${SF_CLIENT_LIBVERSION}
320+ AUTOMOC TRUE
321+ POSITION_INDEPENDENT_CODE TRUE
322+ LINK_FLAGS "-Wl,--no-undefined"
323+ OUTPUT_NAME "storage-framework-qt-local-client-${SF_CLIENT_API_VERSION}"
324+ SOVERSION ${SF_CLIENT_SOVERSION}
325+ VERSION ${SF_CLIENT_LIBVERSION}
326 )
327 target_link_libraries(storage-framework-qt-local-client
328 Qt5::Concurrent
329 Qt5::Core
330 Qt5::Network
331 ${Boost_LIBRARIES}
332- ${GLIB_DEPS_LIBRARIES})
333-
334+ ${GLIB_DEPS_LIBRARIES}
335+)
336 install(
337- TARGETS storage-framework-qt-local-client
338- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
339+ TARGETS storage-framework-qt-local-client
340+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
341 )
342
343 configure_file(
344- storage-framework-qt-local-client.pc.in
345- storage-framework-qt-local-client-${SF_CLIENT_API_VERSION}.pc
346+ storage-framework-qt-local-client.pc.in
347+ storage-framework-qt-local-client-${SF_CLIENT_API_VERSION}.pc
348 )
349 install(
350- FILES ${CMAKE_CURRENT_BINARY_DIR}/storage-framework-qt-local-client-${SF_CLIENT_API_VERSION}.pc
351- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
352+ FILES ${CMAKE_CURRENT_BINARY_DIR}/storage-framework-qt-local-client-${SF_CLIENT_API_VERSION}.pc
353+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
354 )
355
356 # Build the remote client library
357+set_source_files_properties(${CMAKE_SOURCE_DIR}/data/provider.xml PROPERTIES
358+ CLASSNAME ProviderInterface
359+ INCLUDE unity/storage/qt/client/internal/remote_client/dbusmarshal.h
360+)
361+
362+qt5_add_dbus_interface(generated_files
363+ ${CMAKE_SOURCE_DIR}/data/provider.xml
364+ ProviderInterface
365+)
366+set_source_files_properties(${generated_files} PROPERTIES
367+ COMPILE_FLAGS -Wno-ctor-dtor-privacy
368+ GENERATED TRUE
369+)
370
371 add_library(storage-framework-qt-client SHARED
372- $<TARGET_OBJECTS:qt-client-lib-public>
373- $<TARGET_OBJECTS:qt-client-lib-remote>)
374-qt5_use_modules(storage-framework-qt-client Core DBus Network)
375+ $<TARGET_OBJECTS:qt-client-lib-common>
376+ ${QT_CLIENT_LIB_REMOTE_SRC}
377+ ${generated_files}
378+)
379+target_include_directories(storage-framework-qt-client PRIVATE
380+ ${GLIB_DEPS_INCLUDE_DIRS}
381+ ${ONLINEACCOUNTS_DEPS_INCLUDE_DIRS}
382+ ${Qt5Core_INCLUDE_DIRS}
383+ ${Qt5DBus_INCLUDE_DIRS}
384+ ${Qt5Network_INCLUDE_DIRS}
385+)
386 set_target_properties(storage-framework-qt-client PROPERTIES
387- AUTOMOC TRUE
388- LINK_FLAGS "-Wl,--no-undefined"
389- OUTPUT_NAME "storage-framework-qt-client-${SF_CLIENT_API_VERSION}"
390- SOVERSION ${SF_CLIENT_SOVERSION}
391- VERSION ${SF_CLIENT_LIBVERSION}
392+ AUTOMOC TRUE
393+ LINK_FLAGS "-Wl,--no-undefined"
394+ OUTPUT_NAME "storage-framework-qt-client-${SF_CLIENT_API_VERSION}"
395+ SOVERSION ${SF_CLIENT_SOVERSION}
396+ VERSION ${SF_CLIENT_LIBVERSION}
397 )
398 target_link_libraries(storage-framework-qt-client
399 Qt5::Concurrent
400@@ -81,18 +118,18 @@
401 Qt5::DBus
402 Qt5::Network
403 ${Boost_LIBRARIES}
404- ${ONLINEACCOUNTS_DEPS_LDFLAGS})
405-
406+ ${ONLINEACCOUNTS_DEPS_LDFLAGS}
407+)
408 install(
409- TARGETS storage-framework-qt-client
410- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
411+ TARGETS storage-framework-qt-client
412+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
413 )
414
415 configure_file(
416- storage-framework-qt-client.pc.in
417- storage-framework-qt-client-${SF_CLIENT_API_VERSION}.pc
418+ storage-framework-qt-client.pc.in
419+ storage-framework-qt-client-${SF_CLIENT_API_VERSION}.pc
420 )
421 install(
422- FILES ${CMAKE_CURRENT_BINARY_DIR}/storage-framework-qt-client-${SF_CLIENT_API_VERSION}.pc
423- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
424+ FILES ${CMAKE_CURRENT_BINARY_DIR}/storage-framework-qt-client-${SF_CLIENT_API_VERSION}.pc
425+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
426 )
427
428=== modified file 'src/qt/client/internal/CMakeLists.txt'
429--- src/qt/client/internal/CMakeLists.txt 2016-06-22 04:51:19 +0000
430+++ src/qt/client/internal/CMakeLists.txt 2016-07-20 01:16:16 +0000
431@@ -1,2 +1,5 @@
432 add_subdirectory(local_client)
433 add_subdirectory(remote_client)
434+
435+SET(QT_CLIENT_LIB_REMOTE_SRC ${QT_CLIENT_LIB_REMOTE_SRC} PARENT_SCOPE)
436+SET(QT_CLIENT_LIB_LOCAL_SRC ${QT_CLIENT_LIB_LOCAL_SRC} PARENT_SCOPE)
437
438=== modified file 'src/qt/client/internal/local_client/CMakeLists.txt'
439--- src/qt/client/internal/local_client/CMakeLists.txt 2016-07-11 02:55:24 +0000
440+++ src/qt/client/internal/local_client/CMakeLists.txt 2016-07-20 01:16:16 +0000
441@@ -1,24 +1,16 @@
442-add_library(qt-client-lib-local OBJECT
443- AccountImpl.cpp
444- DownloaderImpl.cpp
445- FileImpl.cpp
446- FolderImpl.cpp
447- ItemImpl.cpp
448- RootImpl.cpp
449- Runtime_create.cpp
450- RuntimeImpl.cpp
451- UploaderImpl.cpp
452- ${CMAKE_SOURCE_DIR}/include/unity/storage/qt/client/internal/local_client/DownloaderImpl.h
453- ${CMAKE_SOURCE_DIR}/include/unity/storage/qt/client/internal/local_client/UploaderImpl.h
454- ${CMAKE_SOURCE_DIR}/include/unity/storage/qt/client/internal/local_client/RuntimeImpl.h
455- ${CMAKE_SOURCE_DIR}/include/unity/storage/qt/client/internal/RuntimeBase.h
456-)
457-target_include_directories(qt-client-lib-local PRIVATE
458- ${GLIB_DEPS_INCLUDE_DIRS}
459- ${Qt5Core_INCLUDE_DIRS}
460- ${Qt5Network_INCLUDE_DIRS}
461- ${Qt5Concurrent_INCLUDE_DIRS})
462-set_target_properties(qt-client-lib-local PROPERTIES
463- AUTOMOC TRUE
464- POSITION_INDEPENDENT_CODE TRUE
465+set(QT_CLIENT_LIB_LOCAL_SRC
466+ ${CMAKE_CURRENT_SOURCE_DIR}/AccountImpl.cpp
467+ ${CMAKE_CURRENT_SOURCE_DIR}/DownloaderImpl.cpp
468+ ${CMAKE_CURRENT_SOURCE_DIR}/FileImpl.cpp
469+ ${CMAKE_CURRENT_SOURCE_DIR}/FolderImpl.cpp
470+ ${CMAKE_CURRENT_SOURCE_DIR}/ItemImpl.cpp
471+ ${CMAKE_CURRENT_SOURCE_DIR}/RootImpl.cpp
472+ ${CMAKE_CURRENT_SOURCE_DIR}/Runtime_create.cpp
473+ ${CMAKE_CURRENT_SOURCE_DIR}/RuntimeImpl.cpp
474+ ${CMAKE_CURRENT_SOURCE_DIR}/UploaderImpl.cpp
475+ ${CMAKE_SOURCE_DIR}/include/unity/storage/qt/client/internal/local_client/DownloaderImpl.h
476+ ${CMAKE_SOURCE_DIR}/include/unity/storage/qt/client/internal/local_client/UploaderImpl.h
477+ ${CMAKE_SOURCE_DIR}/include/unity/storage/qt/client/internal/local_client/RuntimeImpl.h
478+ ${CMAKE_SOURCE_DIR}/include/unity/storage/qt/client/internal/RuntimeBase.h
479+ PARENT_SCOPE
480 )
481
482=== modified file 'src/qt/client/internal/remote_client/CMakeLists.txt'
483--- src/qt/client/internal/remote_client/CMakeLists.txt 2016-07-11 05:42:50 +0000
484+++ src/qt/client/internal/remote_client/CMakeLists.txt 2016-07-20 01:16:16 +0000
485@@ -1,36 +1,15 @@
486-set_source_files_properties(${CMAKE_SOURCE_DIR}/data/provider.xml PROPERTIES
487- CLASSNAME ProviderInterface
488- INCLUDE unity/storage/qt/client/internal/remote_client/dbusmarshal.h)
489-
490-qt5_add_dbus_interface(generated_files
491- ${CMAKE_SOURCE_DIR}/data/provider.xml
492- ProviderInterface)
493-set_source_files_properties(${generated_files} PROPERTIES COMPILE_FLAGS -Wno-ctor-dtor-privacy)
494-
495-add_library(qt-client-lib-remote OBJECT
496- AccountImpl.cpp
497- dbusmarshal.cpp
498- DownloaderImpl.cpp
499- FileImpl.cpp
500- FolderImpl.cpp
501- HandlerBase.cpp
502- ItemImpl.cpp
503- RootImpl.cpp
504- Runtime_create.cpp
505- RuntimeImpl.cpp
506- UploaderImpl.cpp
507- ${CMAKE_SOURCE_DIR}/include/unity/storage/qt/client/internal/remote_client/HandlerBase.h
508- ${CMAKE_SOURCE_DIR}/include/unity/storage/qt/client/internal/remote_client/RuntimeImpl.h
509- ${generated_files}
510-)
511-target_include_directories(qt-client-lib-remote PRIVATE
512- ${GLIB_DEPS_INCLUDE_DIRS}
513- ${ONLINEACCOUNTS_DEPS_INCLUDE_DIRS}
514- ${Qt5Core_INCLUDE_DIRS}
515- ${Qt5DBus_INCLUDE_DIRS}
516- ${Qt5Network_INCLUDE_DIRS}
517- )
518-set_target_properties(qt-client-lib-remote PROPERTIES
519- AUTOMOC TRUE
520- POSITION_INDEPENDENT_CODE TRUE
521-)
522+set(QT_CLIENT_LIB_REMOTE_SRC
523+ ${CMAKE_CURRENT_SOURCE_DIR}/AccountImpl.cpp
524+ ${CMAKE_CURRENT_SOURCE_DIR}/dbusmarshal.cpp
525+ ${CMAKE_CURRENT_SOURCE_DIR}/DownloaderImpl.cpp
526+ ${CMAKE_CURRENT_SOURCE_DIR}/FileImpl.cpp
527+ ${CMAKE_CURRENT_SOURCE_DIR}/FolderImpl.cpp
528+ ${CMAKE_CURRENT_SOURCE_DIR}/HandlerBase.cpp
529+ ${CMAKE_CURRENT_SOURCE_DIR}/ItemImpl.cpp
530+ ${CMAKE_CURRENT_SOURCE_DIR}/RootImpl.cpp
531+ ${CMAKE_CURRENT_SOURCE_DIR}/Runtime_create.cpp
532+ ${CMAKE_CURRENT_SOURCE_DIR}/RuntimeImpl.cpp
533+ ${CMAKE_CURRENT_SOURCE_DIR}/UploaderImpl.cpp
534+ ${CMAKE_SOURCE_DIR}/include/unity/storage/qt/client/internal/remote_client/HandlerBase.h
535+ ${CMAKE_SOURCE_DIR}/include/unity/storage/qt/client/internal/remote_client/RuntimeImpl.h
536+ PARENT_SCOPE)
537
538=== modified file 'src/qt/client/internal/remote_client/FileImpl.cpp'
539--- src/qt/client/internal/remote_client/FileImpl.cpp 2016-07-12 02:22:05 +0000
540+++ src/qt/client/internal/remote_client/FileImpl.cpp 2016-07-20 01:16:16 +0000
541@@ -91,8 +91,10 @@
542 return make_exceptional_future<shared_ptr<Downloader>>(DeletedException());
543 }
544
545- auto process_create_downloader_reply = [this](QDBusPendingReply<QString, QDBusUnixFileDescriptor> const& reply,
546- QFutureInterface<std::shared_ptr<Downloader>>& qf)
547+ auto reply = provider().Download(md_.item_id);
548+
549+ auto process_reply = [this](QDBusPendingReply<QString, QDBusUnixFileDescriptor> const& reply,
550+ QFutureInterface<std::shared_ptr<Downloader>>& qf)
551 {
552 auto download_id = reply.argumentAt<0>();
553 auto fd = reply.argumentAt<1>();
554@@ -108,9 +110,7 @@
555 }
556 };
557
558- auto handler = new Handler<shared_ptr<Downloader>>(this,
559- provider().Download(md_.item_id),
560- process_create_downloader_reply);
561+ auto handler = new Handler<shared_ptr<Downloader>>(this, reply, process_reply);
562 return handler->future();
563 }
564
565
566=== modified file 'src/qt/client/internal/remote_client/HandlerBase.cpp'
567--- src/qt/client/internal/remote_client/HandlerBase.cpp 2016-07-12 02:22:05 +0000
568+++ src/qt/client/internal/remote_client/HandlerBase.cpp 2016-07-20 01:16:16 +0000
569@@ -41,8 +41,8 @@
570 {
571
572 HandlerBase::HandlerBase(QObject* parent,
573- QDBusPendingCall const& call,
574- function<void(QDBusPendingCallWatcher const&)> closure)
575+ QDBusPendingCall& call,
576+ function<void(QDBusPendingCallWatcher&)> const& closure)
577 : QObject(parent)
578 , watcher_(call)
579 , closure_(closure)
580
581=== modified file 'tests/local-client/CMakeLists.txt'
582--- tests/local-client/CMakeLists.txt 2016-06-22 04:51:19 +0000
583+++ tests/local-client/CMakeLists.txt 2016-07-20 01:16:16 +0000
584@@ -4,9 +4,9 @@
585 add_definitions(-DTEST_DIR="${CMAKE_CURRENT_BINARY_DIR}")
586 include_directories(${GLIB_DEPS_INCLUDE_DIRS})
587
588-qt5_use_modules(local-client_test Test)
589 target_link_libraries(local-client_test
590 storage-framework-qt-local-client
591+ Qt5::Test
592 gtest
593 )
594 add_test(local-client local-client_test)
595
596=== modified file 'tests/local-client/local-client_test.cpp'
597--- tests/local-client/local-client_test.cpp 2016-07-12 02:22:05 +0000
598+++ tests/local-client/local-client_test.cpp 2016-07-20 01:16:16 +0000
599@@ -18,7 +18,8 @@
600
601 #include <unity/storage/qt/client/client-api.h>
602
603-#include <boost/filesystem.hpp>
604+#include <unity/storage/qt/client/internal/boost_filesystem.h>
605+
606 #include <gtest/gtest.h>
607 #include <QCoreApplication>
608 #include <QFile>
609
610=== modified file 'tests/remote-client/CMakeLists.txt'
611--- tests/remote-client/CMakeLists.txt 2016-06-22 04:51:19 +0000
612+++ tests/remote-client/CMakeLists.txt 2016-07-20 01:16:16 +0000
613@@ -4,7 +4,6 @@
614 add_definitions(-DTEST_DIR="${CMAKE_CURRENT_BINARY_DIR}")
615 include_directories(${GLIB_DEPS_INCLUDE_DIRS})
616
617-qt5_use_modules(remote-client_test Test)
618 target_link_libraries(remote-client_test
619 storage-framework-qt-client
620 Qt5::Network

Subscribers

People subscribed via source and target branches

to all changes: