Merge lp:~mandel/ubuntu-download-manager/add-common-lib into lp:ubuntu-download-manager
- add-common-lib
- Merge into trunk
Proposed by
Manuel de la Peña
Status: | Merged |
---|---|
Approved by: | Manuel de la Peña |
Approved revision: | 185 |
Merged at revision: | 210 |
Proposed branch: | lp:~mandel/ubuntu-download-manager/add-common-lib |
Merge into: | lp:ubuntu-download-manager |
Diff against target: |
820 lines (+292/-76) 36 files modified
.bzrignore (+4/-0) common-installs-config.pri (+44/-0) common-pkgconfig.pri (+10/-0) common-project-config.pri (+47/-0) common-vars.pri (+21/-0) debian/control (+17/-6) debian/ubuntu-download-manager-common-dev.install (+5/-0) debian/ubuntu-download-manager-common1.install (+1/-0) debian/ubuntu-download-manager-priv1.install (+1/-1) download-manager.pro (+7/-4) ubuntu-download-manager-common/ubuntu-download-manager-common.pc.in (+12/-0) ubuntu-download-manager-common/ubuntu-download-manager-common.pro (+39/-0) ubuntu-download-manager-common/ubuntu/download_manager/download_struct.cpp (+1/-1) ubuntu-download-manager-common/ubuntu/download_manager/group_download_struct.cpp (+1/-1) ubuntu-download-manager-common/ubuntu/download_manager/metatypes.h (+2/-2) ubuntu-download-manager-common/ubuntu_download_manager_common_global.h (+12/-0) ubuntu-download-manager-priv/downloads/download_adaptor.h (+1/-1) ubuntu-download-manager-priv/downloads/download_manager_adaptor.h (+1/-1) ubuntu-download-manager-priv/downloads/downloads_db.cpp (+16/-7) ubuntu-download-manager-priv/downloads/factory.h (+1/-1) ubuntu-download-manager-priv/downloads/file_download.cpp (+1/-2) ubuntu-download-manager-priv/downloads/file_download.h (+1/-0) ubuntu-download-manager-priv/downloads/group_download.cpp (+1/-1) ubuntu-download-manager-priv/downloads/group_download.h (+1/-1) ubuntu-download-manager-priv/downloads/group_download_adaptor.h (+1/-1) ubuntu-download-manager-priv/downloads/manager.h (+1/-1) ubuntu-download-manager-priv/system/dbus_proxy.h (+1/-1) ubuntu-download-manager-priv/ubuntu-download-manager-priv.pro (+10/-12) ubuntu-download-manager-tests/downloads/test_download.cpp (+1/-1) ubuntu-download-manager-tests/downloads/test_download.h (+1/-1) ubuntu-download-manager-tests/downloads/test_download_factory.cpp (+1/-1) ubuntu-download-manager-tests/downloads/test_download_manager.cpp (+1/-1) ubuntu-download-manager-tests/downloads/test_downloads_db.cpp (+2/-2) ubuntu-download-manager-tests/fakes/fake_download.h (+1/-1) ubuntu-download-manager-tests/ubuntu-download-manager-tests.pro (+12/-12) ubuntu-download-manager/ubuntu-download-manager.pro (+13/-13) |
To merge this branch: | bzr merge lp:~mandel/ubuntu-download-manager/add-common-lib |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Roberto Alsina (community) | Approve | ||
Diego Sarmentero (community) | Approve | ||
PS Jenkins bot | continuous-integration | Approve | |
Review via email: mp+199880@code.launchpad.net |
Commit message
Add a common library to be used by the client library and the daemon side lib.
Description of the change
Add a common library to be used by the client library and the daemon side lib.
To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : | # |
review:
Approve
(continuous-integration)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file '.bzrignore' |
2 | --- .bzrignore 2013-10-29 13:42:44 +0000 |
3 | +++ .bzrignore 2013-12-20 23:43:17 +0000 |
4 | @@ -8,3 +8,7 @@ |
5 | ubuntu-download-manager/ubuntu-download-manager |
6 | ubuntu-download-manager-tests/ubuntu-download-manager-tests |
7 | moc_* |
8 | +libubuntudownloadmanager-common/libubuntudownloadmanager-common.so |
9 | +libubuntudownloadmanager-common/libubuntudownloadmanager-common.so.1 |
10 | +libubuntudownloadmanager-common/libubuntudownloadmanager-common.so.1.0 |
11 | +libubuntudownloadmanager-common/libubuntudownloadmanager-common.so.1.0.0 |
12 | |
13 | === added file 'common-installs-config.pri' |
14 | --- common-installs-config.pri 1970-01-01 00:00:00 +0000 |
15 | +++ common-installs-config.pri 2013-12-20 23:43:17 +0000 |
16 | @@ -0,0 +1,44 @@ |
17 | +#----------------------------------------------------------------------------- |
18 | +# Common installation configuration for all projects. |
19 | +#----------------------------------------------------------------------------- |
20 | + |
21 | +#----------------------------------------------------------------------------- |
22 | +# default installation target for applications |
23 | +#----------------------------------------------------------------------------- |
24 | +contains( TEMPLATE, app ) { |
25 | + target.path = $${INSTALL_PREFIX}/bin |
26 | + INSTALLS += target |
27 | + message("====") |
28 | + message("==== INSTALLS += target") |
29 | +} |
30 | + |
31 | +#----------------------------------------------------------------------------- |
32 | +# default installation target for libraries |
33 | +#----------------------------------------------------------------------------- |
34 | +contains( TEMPLATE, lib ) { |
35 | + |
36 | + target.path = $${INSTALL_LIBDIR} |
37 | + INSTALLS += target |
38 | + message("====") |
39 | + message("==== INSTALLS += target") |
40 | + |
41 | + # reset the .pc file's `prefix' variable |
42 | + #include( tools/fix-pc-prefix.pri ) |
43 | + |
44 | +} |
45 | + |
46 | +#----------------------------------------------------------------------------- |
47 | +# target for header files |
48 | +#----------------------------------------------------------------------------- |
49 | +!isEmpty( headers.files ) { |
50 | + headers.path = $${INSTALL_PREFIX}/include/ubuntu/download_manager |
51 | + INSTALLS += headers |
52 | + message("====") |
53 | + message("==== INSTALLS += headers") |
54 | +} else { |
55 | + message("====") |
56 | + message("==== NOTE: Remember to add your API headers into `headers.files' for installation!") |
57 | +} |
58 | + |
59 | + |
60 | +# End of File |
61 | |
62 | === added file 'common-pkgconfig.pri' |
63 | --- common-pkgconfig.pri 1970-01-01 00:00:00 +0000 |
64 | +++ common-pkgconfig.pri 2013-12-20 23:43:17 +0000 |
65 | @@ -0,0 +1,10 @@ |
66 | +# Include this file after defining the pkgconfig.files variable |
67 | + |
68 | +!isEmpty(pkgconfig.files) { |
69 | + QMAKE_SUBSTITUTES += $${pkgconfig.files}.in |
70 | + pkgconfig.CONFIG = no_check_exist |
71 | + pkgconfig.path = $${INSTALL_LIBDIR}/pkgconfig |
72 | + QMAKE_EXTRA_TARGETS += pkgconfig |
73 | + |
74 | + QMAKE_CLEAN += $${pkgconfig.files} |
75 | +} |
76 | |
77 | === added file 'common-project-config.pri' |
78 | --- common-project-config.pri 1970-01-01 00:00:00 +0000 |
79 | +++ common-project-config.pri 2013-12-20 23:43:17 +0000 |
80 | @@ -0,0 +1,47 @@ |
81 | +#----------------------------------------------------------------------------- |
82 | +# Common configuration for all projects. |
83 | +#----------------------------------------------------------------------------- |
84 | + |
85 | +QT -= gui |
86 | +CONFIG += link_pkgconfig |
87 | + |
88 | +TOP_SRC_DIR = $$PWD |
89 | +TOP_BUILD_DIR = $${TOP_SRC_DIR}/$${BUILD_DIR} |
90 | +QMAKE_LIBDIR += $${TOP_BUILD_DIR} |
91 | +INCLUDEPATH += $${TOP_SRC_DIR} |
92 | +QMAKE_CXXFLAGS += -std=c++11 -Werror |
93 | + |
94 | +#----------------------------------------------------------------------------- |
95 | +# setup the installation prefix |
96 | +#----------------------------------------------------------------------------- |
97 | +INSTALL_PREFIX = /usr # default installation prefix |
98 | + |
99 | +# default prefix can be overriden by defining PREFIX when running qmake |
100 | +isEmpty( PREFIX ) { |
101 | + message("====") |
102 | + message("==== NOTE: To override the installation path run: `qmake PREFIX=/custom/path'") |
103 | + message("==== (current installation path is `$${INSTALL_PREFIX}')") |
104 | +} else { |
105 | + INSTALL_PREFIX = $${PREFIX} |
106 | + message("====") |
107 | + message("==== install prefix set to `$${INSTALL_PREFIX}'") |
108 | +} |
109 | + |
110 | +INSTALL_LIBDIR = $${INSTALL_PREFIX}/lib |
111 | + |
112 | +# default library directory can be overriden by defining LIBDIR when |
113 | +# running qmake |
114 | +isEmpty( LIBDIR ) { |
115 | + message("====") |
116 | + message("==== NOTE: To override the library installation path run: `qmake LIBDIR=/custom/path'") |
117 | + message("==== (current installation path is `$${INSTALL_LIBDIR}')") |
118 | +} else { |
119 | + INSTALL_LIBDIR = $${LIBDIR} |
120 | + message("====") |
121 | + message("==== library install path set to `$${INSTALL_LIBDIR}'") |
122 | +} |
123 | + |
124 | +include( coverage.pri ) |
125 | + |
126 | +# End of File |
127 | + |
128 | |
129 | === added file 'common-vars.pri' |
130 | --- common-vars.pri 1970-01-01 00:00:00 +0000 |
131 | +++ common-vars.pri 2013-12-20 23:43:17 +0000 |
132 | @@ -0,0 +1,21 @@ |
133 | +#----------------------------------------------------------------------------- |
134 | +# Common variables for all projects. |
135 | +#----------------------------------------------------------------------------- |
136 | +DEFINES += BUILDING_UBUNTU_DOWNLOAD_MANAGER |
137 | + |
138 | + |
139 | +#----------------------------------------------------------------------------- |
140 | +# Project name (used e.g. in include file and doc install path). |
141 | +#----------------------------------------------------------------------------- |
142 | +PROJECT_NAME = ubuntu-download-manager |
143 | + |
144 | + |
145 | +#----------------------------------------------------------------------------- |
146 | +# Project version |
147 | +#----------------------------------------------------------------------------- |
148 | +PROJECT_VERSION = 0.3 |
149 | + |
150 | +#----------------------------------------------------------------------------- |
151 | +# Library version |
152 | +#----------------------------------------------------------------------------- |
153 | +VERSION = 0.3 |
154 | |
155 | === modified file 'debian/control' |
156 | --- debian/control 2013-09-23 11:22:48 +0000 |
157 | +++ debian/control 2013-12-20 23:43:17 +0000 |
158 | @@ -17,11 +17,22 @@ |
159 | # upstream branch |
160 | Vcs-Bzr: lp:ubuntu-download-manager |
161 | |
162 | -Package: libubuntudownloadmanager1 |
163 | -Section: libs |
164 | -Architecture: any |
165 | -Depends: ${misc:Depends}, |
166 | - ${shlibs:Depends}, |
167 | +Package: ubuntu-download-manager-common1 |
168 | +Section: libs |
169 | +Architecture: any |
170 | +Depends: ${misc:Depends}, |
171 | + ${shlibs:Depends}, |
172 | +Description: Ubuntu Download Manager - shared common library |
173 | + Ubuntu Download Manager performs downloads from a centralized location. |
174 | + . |
175 | + This package includes the common shared library between the client lib and and the service lib. |
176 | + |
177 | +Package: ubuntu-download-manager-priv1 |
178 | +Section: libs |
179 | +Architecture: any |
180 | +Depends: ${misc:Depends}, |
181 | + ${shlibs:Depends}, |
182 | + ubuntu-download-manager-common1 (= ${binary:Version}), |
183 | Description: Ubuntu Download Manager - shared library |
184 | Ubuntu Download Manager performs downloads from a centralized location. |
185 | . |
186 | @@ -32,7 +43,7 @@ |
187 | Architecture: any |
188 | Depends: ${misc:Depends}, |
189 | ${shlibs:Depends}, |
190 | - libubuntudownloadmanager1 (= ${binary:Version}), |
191 | + ubuntu-download-manager-priv1 (= ${binary:Version}), |
192 | Description: Ubuntu Download Manager - daemon |
193 | Ubuntu Download Manager performs downloads from a centralized location. |
194 | . |
195 | |
196 | === added file 'debian/ubuntu-download-manager-common-dev.install' |
197 | --- debian/ubuntu-download-manager-common-dev.install 1970-01-01 00:00:00 +0000 |
198 | +++ debian/ubuntu-download-manager-common-dev.install 2013-12-20 23:43:17 +0000 |
199 | @@ -0,0 +1,5 @@ |
200 | +usr/include/ubuntu/download_manager/metatypes.h |
201 | +usr/include/ubuntu/download_manager/download_struct.h |
202 | +usr/include/ubuntu/download_manager/group_download_struct.h |
203 | +usr/lib/*/libubuntu-download-manager-common.so |
204 | +usr/lib/*/pkgconfig/ubuntu-download-manager-common.pc |
205 | |
206 | === added file 'debian/ubuntu-download-manager-common1.install' |
207 | --- debian/ubuntu-download-manager-common1.install 1970-01-01 00:00:00 +0000 |
208 | +++ debian/ubuntu-download-manager-common1.install 2013-12-20 23:43:17 +0000 |
209 | @@ -0,0 +1,1 @@ |
210 | +usr/lib/libubuntu-download-manager-common.so.* |
211 | |
212 | === renamed file 'debian/libubuntudownloadmanager1.install' => 'debian/ubuntu-download-manager-priv1.install' |
213 | --- debian/libubuntudownloadmanager1.install 2013-07-18 19:56:30 +0000 |
214 | +++ debian/ubuntu-download-manager-priv1.install 2013-12-20 23:43:17 +0000 |
215 | @@ -1,1 +1,1 @@ |
216 | -usr/lib/libubuntudownloadmanager.so.* |
217 | +usr/lib/libubuntu-download-manager-priv.so.* |
218 | |
219 | === modified file 'download-manager.pro' |
220 | --- download-manager.pro 2013-07-03 11:02:59 +0000 |
221 | +++ download-manager.pro 2013-12-20 23:43:17 +0000 |
222 | @@ -4,10 +4,13 @@ |
223 | CONFIG += ordered |
224 | |
225 | SUBDIRS += \ |
226 | - libubuntudownloadmanager \ |
227 | + ubuntu-download-manager-common \ |
228 | + ubuntu-download-manager-priv \ |
229 | ubuntu-download-manager \ |
230 | ubuntu-download-manager-tests |
231 | |
232 | -ubuntu-download-manager.depends = libubuntudownloadmanager |
233 | - |
234 | -ubuntu-download-manager-tests.depends = libubuntudownloadmanager |
235 | +ubuntu-download-manager-priv.depends = ubuntu-download-manager-common |
236 | + |
237 | +ubuntu-download-manager.depends = ubuntu-download-manager-priv |
238 | + |
239 | +ubuntu-download-manager-tests.depends = ubuntu-download-manager-priv |
240 | |
241 | === added directory 'ubuntu-download-manager-common' |
242 | === added directory 'ubuntu-download-manager-common/ubuntu' |
243 | === added file 'ubuntu-download-manager-common/ubuntu-download-manager-common.pc.in' |
244 | --- ubuntu-download-manager-common/ubuntu-download-manager-common.pc.in 1970-01-01 00:00:00 +0000 |
245 | +++ ubuntu-download-manager-common/ubuntu-download-manager-common.pc.in 2013-12-20 23:43:17 +0000 |
246 | @@ -0,0 +1,12 @@ |
247 | +prefix=$$INSTALL_PREFIX |
248 | +exec_prefix=${prefix} |
249 | +libdir=$$INSTALL_LIBDIR |
250 | +includedir=${prefix}/include/ubuntu/download_manager |
251 | + |
252 | +Name: ubuntu-download-manager-common |
253 | +Description: Common Ubuntu Download Manager lib |
254 | +Version: $$PROJECT_VERSION |
255 | +Libs: -L${libdir} -lubuntu-download-manager-common |
256 | +Requires: Qt5Core Qt5DBus |
257 | +Cflags: -I${includedir} |
258 | + |
259 | |
260 | === added file 'ubuntu-download-manager-common/ubuntu-download-manager-common.pro' |
261 | --- ubuntu-download-manager-common/ubuntu-download-manager-common.pro 1970-01-01 00:00:00 +0000 |
262 | +++ ubuntu-download-manager-common/ubuntu-download-manager-common.pro 2013-12-20 23:43:17 +0000 |
263 | @@ -0,0 +1,39 @@ |
264 | +include( ../common-project-config.pri ) |
265 | +include( ../common-vars.pri ) |
266 | + |
267 | +QT += dbus |
268 | +QT -= gui |
269 | + |
270 | +TARGET = ubuntu-download-manager-common |
271 | +TEMPLATE = lib |
272 | + |
273 | +DEFINES += LIBUBUNTUDOWNLOADMANAGERCOMMON_LIBRARY |
274 | + |
275 | +SOURCES += \ |
276 | + ubuntu/download_manager/download_struct.cpp \ |
277 | + ubuntu/download_manager/group_download_struct.cpp \ |
278 | + ubuntu/download_manager/system/hash_algorithm.cpp |
279 | + |
280 | +public_headers = \ |
281 | + ubuntu/download_manager/metatypes.h \ |
282 | + ubuntu/download_manager/download_struct.h \ |
283 | + ubuntu/download_manager/group_download_struct.h |
284 | + |
285 | +private_headers = \ |
286 | + ubuntu_download_manager_common_global.h \ |
287 | + ubuntu/download_manager/system/hash_algorithm.h |
288 | + |
289 | +HEADERS +=\ |
290 | + $$public_headers \ |
291 | + $$private_headers |
292 | + |
293 | +headers.files = $$public_headers |
294 | + |
295 | +include(../common-installs-config.pri) |
296 | + |
297 | +pkgconfig.files = ubuntu-download-manager-common.pc |
298 | +include(../common-pkgconfig.pri) |
299 | +INSTALLS += pkgconfig |
300 | + |
301 | +OTHER_FILES += \ |
302 | + ubuntu-download-manager-common.pc.in |
303 | |
304 | === added directory 'ubuntu-download-manager-common/ubuntu/download_manager' |
305 | === renamed file 'libubuntudownloadmanager/downloads/download_struct.cpp' => 'ubuntu-download-manager-common/ubuntu/download_manager/download_struct.cpp' |
306 | --- libubuntudownloadmanager/downloads/download_struct.cpp 2013-10-25 11:44:53 +0000 |
307 | +++ ubuntu-download-manager-common/ubuntu/download_manager/download_struct.cpp 2013-12-20 23:43:17 +0000 |
308 | @@ -16,7 +16,7 @@ |
309 | * Boston, MA 02110-1301, USA. |
310 | */ |
311 | |
312 | -#include "downloads/download_struct.h" |
313 | +#include "download_struct.h" |
314 | |
315 | namespace Ubuntu { |
316 | |
317 | |
318 | === renamed file 'libubuntudownloadmanager/downloads/download_struct.h' => 'ubuntu-download-manager-common/ubuntu/download_manager/download_struct.h' |
319 | === renamed file 'libubuntudownloadmanager/downloads/group_download_struct.cpp' => 'ubuntu-download-manager-common/ubuntu/download_manager/group_download_struct.cpp' |
320 | --- libubuntudownloadmanager/downloads/group_download_struct.cpp 2013-10-25 11:44:53 +0000 |
321 | +++ ubuntu-download-manager-common/ubuntu/download_manager/group_download_struct.cpp 2013-12-20 23:43:17 +0000 |
322 | @@ -17,7 +17,7 @@ |
323 | */ |
324 | |
325 | #include <QDBusMetaType> |
326 | -#include "downloads/group_download_struct.h" |
327 | +#include "group_download_struct.h" |
328 | #include "system/hash_algorithm.h" |
329 | |
330 | namespace Ubuntu { |
331 | |
332 | === renamed file 'libubuntudownloadmanager/downloads/group_download_struct.h' => 'ubuntu-download-manager-common/ubuntu/download_manager/group_download_struct.h' |
333 | === renamed file 'libubuntudownloadmanager/metatypes.h' => 'ubuntu-download-manager-common/ubuntu/download_manager/metatypes.h' |
334 | --- libubuntudownloadmanager/metatypes.h 2013-12-13 13:23:18 +0000 |
335 | +++ ubuntu-download-manager-common/ubuntu/download_manager/metatypes.h 2013-12-20 23:43:17 +0000 |
336 | @@ -21,8 +21,8 @@ |
337 | |
338 | #include <QMap> |
339 | #include <QList> |
340 | -#include "downloads/group_download_struct.h" |
341 | -#include "downloads/download_struct.h" |
342 | +#include "group_download_struct.h" |
343 | +#include "download_struct.h" |
344 | |
345 | using namespace Ubuntu::DownloadManager; |
346 | |
347 | |
348 | === added directory 'ubuntu-download-manager-common/ubuntu/download_manager/system' |
349 | === renamed file 'libubuntudownloadmanager/system/hash_algorithm.cpp' => 'ubuntu-download-manager-common/ubuntu/download_manager/system/hash_algorithm.cpp' |
350 | === renamed file 'libubuntudownloadmanager/system/hash_algorithm.h' => 'ubuntu-download-manager-common/ubuntu/download_manager/system/hash_algorithm.h' |
351 | === added file 'ubuntu-download-manager-common/ubuntu_download_manager_common_global.h' |
352 | --- ubuntu-download-manager-common/ubuntu_download_manager_common_global.h 1970-01-01 00:00:00 +0000 |
353 | +++ ubuntu-download-manager-common/ubuntu_download_manager_common_global.h 2013-12-20 23:43:17 +0000 |
354 | @@ -0,0 +1,12 @@ |
355 | +#ifndef LIBUBUNTUDOWNLOADMANAGERCOMMON_GLOBAL_H |
356 | +#define LIBUBUNTUDOWNLOADMANAGERCOMMON_GLOBAL_H |
357 | + |
358 | +#include <QtCore/qglobal.h> |
359 | + |
360 | +#if defined(LIBUBUNTUDOWNLOADMANAGERCOMMON_LIBRARY) |
361 | +# define LIBUBUNTUDOWNLOADMANAGERCOMMONSHARED_EXPORT Q_DECL_EXPORT |
362 | +#else |
363 | +# define LIBUBUNTUDOWNLOADMANAGERCOMMONSHARED_EXPORT Q_DECL_IMPORT |
364 | +#endif |
365 | + |
366 | +#endif // LIBUBUNTUDOWNLOADMANAGERCOMMON_GLOBAL_H |
367 | |
368 | === renamed directory 'libubuntudownloadmanager' => 'ubuntu-download-manager-priv' |
369 | === modified file 'ubuntu-download-manager-priv/downloads/download_adaptor.h' |
370 | --- libubuntudownloadmanager/downloads/download_adaptor.h 2013-11-07 00:35:48 +0000 |
371 | +++ ubuntu-download-manager-priv/downloads/download_adaptor.h 2013-12-20 23:43:17 +0000 |
372 | @@ -14,7 +14,7 @@ |
373 | |
374 | #include <QtCore/QObject> |
375 | #include <QtDBus/QtDBus> |
376 | -#include "metatypes.h" |
377 | +#include <ubuntu/download_manager/metatypes.h> |
378 | |
379 | QT_BEGIN_NAMESPACE |
380 | class QByteArray; |
381 | |
382 | === modified file 'ubuntu-download-manager-priv/downloads/download_manager_adaptor.h' |
383 | --- libubuntudownloadmanager/downloads/download_manager_adaptor.h 2013-10-25 11:44:53 +0000 |
384 | +++ ubuntu-download-manager-priv/downloads/download_manager_adaptor.h 2013-12-20 23:43:17 +0000 |
385 | @@ -14,7 +14,7 @@ |
386 | |
387 | #include <QtCore/QObject> |
388 | #include <QtDBus/QtDBus> |
389 | -#include "metatypes.h" |
390 | +#include <ubuntu/download_manager/metatypes.h> |
391 | QT_BEGIN_NAMESPACE |
392 | class QByteArray; |
393 | template<class T> class QList; |
394 | |
395 | === modified file 'ubuntu-download-manager-priv/downloads/downloads_db.cpp' |
396 | --- libubuntudownloadmanager/downloads/downloads_db.cpp 2013-12-17 15:57:52 +0000 |
397 | +++ ubuntu-download-manager-priv/downloads/downloads_db.cpp 2013-12-20 23:43:17 +0000 |
398 | @@ -25,8 +25,8 @@ |
399 | #include <QSqlDatabase> |
400 | #include <QSqlQuery> |
401 | #include <QSqlError> |
402 | +#include <ubuntu/download_manager/system/hash_algorithm.h> |
403 | #include "downloads/downloads_db.h" |
404 | -#include "system/hash_algorithm.h" |
405 | #include "system/logger.h" |
406 | |
407 | #define SINGLE_DOWNLOAD_TABLE "CREATE TABLE SingleDownload("\ |
408 | @@ -125,7 +125,11 @@ |
409 | DownloadsDb::init() { |
410 | TRACE; |
411 | // create the required tables |
412 | - qDebug() << "open the db" << _db.open(); |
413 | + bool opened = _db.open(); |
414 | + if (!opened) { |
415 | + qCritical() << _db.lastError(); |
416 | + return false; |
417 | + } |
418 | |
419 | _db.transaction(); |
420 | |
421 | @@ -190,8 +194,8 @@ |
422 | |
423 | QString |
424 | DownloadsDb::metadataToString(const QVariantMap& metadata) { |
425 | - QJsonDocument json = QJsonDocument::fromVariant(QVariant(metadata)); |
426 | - return QString(json.toJson()); |
427 | + QJsonDocument jsonDoc = QJsonDocument::fromVariant(QVariant(metadata)); |
428 | + return QString(jsonDoc.toJson()); |
429 | } |
430 | |
431 | QString |
432 | @@ -200,15 +204,20 @@ |
433 | foreach(const QString& key, headers.keys()) { |
434 | headersVariant[key] = headers[key]; |
435 | } |
436 | - QJsonDocument json = QJsonDocument::fromVariant( |
437 | + QJsonDocument jsonDoc = QJsonDocument::fromVariant( |
438 | QVariant(headersVariant)); |
439 | - return QString(json.toJson()); |
440 | + return QString(jsonDoc.toJson()); |
441 | } |
442 | |
443 | bool |
444 | DownloadsDb::storeSingleDownload(FileDownload* download) { |
445 | // decide if we store it as a new download or update an existing one |
446 | - _db.open(); |
447 | + bool opened = _db.open(); |
448 | + |
449 | + if (!opened) { |
450 | + qCritical() << _db.lastError(); |
451 | + return false; |
452 | + } |
453 | |
454 | QSqlQuery query; |
455 | query.prepare(PRESENT_SINGLE_DOWNLOAD); |
456 | |
457 | === modified file 'ubuntu-download-manager-priv/downloads/factory.h' |
458 | --- libubuntudownloadmanager/downloads/factory.h 2013-11-28 15:31:10 +0000 |
459 | +++ ubuntu-download-manager-priv/downloads/factory.h 2013-12-20 23:43:17 +0000 |
460 | @@ -20,7 +20,7 @@ |
461 | #define DOWNLOADER_LIB_DOWNLOAD_FACTORY_H |
462 | |
463 | #include <QObject> |
464 | -#include "metatypes.h" |
465 | +#include <ubuntu/download_manager/metatypes.h> |
466 | #include "downloads/download.h" |
467 | #include "system/apparmor.h" |
468 | #include "system/system_network_info.h" |
469 | |
470 | === modified file 'ubuntu-download-manager-priv/downloads/file_download.cpp' |
471 | --- libubuntudownloadmanager/downloads/file_download.cpp 2013-12-19 13:09:05 +0000 |
472 | +++ ubuntu-download-manager-priv/downloads/file_download.cpp 2013-12-20 23:43:17 +0000 |
473 | @@ -24,8 +24,8 @@ |
474 | #include <QFile> |
475 | #include <QFileInfo> |
476 | #include <QSslError> |
477 | +#include <ubuntu/download_manager/system/hash_algorithm.h> |
478 | #include "downloads/file_download.h" |
479 | -#include "system/hash_algorithm.h" |
480 | #include "system/logger.h" |
481 | #include "system/network_reply.h" |
482 | |
483 | @@ -234,7 +234,6 @@ |
484 | if (!flushFile()) { |
485 | return; |
486 | } |
487 | - |
488 | qulonglong received = _currentData->size(); |
489 | |
490 | if (bytesTotal == -1) { |
491 | |
492 | === modified file 'ubuntu-download-manager-priv/downloads/file_download.h' |
493 | --- libubuntudownloadmanager/downloads/file_download.h 2013-12-19 13:09:05 +0000 |
494 | +++ ubuntu-download-manager-priv/downloads/file_download.h 2013-12-20 23:43:17 +0000 |
495 | @@ -19,6 +19,7 @@ |
496 | #ifndef DOWNLOADER_LIB_SINGLE_DOWNLOAD_H |
497 | #define DOWNLOADER_LIB_SINGLE_DOWNLOAD_H |
498 | |
499 | +#include <QFile> |
500 | #include <QNetworkReply> |
501 | #include <QProcess> |
502 | #include <QSharedPointer> |
503 | |
504 | === modified file 'ubuntu-download-manager-priv/downloads/group_download.cpp' |
505 | --- libubuntudownloadmanager/downloads/group_download.cpp 2013-12-02 11:05:31 +0000 |
506 | +++ ubuntu-download-manager-priv/downloads/group_download.cpp 2013-12-20 23:43:17 +0000 |
507 | @@ -17,10 +17,10 @@ |
508 | */ |
509 | |
510 | #include <QDebug> |
511 | +#include <ubuntu/download_manager/system/hash_algorithm.h> |
512 | #include "downloads/download_adaptor.h" |
513 | #include "downloads/file_download.h" |
514 | #include "downloads/group_download.h" |
515 | -#include "system/hash_algorithm.h" |
516 | #include "system/logger.h" |
517 | #include "system/uuid_factory.h" |
518 | |
519 | |
520 | === modified file 'ubuntu-download-manager-priv/downloads/group_download.h' |
521 | --- libubuntudownloadmanager/downloads/group_download.h 2013-11-28 11:46:34 +0000 |
522 | +++ ubuntu-download-manager-priv/downloads/group_download.h 2013-12-20 23:43:17 +0000 |
523 | @@ -23,10 +23,10 @@ |
524 | #include <QList> |
525 | #include <QObject> |
526 | #include <QSharedPointer> |
527 | +#include <ubuntu/download_manager/group_download_struct.h> |
528 | #include "downloads/download.h" |
529 | #include "downloads/factory.h" |
530 | #include "downloads/file_download.h" |
531 | -#include "downloads/group_download_struct.h" |
532 | #include "system/file_manager.h" |
533 | |
534 | namespace Ubuntu { |
535 | |
536 | === modified file 'ubuntu-download-manager-priv/downloads/group_download_adaptor.h' |
537 | --- libubuntudownloadmanager/downloads/group_download_adaptor.h 2013-11-07 00:42:08 +0000 |
538 | +++ ubuntu-download-manager-priv/downloads/group_download_adaptor.h 2013-12-20 23:43:17 +0000 |
539 | @@ -14,7 +14,7 @@ |
540 | |
541 | #include <QtCore/QObject> |
542 | #include <QtDBus/QtDBus> |
543 | -#include "metatypes.h" |
544 | +#include <ubuntu/download_manager/metatypes.h> |
545 | QT_BEGIN_NAMESPACE |
546 | class QByteArray; |
547 | template<class T> class QList; |
548 | |
549 | === modified file 'ubuntu-download-manager-priv/downloads/manager.h' |
550 | --- libubuntudownloadmanager/downloads/manager.h 2013-11-29 11:44:07 +0000 |
551 | +++ ubuntu-download-manager-priv/downloads/manager.h 2013-12-20 23:43:17 +0000 |
552 | @@ -24,7 +24,7 @@ |
553 | #include <QtDBus/QDBusObjectPath> |
554 | #include <QtDBus/QDBusContext> |
555 | #include <QSslCertificate> |
556 | -#include "metatypes.h" |
557 | +#include <ubuntu/download_manager/metatypes.h> |
558 | #include "downloads/download.h" |
559 | #include "downloads/queue.h" |
560 | #include "downloads/factory.h" |
561 | |
562 | === modified file 'ubuntu-download-manager-priv/system/dbus_proxy.h' |
563 | --- libubuntudownloadmanager/system/dbus_proxy.h 2013-10-24 12:39:46 +0000 |
564 | +++ ubuntu-download-manager-priv/system/dbus_proxy.h 2013-12-20 23:43:17 +0000 |
565 | @@ -19,7 +19,7 @@ |
566 | #include <QtCore/QStringList> |
567 | #include <QtCore/QVariant> |
568 | #include <QtDBus/QtDBus> |
569 | -#include "metatypes.h" |
570 | +#include <ubuntu/download_manager/metatypes.h> |
571 | |
572 | /* |
573 | * Proxy class for interface org.freedesktop.DBus |
574 | |
575 | === renamed file 'libubuntudownloadmanager/libubuntudownloadmanager.pro' => 'ubuntu-download-manager-priv/ubuntu-download-manager-priv.pro' |
576 | --- libubuntudownloadmanager/libubuntudownloadmanager.pro 2013-11-11 16:30:03 +0000 |
577 | +++ ubuntu-download-manager-priv/ubuntu-download-manager-priv.pro 2013-12-20 23:43:17 +0000 |
578 | @@ -1,8 +1,10 @@ |
579 | +include(../common-project-config.pri) |
580 | +include(../common-vars.pri) |
581 | + |
582 | QT += network dbus systeminfo sql |
583 | QT -= gui |
584 | |
585 | -TARGET = ubuntudownloadmanager |
586 | -QMAKE_CXXFLAGS += -std=c++0x -Werror |
587 | +TARGET = ubuntu-download-manager-priv |
588 | TEMPLATE = lib |
589 | |
590 | DEFINES += APPDOWNLOADERLIB_LIBRARY |
591 | @@ -18,14 +20,11 @@ |
592 | downloads/manager.cpp \ |
593 | downloads/download_manager_adaptor.cpp \ |
594 | downloads/queue.cpp \ |
595 | - downloads/download_struct.cpp \ |
596 | downloads/group_download.cpp \ |
597 | - downloads/group_download_struct.cpp \ |
598 | downloads/group_download_adaptor.cpp \ |
599 | downloads/file_download.cpp \ |
600 | downloads/sm_file_download.cpp \ |
601 | downloads/state_machines/download_sm.cpp \ |
602 | - system/hash_algorithm.cpp \ |
603 | system/uuid_utils.cpp \ |
604 | system/uuid_factory.cpp \ |
605 | system/timer.cpp \ |
606 | @@ -53,14 +52,11 @@ |
607 | downloads/manager.h \ |
608 | downloads/download_manager_adaptor.h \ |
609 | downloads/queue.h \ |
610 | - downloads/download_struct.h \ |
611 | downloads/group_download.h \ |
612 | - downloads/group_download_struct.h \ |
613 | downloads/group_download_adaptor.h \ |
614 | downloads/file_download.h \ |
615 | downloads/sm_file_download.h \ |
616 | downloads/state_machines/download_sm.h \ |
617 | - system/hash_algorithm.h \ |
618 | system/uuid_utils.h \ |
619 | system/uuid_factory.h \ |
620 | system/timer.h \ |
621 | @@ -75,7 +71,6 @@ |
622 | system/apparmor.h \ |
623 | system/network_reply.h \ |
624 | system/dbus_proxy.h \ |
625 | - metatypes.h \ |
626 | downloads/state_machines/state.h \ |
627 | downloads/state_machines/final_state.h |
628 | |
629 | @@ -90,11 +85,14 @@ |
630 | downloads/com.canonical.applications.download.xml \ |
631 | downloads/generate_adaptors.sh |
632 | |
633 | -target.path = /usr/lib/ |
634 | -INSTALLS += target |
635 | +include(../common-installs-config.pri) |
636 | |
637 | LIBS += -lnih-dbus |
638 | |
639 | -CONFIG += link_pkgconfig |
640 | PKGCONFIG += dbus-1 |
641 | |
642 | + |
643 | +LIBS += -L$$OUT_PWD/../ubuntu-download-manager-common/ -lubuntu-download-manager-common |
644 | + |
645 | +INCLUDEPATH += $$PWD/../ubuntu-download-manager-common |
646 | +DEPENDPATH += $$PWD/../ubuntu-download-manager-common |
647 | |
648 | === modified file 'ubuntu-download-manager-tests/downloads/test_download.cpp' |
649 | --- ubuntu-download-manager-tests/downloads/test_download.cpp 2013-12-19 13:09:05 +0000 |
650 | +++ ubuntu-download-manager-tests/downloads/test_download.cpp 2013-12-20 23:43:17 +0000 |
651 | @@ -20,7 +20,7 @@ |
652 | #include <QNetworkRequest> |
653 | #include <QSignalSpy> |
654 | #include <QSslError> |
655 | -#include <system/hash_algorithm.h> |
656 | +#include <ubuntu/download_manager/system/hash_algorithm.h> |
657 | #include <system/uuid_utils.h> |
658 | #include "fakes/fake_network_reply.h" |
659 | #include "fakes/fake_process.h" |
660 | |
661 | === modified file 'ubuntu-download-manager-tests/downloads/test_download.h' |
662 | --- ubuntu-download-manager-tests/downloads/test_download.h 2013-12-19 13:09:05 +0000 |
663 | +++ ubuntu-download-manager-tests/downloads/test_download.h 2013-12-20 23:43:17 +0000 |
664 | @@ -22,7 +22,7 @@ |
665 | #include <QDir> |
666 | #include <QObject> |
667 | #include <downloads/file_download.h> |
668 | -#include <metatypes.h> |
669 | +#include <ubuntu/download_manager/metatypes.h> |
670 | #include "fakes/fake_system_network_info.h" |
671 | #include "fakes/fake_request_factory.h" |
672 | #include "fakes/fake_process_factory.h" |
673 | |
674 | === modified file 'ubuntu-download-manager-tests/downloads/test_download_factory.cpp' |
675 | --- ubuntu-download-manager-tests/downloads/test_download_factory.cpp 2013-12-02 11:05:31 +0000 |
676 | +++ ubuntu-download-manager-tests/downloads/test_download_factory.cpp 2013-12-20 23:43:17 +0000 |
677 | @@ -17,8 +17,8 @@ |
678 | */ |
679 | |
680 | #include <downloads/file_download.h> |
681 | +#include <ubuntu/download_manager/system/hash_algorithm.h> |
682 | #include <system/file_manager.h> |
683 | -#include <system/hash_algorithm.h> |
684 | #include <system/uuid_utils.h> |
685 | #include "test_download_factory.h" |
686 | |
687 | |
688 | === modified file 'ubuntu-download-manager-tests/downloads/test_download_manager.cpp' |
689 | --- ubuntu-download-manager-tests/downloads/test_download_manager.cpp 2013-12-02 11:05:31 +0000 |
690 | +++ ubuntu-download-manager-tests/downloads/test_download_manager.cpp 2013-12-20 23:43:17 +0000 |
691 | @@ -18,7 +18,7 @@ |
692 | |
693 | #include <QSignalSpy> |
694 | #include <downloads/factory.h> |
695 | -#include <downloads/download_struct.h> |
696 | +#include <ubuntu/download_manager/download_struct.h> |
697 | #include <system/uuid_utils.h> |
698 | #include "fakes/fake_process_factory.h" |
699 | #include "fakes/fake_system_network_info.h" |
700 | |
701 | === modified file 'ubuntu-download-manager-tests/downloads/test_downloads_db.cpp' |
702 | --- ubuntu-download-manager-tests/downloads/test_downloads_db.cpp 2013-12-02 11:05:31 +0000 |
703 | +++ ubuntu-download-manager-tests/downloads/test_downloads_db.cpp 2013-12-20 23:43:17 +0000 |
704 | @@ -22,8 +22,8 @@ |
705 | #include <QSqlDatabase> |
706 | #include <QSqlQuery> |
707 | #include <QSqlError> |
708 | -#include <metatypes.h> |
709 | -#include <system/hash_algorithm.h> |
710 | +#include <ubuntu/download_manager/metatypes.h> |
711 | +#include <ubuntu/download_manager/system/hash_algorithm.h> |
712 | #include <system/uuid_utils.h> |
713 | #include "fakes/fake_download.h" |
714 | #include "fakes/fake_system_network_info.h" |
715 | |
716 | === modified file 'ubuntu-download-manager-tests/fakes/fake_download.h' |
717 | --- ubuntu-download-manager-tests/fakes/fake_download.h 2013-11-27 13:29:03 +0000 |
718 | +++ ubuntu-download-manager-tests/fakes/fake_download.h 2013-12-20 23:43:17 +0000 |
719 | @@ -21,7 +21,7 @@ |
720 | #include <QSharedPointer> |
721 | #include <downloads/file_download.h> |
722 | #include <system/system_network_info.h> |
723 | -#include <metatypes.h> |
724 | +#include <ubuntu/download_manager/metatypes.h> |
725 | #include "fake.h" |
726 | |
727 | using namespace Ubuntu::DownloadManager; |
728 | |
729 | === modified file 'ubuntu-download-manager-tests/ubuntu-download-manager-tests.pro' |
730 | --- ubuntu-download-manager-tests/ubuntu-download-manager-tests.pro 2013-12-02 11:34:17 +0000 |
731 | +++ ubuntu-download-manager-tests/ubuntu-download-manager-tests.pro 2013-12-20 23:43:17 +0000 |
732 | @@ -1,15 +1,11 @@ |
733 | -#------------------------------------------------- |
734 | -# |
735 | -# Project created by QtCreator 2013-06-17T13:18:37 |
736 | -# |
737 | -#------------------------------------------------- |
738 | +include( ../common-project-config.pri ) |
739 | +include( ../common-vars.pri ) |
740 | |
741 | QT += network core testlib dbus systeminfo sql |
742 | |
743 | QT -= gui |
744 | |
745 | TARGET = ubuntu-download-manager-tests |
746 | -QMAKE_CXXFLAGS += -std=c++0x -Werror |
747 | CONFIG += console |
748 | CONFIG -= app_bundle |
749 | |
750 | @@ -87,12 +83,16 @@ |
751 | downloads/state_machines/test_final_state.h \ |
752 | downloads/state_machines/test_file_download_sm.h |
753 | |
754 | -LIBS += -L$$OUT_PWD/../libubuntudownloadmanager/ -lubuntudownloadmanager |
755 | - |
756 | -INCLUDEPATH += $$PWD/../libubuntudownloadmanager |
757 | -DEPENDPATH += $$PWD/../libubuntudownloadmanager |
758 | +LIBS += -L$$OUT_PWD/../ubuntu-download-manager-priv/ -lubuntu-download-manager-priv |
759 | + |
760 | +INCLUDEPATH += $$PWD/../ubuntu-download-manager-priv |
761 | +DEPENDPATH += $$PWD/../ubuntu-download-manager-priv |
762 | + |
763 | +LIBS += -L$$OUT_PWD/../ubuntu-download-manager-common/ -lubuntu-download-manager-common |
764 | + |
765 | +INCLUDEPATH += $$PWD/../ubuntu-download-manager-common |
766 | +DEPENDPATH += $$PWD/../ubuntu-udownload-manager-common |
767 | |
768 | check.depends = $${TARGET} |
769 | -check.commands = LD_LIBRARY_PATH=$$OUT_PWD/../libubuntudownloadmanager ./$${TARGET} |
770 | +check.commands = LD_LIBRARY_PATH=$$OUT_PWD/../ubuntu-download-manager-common:$$OUT_PWD/../ubuntu-download-manager-priv ./$${TARGET} |
771 | QMAKE_EXTRA_TARGETS += check |
772 | - |
773 | |
774 | === modified file 'ubuntu-download-manager/ubuntu-download-manager.pro' |
775 | --- ubuntu-download-manager/ubuntu-download-manager.pro 2013-09-20 12:51:26 +0000 |
776 | +++ ubuntu-download-manager/ubuntu-download-manager.pro 2013-12-20 23:43:17 +0000 |
777 | @@ -1,15 +1,11 @@ |
778 | -#------------------------------------------------- |
779 | -# |
780 | -# Project created by QtCreator 2013-06-12T13:03:54 |
781 | -# |
782 | -#------------------------------------------------- |
783 | +include( ../common-project-config.pri ) |
784 | +include( ../common-vars.pri ) |
785 | |
786 | QT += core systeminfo |
787 | |
788 | QT -= gui |
789 | |
790 | TARGET = ubuntu-download-manager |
791 | -QMAKE_CXXFLAGS += -std=c++0x -Werror |
792 | CONFIG += console |
793 | CONFIG -= app_bundle |
794 | |
795 | @@ -30,14 +26,18 @@ |
796 | dbus_system_conf.files = com.canonical.applications.Downloader.conf |
797 | INSTALLS += dbus_system_conf |
798 | |
799 | -target.path = /usr/bin/ |
800 | -INSTALLS += target |
801 | - |
802 | -LIBS += -L$$OUT_PWD/../libubuntudownloadmanager/ -lubuntudownloadmanager |
803 | - |
804 | -INCLUDEPATH += $$PWD/../libubuntudownloadmanager |
805 | -DEPENDPATH += $$PWD/../libubuntudownloadmanager |
806 | +include( ../common-installs-config.pri ) |
807 | + |
808 | +LIBS += -L$$OUT_PWD/../ubuntu-download-manager-priv/ -lubuntu-download-manager-priv |
809 | + |
810 | +INCLUDEPATH += $$PWD/../ubuntu-download-manager-priv |
811 | +DEPENDPATH += $$PWD/../ubuntu-download-manager-priv |
812 | |
813 | OTHER_FILES += \ |
814 | ubuntu-download-manager.service \ |
815 | com.canonical.applications.Downloader.conf |
816 | + |
817 | +LIBS += -L$$OUT_PWD/../ubuntu-download-manager-common/ -lubuntu-download-manager-common |
818 | + |
819 | +INCLUDEPATH += $$PWD/../ubuntu-download-manager-common |
820 | +DEPENDPATH += $$PWD/../ubuntu-download-manager-common |
PASSED: Continuous integration, rev:185 jenkins. qa.ubuntu. com/job/ ubuntu- download- manager- ci/268/ jenkins. qa.ubuntu. com/job/ ubuntu- download- manager- trusty- amd64-ci/ 157 jenkins. qa.ubuntu. com/job/ ubuntu- download- manager- trusty- armhf-ci/ 157
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/ubuntu- download- manager- ci/268/ rebuild
http://