Merge lp:~mandel/ubuntu-download-manager/general-errors into lp:ubuntu-download-manager

Proposed by Manuel de la Peña
Status: Merged
Approved by: Alfonso Sanchez-Beato
Approved revision: 346
Merged at revision: 339
Proposed branch: lp:~mandel/ubuntu-download-manager/general-errors
Merge into: lp:ubuntu-download-manager
Diff against target: 2471 lines (+762/-264)
63 files modified
CMakeLists.txt (+2/-2)
debian/changelog (+6/-0)
debian/control (+24/-24)
debian/libubuntu-download-manager-client1.install (+1/-1)
debian/libubuntu-download-manager-client1.symbols (+17/-1)
debian/libubuntu-download-manager-common1.install (+1/-1)
debian/libubuntu-download-manager-common1.symbols (+1/-1)
debian/libubuntu-upload-manager-common1.install (+1/-1)
debian/libubuntu-upload-manager-common1.symbols (+1/-1)
debian/libudm-common-dev.install (+1/-0)
debian/libudm-common1.install (+1/-1)
debian/libudm-common1.symbols (+29/-17)
debian/libudm-priv-common1.install (+1/-1)
docs/dbus/com.canonical.applications.download.xml (+5/-0)
docs/dbus/com.canonical.applications.testing.download_manager.xml (+7/-0)
src/common/public/CMakeLists.txt (+2/-0)
src/common/public/ubuntu/transfers/errors/auth_error_struct.cpp (+6/-5)
src/common/public/ubuntu/transfers/errors/auth_error_struct.h (+9/-12)
src/common/public/ubuntu/transfers/errors/hash_error_struct.cpp (+96/-0)
src/common/public/ubuntu/transfers/errors/hash_error_struct.h (+122/-0)
src/common/public/ubuntu/transfers/errors/http_error_struct.cpp (+2/-2)
src/common/public/ubuntu/transfers/errors/http_error_struct.h (+3/-5)
src/common/public/ubuntu/transfers/errors/network_error_struct.cpp (+2/-2)
src/common/public/ubuntu/transfers/errors/network_error_struct.h (+3/-6)
src/common/public/ubuntu/transfers/errors/process_error_struct.cpp (+7/-7)
src/common/public/ubuntu/transfers/errors/process_error_struct.h (+8/-11)
src/downloads/client/symbols.map (+6/-0)
src/downloads/client/ubuntu/download_manager/download_impl.cpp (+14/-1)
src/downloads/client/ubuntu/download_manager/download_impl.h (+3/-4)
src/downloads/client/ubuntu/download_manager/download_interface.cpp (+1/-1)
src/downloads/client/ubuntu/download_manager/download_interface.h (+2/-1)
src/downloads/client/ubuntu/download_manager/error.cpp (+88/-22)
src/downloads/client/ubuntu/download_manager/error.h (+71/-6)
src/downloads/client/ubuntu/download_manager/manager_impl.cpp (+3/-1)
src/downloads/common/ubuntu/download_manager/metatypes.h (+4/-4)
src/downloads/priv/ubuntu/downloads/download_adaptor.h (+5/-0)
src/downloads/priv/ubuntu/downloads/file_download.cpp (+2/-1)
src/downloads/priv/ubuntu/downloads/file_download.h (+2/-1)
src/downloads/priv/ubuntu/downloads/manager.cpp (+1/-0)
src/downloads/test-daemon/testing_daemon.cpp (+12/-1)
src/downloads/test-daemon/testing_daemon.h (+3/-4)
src/downloads/test-daemon/testing_file_download.cpp (+17/-1)
src/downloads/test-daemon/testing_file_download.h (+5/-4)
src/downloads/test-daemon/testing_interface.cpp (+1/-1)
src/downloads/test-daemon/testing_interface.h (+8/-1)
src/downloads/test-daemon/testing_manager.cpp (+12/-3)
src/downloads/test-daemon/testing_manager.h (+3/-4)
src/downloads/test-daemon/testing_manager_adaptor.cpp (+9/-1)
src/downloads/test-daemon/testing_manager_adaptor.h (+7/-1)
src/downloads/test-daemon/ubuntu-download-manager-test-daemon.pro.THIS (+0/-44)
tests/common/daemon_testcase.cpp (+26/-3)
tests/common/daemon_testcase.h (+3/-4)
tests/common/testing_interface.cpp (+1/-1)
tests/common/testing_interface.h (+8/-1)
tests/downloads/client/CMakeLists.txt (+7/-6)
tests/downloads/client/test_client_download.cpp (+37/-1)
tests/downloads/client/test_client_download.h (+4/-4)
tests/downloads/client/test_client_manager.cpp (+1/-1)
tests/downloads/client/test_group_manager_watch.h (+3/-5)
tests/downloads/daemon/CMakeLists.txt (+2/-1)
tests/downloads/daemon/test_download.cpp (+3/-1)
tests/downloads/daemon/test_final_state.cpp (+0/-4)
tests/downloads/qml/CMakeLists.txt (+30/-24)
To merge this branch: bzr merge lp:~mandel/ubuntu-download-manager/general-errors
Reviewer Review Type Date Requested Status
Alfonso Sanchez-Beato Approve
PS Jenkins bot continuous-integration Approve
Ricardo Salveti (community) Needs Information
Review via email: mp+251046@code.launchpad.net

Commit message

Ensure that the has errors are correctly fwd to the clients via dbus.

Description of the change

Ensure that the has errors are correctly fwd to the clients via dbus.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
340. By Manuel de la Peña

Update symbols.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
341. By Manuel de la Peña

Update install to include new header.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ricardo Salveti (rsalveti) wrote :

Comments inline.

review: Needs Information
342. By Manuel de la Peña

Update branch as per review.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
343. By Manuel de la Peña

Fix some issues with the state machine tests.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
344. By Manuel de la Peña

Ensure that the tests that need x can be ran in a headless server.

345. By Manuel de la Peña

Fix small control issue.

346. By Manuel de la Peña

Do no add xvfb as a dependency, we can build anyway.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

LGTM, there are just some formatting issues in a couple of places.

review: Needs Fixing
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

Not block the landing for formatting

review: Approve
347. By Manuel de la Peña

Link tests failing bug.

348. By Manuel de la Peña

Undo stupid changelog comment.

349. By Manuel de la Peña

Bump version number.

350. By Manuel de la Peña

Bump deb package number to match the so number.

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 2014-11-17 23:07:13 +0000
3+++ CMakeLists.txt 2015-07-24 16:42:57 +0000
4@@ -30,8 +30,8 @@
5 OUTPUT_STRIP_TRAILING_WHITESPACE
6 )
7
8-set(UDM_VERSION_MAJOR 0)
9-set(UDM_VERSION_MINOR 9)
10+set(UDM_VERSION_MAJOR 1)
11+set(UDM_VERSION_MINOR 0)
12 set(UDM_VERSION_PATCH 0)
13
14 find_package(Gtest REQUIRED)
15
16=== modified file 'debian/changelog'
17--- debian/changelog 2015-02-03 09:29:42 +0000
18+++ debian/changelog 2015-07-24 16:42:57 +0000
19@@ -1,3 +1,9 @@
20+ubuntu-download-manager (1.0-0ubuntu1) UNRELEASED; urgency=medium
21+
22+ * Bump version number due to the new ABI provided by the client lib.
23+
24+ -- Manuel de la Pena <manuel.delapena@canonical.com> Fri, 24 Jul 2015 18:41:02 +0200
25+
26 ubuntu-download-manager (0.9+15.04.20150203-0ubuntu1) vivid; urgency=medium
27
28 [ Manuel de la Pena ]
29
30=== modified file 'debian/control'
31--- debian/control 2014-11-26 12:21:53 +0000
32+++ debian/control 2015-07-24 16:42:57 +0000
33@@ -18,7 +18,7 @@
34 qtdeclarative5-dev,
35 qtdeclarative5-dev-tools,
36 qtdeclarative5-test-plugin,
37- network-manager
38+ network-manager,
39 Maintainer: Manuel de la Peña <manuel.delapena@canonical.com>
40 Standards-Version: 3.9.5
41 Homepage: https://launchpad.net/ubuntu-system-image
42@@ -27,7 +27,7 @@
43 # upstream branch
44 Vcs-Bzr: lp:ubuntu-download-manager
45
46-Package: libudm-common0
47+Package: libudm-common1
48 Section: libs
49 Architecture: any
50 Depends: ${misc:Depends},
51@@ -42,7 +42,7 @@
52 Package: libudm-common-dev
53 Section: libdevel
54 Architecture: any
55-Depends: libudm-common0 (= ${binary:Version}),
56+Depends: libudm-common1 (= ${binary:Version}),
57 qtbase5-dev,
58 ${shlibs:Depends},
59 ${misc:Depends}
60@@ -50,12 +50,12 @@
61 This package contains the common headers shared between the client library and
62 the daemon library.
63
64-Package: libudm-priv-common0
65+Package: libudm-priv-common1
66 Section: libs
67 Architecture: any
68 Depends: ${misc:Depends},
69 ${shlibs:Depends},
70- libudm-common0 (= ${binary:Version}),
71+ libudm-common1 (= ${binary:Version}),
72 Breaks: libubuntu-download-manager-priv1
73 Replaces: libubuntu-download-manager-priv1
74 Description: Upload Download Manager - shared private library
75@@ -63,10 +63,10 @@
76 .
77 This package includes the private shared library.
78
79-Package: libubuntu-download-manager-common0
80+Package: libubuntu-download-manager-common1
81 Section: libs
82 Architecture: any
83-Depends: libudm-common0 (= ${binary:Version}),
84+Depends: libudm-common1 (= ${binary:Version}),
85 ${misc:Depends},
86 ${shlibs:Depends},
87 Breaks: ubuntu-download-manager-common1
88@@ -81,7 +81,7 @@
89 Section: libdevel
90 Architecture: any
91 Depends: libudm-common-dev (= ${binary:Version}),
92- libubuntu-download-manager-common0 (= ${binary:Version}),
93+ libubuntu-download-manager-common1 (= ${binary:Version}),
94 qtbase5-dev,
95 ${shlibs:Depends},
96 ${misc:Depends}
97@@ -91,13 +91,13 @@
98 This package contains the common headers shared between the client library and
99 the daemon library.
100
101-Package: libubuntu-download-manager-client0
102+Package: libubuntu-download-manager-client1
103 Section: libs
104 Architecture: any
105 Depends: ${misc:Depends},
106 ${shlibs:Depends},
107- libudm-common0 (= ${binary:Version}),
108- libubuntu-download-manager-common0 (= ${binary:Version}),
109+ libudm-common1 (= ${binary:Version}),
110+ libubuntu-download-manager-common1 (= ${binary:Version}),
111 Breaks: ubuntu-download-manager-client1
112 Replaces: ubuntu-download-manager-client1
113 Description: Ubuntu Download Manager - shared public library
114@@ -110,7 +110,7 @@
115 Architecture: any
116 Depends: libudm-common-dev (= ${binary:Version}),
117 libubuntu-download-manager-common-dev (= ${binary:Version}),
118- libubuntu-download-manager-client0 (= ${binary:Version}),
119+ libubuntu-download-manager-client1 (= ${binary:Version}),
120 qtbase5-dev,
121 ${shlibs:Depends},
122 ${misc:Depends}
123@@ -128,10 +128,10 @@
124 Description: Documentation files for libcontent-hub-dev
125 Documentation files for the libcontent-hub development
126
127-Package: libubuntu-upload-manager-common0
128+Package: libubuntu-upload-manager-common1
129 Section: libs
130 Architecture: any
131-Depends: libudm-common0 (= ${binary:Version}),
132+Depends: libudm-common1 (= ${binary:Version}),
133 ${misc:Depends},
134 ${shlibs:Depends},
135 Description: Ubuntu Upload Manager - shared common library
136@@ -144,7 +144,7 @@
137 Section: libdevel
138 Architecture: any
139 Depends: libudm-common-dev (= ${binary:Version}),
140- libubuntu-download-manager-common0 (= ${binary:Version}),
141+ libubuntu-download-manager-common1 (= ${binary:Version}),
142 qtbase5-dev,
143 ${shlibs:Depends},
144 ${misc:Depends}
145@@ -157,9 +157,9 @@
146 Architecture: any
147 Depends: ${misc:Depends},
148 ${shlibs:Depends},
149- libudm-common0 (= ${binary:Version}),
150- libudm-priv-common0 (= ${binary:Version}),
151- libubuntu-download-manager-common0 (= ${binary:Version}),
152+ libudm-common1 (= ${binary:Version}),
153+ libudm-priv-common1 (= ${binary:Version}),
154+ libubuntu-download-manager-common1 (= ${binary:Version}),
155 unzip
156 Suggests: apparmor
157 Description: Ubuntu Download Manager - daemon
158@@ -172,9 +172,9 @@
159 Architecture: any
160 Depends: ${misc:Depends},
161 ${shlibs:Depends},
162- libudm-common0 (= ${binary:Version}),
163- libudm-priv-common0 (= ${binary:Version}),
164- libubuntu-upload-manager-common0 (= ${binary:Version}),
165+ libudm-common1 (= ${binary:Version}),
166+ libudm-priv-common1 (= ${binary:Version}),
167+ libubuntu-upload-manager-common1 (= ${binary:Version}),
168 Description: Ubuntu Upload Manager - daemon
169 Ubuntu Upload Manager performs uploads from a centralized location.
170 .
171@@ -185,9 +185,9 @@
172 Architecture: any
173 Depends: ${misc:Depends},
174 ${shlibs:Depends},
175- libudm-common0 (= ${binary:Version}),
176- libubuntu-download-manager-common0 (= ${binary:Version}),
177- libubuntu-download-manager-client0 (= ${binary:Version})
178+ libudm-common1 (= ${binary:Version}),
179+ libubuntu-download-manager-common1 (= ${binary:Version}),
180+ libubuntu-download-manager-client1 (= ${binary:Version})
181 Description: Ubuntu Download Manager Plugin
182 This package contains a QML Plugin to handle downloads from a pure QML
183 application, without the need to write any C++ code.
184
185=== renamed file 'debian/libubuntu-download-manager-client0.install' => 'debian/libubuntu-download-manager-client1.install'
186--- debian/libubuntu-download-manager-client0.install 2014-02-10 18:04:03 +0000
187+++ debian/libubuntu-download-manager-client1.install 2015-07-24 16:42:57 +0000
188@@ -1,1 +1,1 @@
189-usr/lib/*/libubuntu-download-manager-client.so.0*
190+usr/lib/*/libubuntu-download-manager-client.so.1*
191
192=== renamed file 'debian/libubuntu-download-manager-client0.symbols' => 'debian/libubuntu-download-manager-client1.symbols'
193--- debian/libubuntu-download-manager-client0.symbols 2014-10-14 16:08:07 +0000
194+++ debian/libubuntu-download-manager-client1.symbols 2015-07-24 16:42:57 +0000
195@@ -1,4 +1,4 @@
196-libubuntu-download-manager-client.so.0 libubuntu-download-manager-client0 #MINVER#
197+libubuntu-download-manager-client.so.1 libubuntu-download-manager-client1 #MINVER#
198 (c++)"Ubuntu::DownloadManager::NetworkError::errorString()@Base" 0.4+14.10.20140618
199 (c++)"Ubuntu::DownloadManager::NetworkError::qt_metacall(QMetaObject::Call, int, void**)@Base" 0.4+14.10.20140618
200 (c++)"Ubuntu::DownloadManager::NetworkError::qt_metacast(char const*)@Base" 0.4+14.10.20140618
201@@ -135,3 +135,19 @@
202 (c++)"vtable for Ubuntu::DownloadManager::AuthError@Base" 0.4+14.10.20140618
203 (c++)"vtable for Ubuntu::DownloadManager::DBusError@Base" 0.4+14.10.20140618
204 (c++)"vtable for Ubuntu::DownloadManager::HttpError@Base" 0.4+14.10.20140618
205+ (c++)"Ubuntu::DownloadManager::HashError::errorString()@Base" 0replaceme
206+ (c++)"Ubuntu::DownloadManager::HashError::qt_metacall(QMetaObject::Call, int, void**)@Base" 0replaceme
207+ (c++)"Ubuntu::DownloadManager::HashError::qt_metacast(char const*)@Base" 0replaceme
208+ (c++)"Ubuntu::DownloadManager::HashError::staticMetaObject@Base" 0replaceme
209+ (c++)"Ubuntu::DownloadManager::HashError::method()@Base" 0replaceme
210+ (c++)"Ubuntu::DownloadManager::HashError::checksum()@Base" 0replaceme
211+ (c++)"Ubuntu::DownloadManager::HashError::expected()@Base" 0replaceme
212+ (c++)"Ubuntu::DownloadManager::HashError::HashError(Ubuntu::Transfers::Errors::HashErrorStruct, QObject*)@Base" 0replaceme
213+ (c++)"Ubuntu::DownloadManager::HashError::HashError(Ubuntu::Transfers::Errors::HashErrorStruct, QObject*)@Base" 0replaceme
214+ (c++)"Ubuntu::DownloadManager::HashError::~HashError()@Base" 0replaceme
215+ (c++)"Ubuntu::DownloadManager::HashError::~HashError()@Base" 0replaceme
216+ (c++)"Ubuntu::DownloadManager::HashError::~HashError()@Base" 0replaceme
217+ (c++)"Ubuntu::DownloadManager::HashError::metaObject() const@Base" 0replaceme
218+ (c++)"typeinfo for Ubuntu::DownloadManager::HashError@Base" 0replaceme
219+ (c++)"typeinfo name for Ubuntu::DownloadManager::HashError@Base" 0replaceme
220+ (c++)"vtable for Ubuntu::DownloadManager::HashError@Base" 0replaceme
221
222=== renamed file 'debian/libubuntu-download-manager-common0.install' => 'debian/libubuntu-download-manager-common1.install'
223--- debian/libubuntu-download-manager-common0.install 2014-02-10 18:04:03 +0000
224+++ debian/libubuntu-download-manager-common1.install 2015-07-24 16:42:57 +0000
225@@ -1,1 +1,1 @@
226-usr/lib/*/libubuntu-download-manager-common.so.0*
227+usr/lib/*/libubuntu-download-manager-common.so.1*
228
229=== renamed file 'debian/libubuntu-download-manager-common0.symbols' => 'debian/libubuntu-download-manager-common1.symbols'
230--- debian/libubuntu-download-manager-common0.symbols 2014-06-18 14:49:04 +0000
231+++ debian/libubuntu-download-manager-common1.symbols 2015-07-24 16:42:57 +0000
232@@ -1,4 +1,4 @@
233-libubuntu-download-manager-common.so.0 libubuntu-download-manager-common0 #MINVER#
234+libubuntu-download-manager-common.so.1 libubuntu-download-manager-common1 #MINVER#
235 (c++)"Ubuntu::DownloadManager::DownloadStruct::getHeaders()@Base" 0.4+14.10.20140618
236 (c++)"Ubuntu::DownloadManager::DownloadStruct::getMetadata()@Base" 0.4+14.10.20140618
237 (c++)"Ubuntu::DownloadManager::DownloadStruct::getAlgorithm()@Base" 0.4+14.10.20140618
238
239=== renamed file 'debian/libubuntu-upload-manager-common0.install' => 'debian/libubuntu-upload-manager-common1.install'
240--- debian/libubuntu-upload-manager-common0.install 2014-02-25 15:21:34 +0000
241+++ debian/libubuntu-upload-manager-common1.install 2015-07-24 16:42:57 +0000
242@@ -1,1 +1,1 @@
243-usr/lib/*/libubuntu-upload-manager-common.so.0*
244+usr/lib/*/libubuntu-upload-manager-common.so.1*
245
246=== renamed file 'debian/libubuntu-upload-manager-common0.symbols' => 'debian/libubuntu-upload-manager-common1.symbols'
247--- debian/libubuntu-upload-manager-common0.symbols 2014-06-18 14:49:04 +0000
248+++ debian/libubuntu-upload-manager-common1.symbols 2015-07-24 16:42:57 +0000
249@@ -1,4 +1,4 @@
250-libubuntu-upload-manager-common.so.0 libubuntu-upload-manager-common0 #MINVER#
251+libubuntu-upload-manager-common.so.1 libubuntu-upload-manager-common1 #MINVER#
252 (c++)"Ubuntu::UploadManager::UploadStruct::getHeaders()@Base" 0.4+14.10.20140618
253 (c++)"Ubuntu::UploadManager::UploadStruct::getFilePath()@Base" 0.4+14.10.20140618
254 (c++)"Ubuntu::UploadManager::UploadStruct::getMetadata()@Base" 0.4+14.10.20140618
255
256=== modified file 'debian/libudm-common-dev.install'
257--- debian/libudm-common-dev.install 2014-06-06 10:05:15 +0000
258+++ debian/libudm-common-dev.install 2015-07-24 16:42:57 +0000
259@@ -1,6 +1,7 @@
260 usr/include/ubuntu/transfers/metadata.h
261 usr/include/ubuntu/transfers/visibility.h
262 usr/include/ubuntu/transfers/errors/auth_error_struct.h
263+usr/include/ubuntu/transfers/errors/hash_error_struct.h
264 usr/include/ubuntu/transfers/errors/http_error_struct.h
265 usr/include/ubuntu/transfers/errors/network_error_struct.h
266 usr/include/ubuntu/transfers/errors/process_error_struct.h
267
268=== renamed file 'debian/libudm-common0.install' => 'debian/libudm-common1.install'
269--- debian/libudm-common0.install 2014-02-25 15:21:34 +0000
270+++ debian/libudm-common1.install 2015-07-24 16:42:57 +0000
271@@ -1,1 +1,1 @@
272-usr/lib/*/libudm-common.so.0*
273+usr/lib/*/libudm-common.so.1*
274
275=== renamed file 'debian/libudm-common0.symbols' => 'debian/libudm-common1.symbols'
276--- debian/libudm-common0.symbols 2014-10-14 16:08:07 +0000
277+++ debian/libudm-common1.symbols 2015-07-24 16:42:57 +0000
278@@ -1,40 +1,24 @@
279-libudm-common.so.0 libudm-common0 #MINVER#
280- (c++)"Ubuntu::Transfers::Errors::AuthErrorStruct::getType()@Base" 0.4+14.10.20140618
281- (c++)"Ubuntu::Transfers::Errors::AuthErrorStruct::getPhrase()@Base" 0.4+14.10.20140618
282- (c++)"Ubuntu::Transfers::Errors::AuthErrorStruct::AuthErrorStruct(Ubuntu::Transfers::Errors::AuthErrorStruct::Type, QString)@Base" 0.4+14.10.20140618
283+libudm-common.so.1 libudm-common1 #MINVER#
284 (c++)"Ubuntu::Transfers::Errors::AuthErrorStruct::AuthErrorStruct(Ubuntu::Transfers::Errors::AuthErrorStruct const&)@Base" 0.4+14.10.20140618
285- (c++)"Ubuntu::Transfers::Errors::AuthErrorStruct::AuthErrorStruct(int, QString)@Base" 0.4+14.10.20140618
286 (c++)"Ubuntu::Transfers::Errors::AuthErrorStruct::AuthErrorStruct()@Base" 0.4+14.10.20140618
287- (c++)"Ubuntu::Transfers::Errors::AuthErrorStruct::AuthErrorStruct(Ubuntu::Transfers::Errors::AuthErrorStruct::Type, QString)@Base" 0.4+14.10.20140618
288 (c++)"Ubuntu::Transfers::Errors::AuthErrorStruct::AuthErrorStruct(Ubuntu::Transfers::Errors::AuthErrorStruct const&)@Base" 0.4+14.10.20140618
289- (c++)"Ubuntu::Transfers::Errors::AuthErrorStruct::AuthErrorStruct(int, QString)@Base" 0.4+14.10.20140618
290 (c++)"Ubuntu::Transfers::Errors::AuthErrorStruct::AuthErrorStruct()@Base" 0.4+14.10.20140618
291 (c++)"Ubuntu::Transfers::Errors::AuthErrorStruct::operator=(Ubuntu::Transfers::Errors::AuthErrorStruct const&)@Base" 0.4+14.10.20140618
292 (c++)"Ubuntu::Transfers::Errors::HttpErrorStruct::HttpErrorStruct(Ubuntu::Transfers::Errors::HttpErrorStruct const&)@Base" 0.4+14.10.20140618
293- (c++)"Ubuntu::Transfers::Errors::HttpErrorStruct::HttpErrorStruct(int, QString)@Base" 0.4+14.10.20140618
294 (c++)"Ubuntu::Transfers::Errors::HttpErrorStruct::HttpErrorStruct()@Base" 0.4+14.10.20140618
295 (c++)"Ubuntu::Transfers::Errors::HttpErrorStruct::HttpErrorStruct(Ubuntu::Transfers::Errors::HttpErrorStruct const&)@Base" 0.4+14.10.20140618
296- (c++)"Ubuntu::Transfers::Errors::HttpErrorStruct::HttpErrorStruct(int, QString)@Base" 0.4+14.10.20140618
297 (c++)"Ubuntu::Transfers::Errors::HttpErrorStruct::HttpErrorStruct()@Base" 0.4+14.10.20140618
298 (c++)"Ubuntu::Transfers::Errors::HttpErrorStruct::operator=(Ubuntu::Transfers::Errors::HttpErrorStruct const&)@Base" 0.4+14.10.20140618
299 (c++)"Ubuntu::Transfers::Errors::NetworkErrorStruct::NetworkErrorStruct(Ubuntu::Transfers::Errors::NetworkErrorStruct const&)@Base" 0.4+14.10.20140618
300- (c++)"Ubuntu::Transfers::Errors::NetworkErrorStruct::NetworkErrorStruct(int, QString)@Base" 0.4+14.10.20140618
301 (c++)"Ubuntu::Transfers::Errors::NetworkErrorStruct::NetworkErrorStruct(int)@Base" 0.4+14.10.20140618
302 (c++)"Ubuntu::Transfers::Errors::NetworkErrorStruct::NetworkErrorStruct()@Base" 0.4+14.10.20140618
303 (c++)"Ubuntu::Transfers::Errors::NetworkErrorStruct::NetworkErrorStruct(Ubuntu::Transfers::Errors::NetworkErrorStruct const&)@Base" 0.4+14.10.20140618
304- (c++)"Ubuntu::Transfers::Errors::NetworkErrorStruct::NetworkErrorStruct(int, QString)@Base" 0.4+14.10.20140618
305 (c++)"Ubuntu::Transfers::Errors::NetworkErrorStruct::NetworkErrorStruct(int)@Base" 0.4+14.10.20140618
306 (c++)"Ubuntu::Transfers::Errors::NetworkErrorStruct::NetworkErrorStruct()@Base" 0.4+14.10.20140618
307 (c++)"Ubuntu::Transfers::Errors::NetworkErrorStruct::operator=(Ubuntu::Transfers::Errors::NetworkErrorStruct const&)@Base" 0.4+14.10.20140618
308 (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::ProcessErrorStruct(Ubuntu::Transfers::Errors::ProcessErrorStruct const&)@Base" 0.4+14.10.20140618
309- (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::ProcessErrorStruct(int, QString)@Base" 0.4+14.10.20140618
310- (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::ProcessErrorStruct(int, QString, int, QString, QString)@Base" 0.4+14.10.20140618
311- (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::ProcessErrorStruct(int, int, QString, QString)@Base" 0.4+14.10.20140618
312 (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::ProcessErrorStruct()@Base" 0.4+14.10.20140618
313 (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::ProcessErrorStruct(Ubuntu::Transfers::Errors::ProcessErrorStruct const&)@Base" 0.4+14.10.20140618
314- (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::ProcessErrorStruct(int, QString)@Base" 0.4+14.10.20140618
315- (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::ProcessErrorStruct(int, QString, int, QString, QString)@Base" 0.4+14.10.20140618
316- (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::ProcessErrorStruct(int, int, QString, QString)@Base" 0.4+14.10.20140618
317 (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::ProcessErrorStruct()@Base" 0.4+14.10.20140618
318 (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::operator=(Ubuntu::Transfers::Errors::ProcessErrorStruct const&)@Base" 0.4+14.10.20140618
319 (c++)"Ubuntu::Transfers::Errors::operator<<(QDBusArgument&, Ubuntu::Transfers::Errors::AuthErrorStruct const&)@Base" 0.4+14.10.20140618
320@@ -79,6 +63,34 @@
321 (c++)"Ubuntu::Transfers::System::Logger::~Logger()@Base" 0.4+14.10.20140618
322 (c++)"Ubuntu::Transfers::System::Logger::~Logger()@Base" 0.4+14.10.20140618
323 (c++)"Ubuntu::Transfers::System::Logger::~Logger()@Base" 0.4+14.10.20140618
324+ (c++)"Ubuntu::Transfers::Errors::AuthErrorStruct::AuthErrorStruct(Ubuntu::Transfers::Errors::AuthErrorStruct::Type, QString const&)@Base" 0replaceme
325+ (c++)"Ubuntu::Transfers::Errors::AuthErrorStruct::AuthErrorStruct(int, QString const&)@Base" 0replaceme
326+ (c++)"Ubuntu::Transfers::Errors::AuthErrorStruct::AuthErrorStruct(Ubuntu::Transfers::Errors::AuthErrorStruct::Type, QString const&)@Base" 0replaceme
327+ (c++)"Ubuntu::Transfers::Errors::AuthErrorStruct::AuthErrorStruct(int, QString const&)@Base" 0replaceme
328+ (c++)"Ubuntu::Transfers::Errors::HashErrorStruct::HashErrorStruct(QString const&, QString const&, QString const&)@Base" 0replaceme
329+ (c++)"Ubuntu::Transfers::Errors::HashErrorStruct::HashErrorStruct(Ubuntu::Transfers::Errors::HashErrorStruct const&)@Base" 0replaceme
330+ (c++)"Ubuntu::Transfers::Errors::HashErrorStruct::HashErrorStruct()@Base" 0replaceme
331+ (c++)"Ubuntu::Transfers::Errors::HashErrorStruct::HashErrorStruct(QString const&, QString const&, QString const&)@Base" 0replaceme
332+ (c++)"Ubuntu::Transfers::Errors::HashErrorStruct::HashErrorStruct(Ubuntu::Transfers::Errors::HashErrorStruct const&)@Base" 0replaceme
333+ (c++)"Ubuntu::Transfers::Errors::HashErrorStruct::HashErrorStruct()@Base" 0replaceme
334+ (c++)"Ubuntu::Transfers::Errors::HashErrorStruct::operator=(Ubuntu::Transfers::Errors::HashErrorStruct const&)@Base" 0replaceme
335+ (c++)"Ubuntu::Transfers::Errors::HttpErrorStruct::HttpErrorStruct(int, QString const&)@Base" 0replaceme
336+ (c++)"Ubuntu::Transfers::Errors::HttpErrorStruct::HttpErrorStruct(int, QString const&)@Base" 0replaceme
337+ (c++)"Ubuntu::Transfers::Errors::NetworkErrorStruct::NetworkErrorStruct(int, QString const&)@Base" 0replaceme
338+ (c++)"Ubuntu::Transfers::Errors::NetworkErrorStruct::NetworkErrorStruct(int, QString const&)@Base" 0replaceme
339+ (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::ProcessErrorStruct(int, QString const&)@Base" 0replaceme
340+ (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::ProcessErrorStruct(int, QString const&, int, QString const&, QString const&)@Base" 0replaceme
341+ (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::ProcessErrorStruct(int, int, QString const&, QString const&)@Base" 0replaceme
342+ (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::ProcessErrorStruct(int, QString const&)@Base" 0replaceme
343+ (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::ProcessErrorStruct(int, QString const&, int, QString const&, QString const&)@Base" 0replaceme
344+ (c++)"Ubuntu::Transfers::Errors::ProcessErrorStruct::ProcessErrorStruct(int, int, QString const&, QString const&)@Base" 0replaceme
345+ (c++)"Ubuntu::Transfers::Errors::operator<<(QDBusArgument&, Ubuntu::Transfers::Errors::HashErrorStruct const&)@Base" 0replaceme
346+ (c++)"Ubuntu::Transfers::Errors::operator>>(QDBusArgument const&, Ubuntu::Transfers::Errors::HashErrorStruct&)@Base" 0replaceme
347+ (c++)"Ubuntu::Transfers::Errors::AuthErrorStruct::getType() const@Base" 0replaceme
348+ (c++)"Ubuntu::Transfers::Errors::AuthErrorStruct::getPhrase() const@Base" 0replaceme
349+ (c++)"Ubuntu::Transfers::Errors::HashErrorStruct::getChecksum() const@Base" 0replaceme
350+ (c++)"Ubuntu::Transfers::Errors::HashErrorStruct::getExpected() const@Base" 0replaceme
351+ (c++)"Ubuntu::Transfers::Errors::HashErrorStruct::getMethod() const@Base" 0replaceme
352 (c++)"Ubuntu::Transfers::Metadata::Metadata()@Base" 0.9+14.10.20141014.1
353 (c++)"Ubuntu::Transfers::Metadata::Metadata(QMap<QString, QVariant>)@Base" 0.9+14.10.20141014.1
354 (c++)"Ubuntu::Transfers::Metadata::Metadata()@Base" 0.9+14.10.20141014.1
355
356=== renamed file 'debian/libudm-priv-common0.install' => 'debian/libudm-priv-common1.install'
357--- debian/libudm-priv-common0.install 2014-04-29 09:52:30 +0000
358+++ debian/libudm-priv-common1.install 2015-07-24 16:42:57 +0000
359@@ -1,1 +1,1 @@
360-usr/lib/*/libudm-priv-common.so.0*
361+usr/lib/*/libudm-priv-common.so.1*
362
363=== modified file 'docs/dbus/com.canonical.applications.download.xml'
364--- docs/dbus/com.canonical.applications.download.xml 2014-09-05 15:11:35 +0000
365+++ docs/dbus/com.canonical.applications.download.xml 2015-07-24 16:42:57 +0000
366@@ -98,6 +98,11 @@
367 <arg name="error" type="(isiss)" direction="out"/>
368 </signal>
369
370+ <signal name="hashError">
371+ <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="HashErrorStruct"/>
372+ <arg name="error" type="(sss)" direction="out"/>
373+ </signal>
374+
375 <signal name="progress">
376 <arg name="received" type="t" direction="out"/>
377 <arg name="total" type="t" direction="out"/>
378
379=== modified file 'docs/dbus/com.canonical.applications.testing.download_manager.xml'
380--- docs/dbus/com.canonical.applications.testing.download_manager.xml 2014-04-30 14:47:38 +0000
381+++ docs/dbus/com.canonical.applications.testing.download_manager.xml 2015-07-24 16:42:57 +0000
382@@ -28,5 +28,12 @@
383 <arg name="download" type="s" direction="in"/>
384 <arg name="error" type="(is)" direction="in"/>
385 </method>
386+
387+ <method name="returnHashError">
388+ <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="HashErrorStruct"/>
389+ <arg name="download" type="s" direction="in"/>
390+ <arg name="error" type="(sss)" direction="in"/>
391+ </method>
392+
393 </interface>
394 </node>
395
396=== removed file 'src/common/priv/ubuntu/transfers/system/pending_reply.cpp'
397=== modified file 'src/common/public/CMakeLists.txt'
398--- src/common/public/CMakeLists.txt 2014-06-16 12:38:08 +0000
399+++ src/common/public/CMakeLists.txt 2015-07-24 16:42:57 +0000
400@@ -5,6 +5,7 @@
401 set(SOURCES
402 ubuntu/transfers/metadata.cpp
403 ubuntu/transfers/errors/auth_error_struct.cpp
404+ ubuntu/transfers/errors/hash_error_struct.cpp
405 ubuntu/transfers/errors/http_error_struct.cpp
406 ubuntu/transfers/errors/network_error_struct.cpp
407 ubuntu/transfers/errors/process_error_struct.cpp
408@@ -20,6 +21,7 @@
409
410 set(ERRORS_PUBLIC_HEADERS
411 ubuntu/transfers/errors/auth_error_struct.h
412+ ubuntu/transfers/errors/hash_error_struct.h
413 ubuntu/transfers/errors/http_error_struct.h
414 ubuntu/transfers/errors/network_error_struct.h
415 ubuntu/transfers/errors/process_error_struct.h
416
417=== modified file 'src/common/public/ubuntu/transfers/errors/auth_error_struct.cpp'
418--- src/common/public/ubuntu/transfers/errors/auth_error_struct.cpp 2014-02-26 19:54:31 +0000
419+++ src/common/public/ubuntu/transfers/errors/auth_error_struct.cpp 2015-07-24 16:42:57 +0000
420@@ -1,5 +1,5 @@
421 /*
422- * Copyright 2014 Canonical Ltd.
423+ * Copyright 2014-2015 Canonical Ltd.
424 *
425 * This library is free software; you can redistribute it and/or
426 * modify it under the terms of version 3 of the GNU Lesser General Public
427@@ -30,12 +30,12 @@
428 _phrase("") {
429 }
430
431-AuthErrorStruct::AuthErrorStruct(AuthErrorStruct::Type type, QString phrase)
432+AuthErrorStruct::AuthErrorStruct(AuthErrorStruct::Type type, const QString& phrase)
433 : _type(type),
434 _phrase(phrase) {
435 }
436
437-AuthErrorStruct::AuthErrorStruct(int type, QString phrase)
438+AuthErrorStruct::AuthErrorStruct(int type, const QString& phrase)
439 : _type(static_cast<AuthErrorStruct::Type>(type)),
440 _phrase(phrase) {
441 }
442@@ -80,16 +80,17 @@
443
444
445 AuthErrorStruct::Type
446-AuthErrorStruct::getType() {
447+AuthErrorStruct::getType() const {
448 return _type;
449 }
450
451 QString
452-AuthErrorStruct::getPhrase() {
453+AuthErrorStruct::getPhrase() const {
454 return _phrase;
455 }
456
457 } // Errors
458
459 } // Transfers
460+
461 } // Ubuntu
462
463=== modified file 'src/common/public/ubuntu/transfers/errors/auth_error_struct.h'
464--- src/common/public/ubuntu/transfers/errors/auth_error_struct.h 2014-03-28 15:46:56 +0000
465+++ src/common/public/ubuntu/transfers/errors/auth_error_struct.h 2015-07-24 16:42:57 +0000
466@@ -1,5 +1,5 @@
467 /*
468- * Copyright 2014 Canonical Ltd.
469+ * Copyright 2014-2015 Canonical Ltd.
470 *
471 * This library is free software; you can redistribute it and/or
472 * modify it under the terms of version 3 of the GNU Lesser General Public
473@@ -16,8 +16,7 @@
474 * Boston, MA 02110-1301, USA.
475 */
476
477-#ifndef DOWNLOADER_LIB_AUTH_ERROR_STRUCT_H
478-#define DOWNLOADER_LIB_AUTH_ERROR_STRUCT_H
479+#pragma once
480
481 class QDBusArgument;
482
483@@ -55,12 +54,12 @@
484 /*!
485 Creates a new structure with the given error types and message.
486 */
487- AuthErrorStruct(AuthErrorStruct::Type type, QString phrase);
488+ AuthErrorStruct(AuthErrorStruct::Type type, const QString& phrase);
489
490 /*!
491 Creates a new structure with the given error types and message.
492 */
493- AuthErrorStruct(int type, QString phrase);
494+ AuthErrorStruct(int type, const QString& phrase);
495
496 /*!
497 Copy constructor.
498@@ -87,18 +86,18 @@
499 // properties getters
500
501 /*!
502- \fn AuthErrorStruct::Type getType()
503+ \fn AuthErrorStruct::Type getType() const
504
505 Returns the type of the error.
506 */
507- AuthErrorStruct::Type getType();
508+ AuthErrorStruct::Type getType() const;
509
510 /*!
511- \fn QString getPhrase()
512+ \fn QString getPhrase() const
513
514 Returns the message of the error.
515 */
516- QString getPhrase();
517+ QString getPhrase() const;
518
519 private:
520
521@@ -110,7 +109,7 @@
522 /*!
523 \internal
524 */
525- QString _phrase;
526+ QString _phrase = QString::null;
527 };
528
529 } // Errors
530@@ -118,5 +117,3 @@
531 } // Transfers
532
533 } // Ubuntu
534-
535-#endif // AUTH_ERROR_STRUCT_H
536
537=== added file 'src/common/public/ubuntu/transfers/errors/hash_error_struct.cpp'
538--- src/common/public/ubuntu/transfers/errors/hash_error_struct.cpp 1970-01-01 00:00:00 +0000
539+++ src/common/public/ubuntu/transfers/errors/hash_error_struct.cpp 2015-07-24 16:42:57 +0000
540@@ -0,0 +1,96 @@
541+/*
542+ * Copyright 2015 Canonical Ltd.
543+ *
544+ * This library is free software; you can redistribute it and/or
545+ * modify it under the terms of version 3 of the GNU Lesser General Public
546+ * License as published by the Free Software Foundation.
547+ *
548+ * This program is distributed in the hope that it will be useful,
549+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
550+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
551+ * General Public License for more details.
552+ *
553+ * You should have received a copy of the GNU Lesser General Public
554+ * License along with this library; if not, write to the
555+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
556+ * Boston, MA 02110-1301, USA.
557+ */
558+
559+#include <QDBusArgument>
560+
561+#include "hash_error_struct.h"
562+
563+
564+namespace Ubuntu {
565+
566+namespace Transfers {
567+
568+namespace Errors {
569+
570+HashErrorStruct::HashErrorStruct() {
571+}
572+
573+HashErrorStruct::HashErrorStruct(const QString& method, const QString& expected, const QString& found)
574+ : _method(method),
575+ _expected(expected),
576+ _found(found) {
577+
578+}
579+
580+HashErrorStruct::HashErrorStruct(const HashErrorStruct& other)
581+ : _method(other._method),
582+ _expected(other._expected),
583+ _found(other._found) {
584+}
585+
586+HashErrorStruct&
587+HashErrorStruct::operator=(const HashErrorStruct& other) {
588+ _method = other._method;
589+ _expected = other._expected;
590+ _found = other._found;
591+
592+ return *this;
593+}
594+
595+QDBusArgument&
596+operator<<(QDBusArgument &argument, const HashErrorStruct& error) {
597+ argument.beginStructure();
598+ argument << error._method;
599+ argument << error._expected;
600+ argument << error._found;
601+ argument.endStructure();
602+
603+ return argument;
604+}
605+
606+const QDBusArgument&
607+operator>>(const QDBusArgument &argument, HashErrorStruct& error) {
608+ argument.beginStructure();
609+ argument >> error._method;
610+ argument >> error._expected;
611+ argument >> error._found;
612+ argument.endStructure();
613+
614+ return argument;
615+}
616+
617+QString
618+HashErrorStruct::getMethod() const {
619+ return _method;
620+}
621+
622+QString
623+HashErrorStruct::getExpected() const {
624+ return _expected;
625+}
626+
627+QString
628+HashErrorStruct::getChecksum() const {
629+ return _found;
630+}
631+
632+}
633+
634+}
635+
636+}
637
638=== added file 'src/common/public/ubuntu/transfers/errors/hash_error_struct.h'
639--- src/common/public/ubuntu/transfers/errors/hash_error_struct.h 1970-01-01 00:00:00 +0000
640+++ src/common/public/ubuntu/transfers/errors/hash_error_struct.h 2015-07-24 16:42:57 +0000
641@@ -0,0 +1,122 @@
642+/*
643+ * Copyright 2015 Canonical Ltd.
644+ *
645+ * This library is free software; you can redistribute it and/or
646+ * modify it under the terms of version 3 of the GNU Lesser General Public
647+ * License as published by the Free Software Foundation.
648+ *
649+ * This program is distributed in the hope that it will be useful,
650+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
651+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
652+ * General Public License for more details.
653+ *
654+ * You should have received a copy of the GNU Lesser General Public
655+ * License along with this library; if not, write to the
656+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
657+ * Boston, MA 02110-1301, USA.
658+ */
659+
660+#pragma once
661+
662+#include <QString>
663+
664+class QDBusArgument;
665+
666+namespace Ubuntu {
667+
668+namespace Transfers {
669+
670+namespace Errors {
671+
672+/*!
673+ \class HashErrorStruct
674+ \brief The HashErrorStruct represents the dbus structure that is used
675+ to communicate hash errors that happened in the download
676+ manager to the different clients.
677+ \since 0.9
678+*/
679+class HashErrorStruct {
680+ Q_PROPERTY(QString method READ getMethod)
681+ Q_PROPERTY(QString expected READ getExpected)
682+ Q_PROPERTY(QString checksum READ getChecksum)
683+
684+ public:
685+
686+ /*!
687+ Creates a new structure with the default values.
688+ */
689+ HashErrorStruct();
690+
691+ /*!
692+ Creates a new structure with the given method, expected result and found checksum.
693+ */
694+ HashErrorStruct(const QString& method, const QString& expected, const QString& found);
695+
696+ /*!
697+ Copy constructor.
698+ */
699+ HashErrorStruct(const HashErrorStruct& other);
700+
701+ /*!
702+ Assign operator.
703+ */
704+ HashErrorStruct& operator=(const HashErrorStruct& other);
705+
706+ /*!
707+ \internal
708+ */
709+ friend QDBusArgument &operator<<(QDBusArgument &argument,
710+ const HashErrorStruct& error);
711+
712+ /*!
713+ \internal
714+ */
715+ friend const QDBusArgument &operator>>(const QDBusArgument &argument,
716+ HashErrorStruct& error);
717+
718+ // properties getters
719+
720+ /*!
721+ \fn QString getMethod() const
722+
723+ Returns the method that was used to calculate the checksum.
724+ */
725+ QString getMethod() const;
726+
727+ /*!
728+ \fn QString getExpected() const
729+
730+ Returns the checksum that was expected.
731+ */
732+ QString getExpected() const;
733+
734+ /*!
735+ \fn QString getChecksum() const
736+
737+ Returns the checksum of the completed download.
738+ */
739+ QString getChecksum() const;
740+
741+ private:
742+
743+ /*!
744+ \internal
745+ */
746+ QString _method = QString::null;
747+
748+ /*!
749+ \internal
750+ */
751+ QString _expected = QString::null;
752+
753+ /*!
754+ \internal
755+ */
756+ QString _found = QString::null;
757+};
758+
759+}
760+
761+}
762+
763+}
764
765=== modified file 'src/common/public/ubuntu/transfers/errors/http_error_struct.cpp'
766--- src/common/public/ubuntu/transfers/errors/http_error_struct.cpp 2014-03-28 15:46:56 +0000
767+++ src/common/public/ubuntu/transfers/errors/http_error_struct.cpp 2015-07-24 16:42:57 +0000
768@@ -1,5 +1,5 @@
769 /*
770- * Copyright 2014 Canonical Ltd.
771+ * Copyright 2014-2015 Canonical Ltd.
772 *
773 * This library is free software; you can redistribute it and/or
774 * modify it under the terms of version 3 of the GNU Lesser General Public
775@@ -30,7 +30,7 @@
776 _phrase("OK"){
777 }
778
779-HttpErrorStruct::HttpErrorStruct(int code, QString phrase)
780+HttpErrorStruct::HttpErrorStruct(int code, const QString& phrase)
781 : _code(code),
782 _phrase(phrase) {
783 }
784
785=== modified file 'src/common/public/ubuntu/transfers/errors/http_error_struct.h'
786--- src/common/public/ubuntu/transfers/errors/http_error_struct.h 2014-03-28 15:46:56 +0000
787+++ src/common/public/ubuntu/transfers/errors/http_error_struct.h 2015-07-24 16:42:57 +0000
788@@ -1,5 +1,5 @@
789 /*
790- * Copyright 2014 Canonical Ltd.
791+ * Copyright 2014-2015 Canonical Ltd.
792 *
793 * This library is free software; you can redistribute it and/or
794 * modify it under the terms of version 3 of the GNU Lesser General Public
795@@ -16,8 +16,7 @@
796 * Boston, MA 02110-1301, USA.
797 */
798
799-#ifndef DOWNLOADER_LIB_HTTP_ERROR_STRUCT_H
800-#define DOWNLOADER_LIB_HTTP_ERROR_STRUCT_H
801+#pragma once
802
803 #include <QString>
804
805@@ -50,7 +49,7 @@
806 /*!
807 Creates a new structure with the given error types and message.
808 */
809- HttpErrorStruct(int code, QString phrase);
810+ HttpErrorStruct(int code, const QString& phrase);
811
812 /*!
813 Copy constructor.
814@@ -107,4 +106,3 @@
815 } // Transfers
816
817 } // Ubuntu
818-#endif // HTTP_ERROR_STRUCT_H
819
820=== modified file 'src/common/public/ubuntu/transfers/errors/network_error_struct.cpp'
821--- src/common/public/ubuntu/transfers/errors/network_error_struct.cpp 2014-03-28 15:46:56 +0000
822+++ src/common/public/ubuntu/transfers/errors/network_error_struct.cpp 2015-07-24 16:42:57 +0000
823@@ -1,5 +1,5 @@
824 /*
825- * Copyright 2014 Canonical Ltd.
826+ * Copyright 2014-2015 Canonical Ltd.
827 *
828 * This library is free software; you can redistribute it and/or
829 * modify it under the terms of version 3 of the GNU Lesser General Public
830@@ -115,7 +115,7 @@
831 }
832 }
833
834-NetworkErrorStruct::NetworkErrorStruct(int code, QString phrase)
835+NetworkErrorStruct::NetworkErrorStruct(int code, const QString& phrase)
836 : _code(code),
837 _phrase(phrase) {
838 }
839
840=== modified file 'src/common/public/ubuntu/transfers/errors/network_error_struct.h'
841--- src/common/public/ubuntu/transfers/errors/network_error_struct.h 2014-03-28 15:46:56 +0000
842+++ src/common/public/ubuntu/transfers/errors/network_error_struct.h 2015-07-24 16:42:57 +0000
843@@ -1,5 +1,5 @@
844 /*
845- * Copyright 2014 Canonical Ltd.
846+ * Copyright 2014-2015 Canonical Ltd.
847 *
848 * This library is free software; you can redistribute it and/or
849 * modify it under the terms of version 3 of the GNU Lesser General Public
850@@ -16,8 +16,7 @@
851 * Boston, MA 02110-1301, USA.
852 */
853
854-#ifndef DOWNLOADER_LIB_NETWORK_ERROR_STRUCT_H
855-#define DOWNLOADER_LIB_NETWORK_ERROR_STRUCT_H
856+#pragma once
857
858 #include <QString>
859
860@@ -56,7 +55,7 @@
861 Creates a network error with the given type and a human readable
862 message.
863 */
864- NetworkErrorStruct(int code, QString phrase);
865+ NetworkErrorStruct(int code, const QString& phrase);
866
867 /*!
868 Copy constructor.
869@@ -112,5 +111,3 @@
870 } // Transfers
871
872 } // Ubuntu
873-
874-#endif // NETWORK_ERROR_STRUCT_H
875
876=== modified file 'src/common/public/ubuntu/transfers/errors/process_error_struct.cpp'
877--- src/common/public/ubuntu/transfers/errors/process_error_struct.cpp 2014-03-28 15:46:56 +0000
878+++ src/common/public/ubuntu/transfers/errors/process_error_struct.cpp 2015-07-24 16:42:57 +0000
879@@ -1,5 +1,5 @@
880 /*
881- * Copyright 2014 Canonical Ltd.
882+ * Copyright 2014-2015 Canonical Ltd.
883 *
884 * This library is free software; you can redistribute it and/or
885 * modify it under the terms of version 3 of the GNU Lesser General Public
886@@ -34,7 +34,7 @@
887 _stderr("") {
888 }
889
890-ProcessErrorStruct::ProcessErrorStruct(int code, QString phrase)
891+ProcessErrorStruct::ProcessErrorStruct(int code, const QString& phrase)
892 : _code(code),
893 _exitCode(0),
894 _phrase(phrase),
895@@ -44,8 +44,8 @@
896
897 ProcessErrorStruct::ProcessErrorStruct(int code,
898 int exitCode,
899- QString standardOutput,
900- QString standardError)
901+ const QString& standardOutput,
902+ const QString& standardError)
903 : _code(code),
904 _exitCode(exitCode),
905 _stdout(standardOutput),
906@@ -73,10 +73,10 @@
907 }
908
909 ProcessErrorStruct::ProcessErrorStruct(int code,
910- QString phrase,
911+ const QString& phrase,
912 int exitCode,
913- QString standardOutput,
914- QString standardError)
915+ const QString& standardOutput,
916+ const QString& standardError)
917 : _code(code),
918 _exitCode(exitCode),
919 _phrase(phrase),
920
921=== modified file 'src/common/public/ubuntu/transfers/errors/process_error_struct.h'
922--- src/common/public/ubuntu/transfers/errors/process_error_struct.h 2014-03-28 15:46:56 +0000
923+++ src/common/public/ubuntu/transfers/errors/process_error_struct.h 2015-07-24 16:42:57 +0000
924@@ -1,5 +1,5 @@
925 /*
926- * Copyright 2014 Canonical Ltd.
927+ * Copyright 2014-2015 Canonical Ltd.
928 *
929 * This library is free software; you can redistribute it and/or
930 * modify it under the terms of version 3 of the GNU Lesser General Public
931@@ -16,8 +16,7 @@
932 * Boston, MA 02110-1301, USA.
933 */
934
935-#ifndef DOWNLOADER_LIB_PROCESS_ERROR_STRUCT_H
936-#define DOWNLOADER_LIB_PROCESS_ERROR_STRUCT_H
937+#pragma once
938
939 #include <QString>
940
941@@ -54,7 +53,7 @@
942 Create a new structure with the given error \a code and
943 a given human readable message.
944 */
945- ProcessErrorStruct(int code, QString phrase);
946+ ProcessErrorStruct(int code, const QString& phrase);
947
948 /*!
949 Creates a new structure with the given error \a code and with
950@@ -64,8 +63,8 @@
951 */
952 ProcessErrorStruct(int code,
953 int exitCode,
954- QString standardOutput,
955- QString standardError);
956+ const QString& standardOutput,
957+ const QString& standardError);
958
959 /*!
960 Creates a new structure with the given error \a code , a human
961@@ -74,10 +73,10 @@
962 out via \a standardOut and standard error via \a standarError
963 */
964 ProcessErrorStruct(int code,
965- QString phrase,
966+ const QString& phrase,
967 int exitCode,
968- QString standardOutput,
969- QString standardError);
970+ const QString& standardOutput,
971+ const QString& standardError);
972
973 /*!
974 Copy constructor.
975@@ -169,5 +168,3 @@
976 } // Transfers
977
978 } // Ubuntu
979-
980-#endif // PROCESS_ERROR_STRUCT_H
981
982=== modified file 'src/downloads/client/symbols.map'
983--- src/downloads/client/symbols.map 2014-06-30 12:01:15 +0000
984+++ src/downloads/client/symbols.map 2015-07-24 16:42:57 +0000
985@@ -9,6 +9,7 @@
986 Ubuntu::DownloadManager::HttpError::*;
987 Ubuntu::DownloadManager::NetworkError::*;
988 Ubuntu::DownloadManager::ProcessError::*;
989+ Ubuntu::DownloadManager::HashError::*;
990 Ubuntu::DownloadManager::GroupDownload::*;
991 Ubuntu::DownloadManager::Manager::*;
992 Ubuntu::DownloadManager::Logging::Logger::init*;
993@@ -20,6 +21,7 @@
994 typeinfo?for?Ubuntu::DownloadManager::HttpError;
995 typeinfo?for?Ubuntu::DownloadManager::NetworkError;
996 typeinfo?for?Ubuntu::DownloadManager::ProcessError;
997+ typeinfo?for?Ubuntu::DownloadManager::HashError;
998 typeinfo?for?Ubuntu::DownloadManager::GroupDownload;
999 typeinfo?for?Ubuntu::DownloadManager::Manager;
1000 typeinfo?for?Ubuntu::DownloadManager::Logging::Logger;
1001@@ -31,6 +33,7 @@
1002 typeinfo?name?for?Ubuntu::DownloadManager::HttpError;
1003 typeinfo?name?for?Ubuntu::DownloadManager::NetworkError;
1004 typeinfo?name?for?Ubuntu::DownloadManager::ProcessError;
1005+ typeinfo?name?for?Ubuntu::DownloadManager::HashError;
1006 typeinfo?name?for?Ubuntu::DownloadManager::GroupDownload;
1007 typeinfo?name?for?Ubuntu::DownloadManager::Manager;
1008 typeinfo?name?for?Ubuntu::DownloadManager::Logging::Logger;
1009@@ -42,6 +45,7 @@
1010 VTT?for?Ubuntu::DownloadManager::HttpError;
1011 VTT?for?Ubuntu::DownloadManager::NetworkError;
1012 VTT?for?Ubuntu::DownloadManager::ProcessError;
1013+ VTT?for?Ubuntu::DownloadManager::HashError;
1014 VTT?for?Ubuntu::DownloadManager::GroupDownload;
1015 VTT?for?Ubuntu::DownloadManager::Manager;
1016 VTT?for?Ubuntu::DownloadManager::Logging::Logger;
1017@@ -53,6 +57,7 @@
1018 virtual?thunk?to?Ubuntu::DownloadManager::HttpError;
1019 virtual?thunk?to?Ubuntu::DownloadManager::NetworkError;
1020 virtual?thunk?to?Ubuntu::DownloadManager::ProcessError;
1021+ virtual?thunk?to?Ubuntu::DownloadManager::HashError;
1022 virtual?thunk?to?Ubuntu::DownloadManager::GroupDownload;
1023 virtual?thunk?to?Ubuntu::DownloadManager::Manager;
1024 virtual?thunk?to?Ubuntu::DownloadManager::Logging::Logger;
1025@@ -64,6 +69,7 @@
1026 vtable?for?Ubuntu::DownloadManager::HttpError;
1027 vtable?for?Ubuntu::DownloadManager::NetworkError;
1028 vtable?for?Ubuntu::DownloadManager::ProcessError;
1029+ vtable?for?Ubuntu::DownloadManager::HashError;
1030 vtable?for?Ubuntu::DownloadManager::GroupDownload;
1031 vtable?for?Ubuntu::DownloadManager::Manager;
1032 vtable?for?Ubuntu::DownloadManager::Logging::Logger;
1033
1034=== modified file 'src/downloads/client/ubuntu/download_manager/download_impl.cpp'
1035--- src/downloads/client/ubuntu/download_manager/download_impl.cpp 2014-09-24 09:11:19 +0000
1036+++ src/downloads/client/ubuntu/download_manager/download_impl.cpp 2015-07-24 16:42:57 +0000
1037@@ -1,5 +1,5 @@
1038 /*
1039- * Copyright 2013-2014 Canonical Ltd.
1040+ * Copyright 2013-2015 Canonical Ltd.
1041 *
1042 * This library is free software; you can redistribute it and/or
1043 * modify it under the terms of version 3 of the GNU Lesser General Public
1044@@ -129,6 +129,13 @@
1045 "Could not connect to signal &DownloadInterface::authError");
1046 }
1047
1048+ connected = connect(_dbusInterface, &DownloadInterface::hashError,
1049+ this, &DownloadImpl::onHashError);
1050+ if (!connected) {
1051+ Logger::log(Logger::Critical,
1052+ "Could not connect to signal &DownloadInterface::authError");
1053+ }
1054+
1055 connected = connect(_propertiesInterface, &PropertiesInterface::PropertiesChanged,
1056 this, &DownloadImpl::onPropertiesChanged);
1057 if (!connected) {
1058@@ -443,6 +450,12 @@
1059 }
1060
1061 void
1062+DownloadImpl::onHashError(HashErrorStruct errStruct) {
1063+ auto err = new HashError(errStruct, this);
1064+ setLastError(err);
1065+}
1066+
1067+void
1068 DownloadImpl::onPropertiesChanged(const QString& interfaceName,
1069 const QVariantMap& changedProperties,
1070 const QStringList& invalidatedProperties) {
1071
1072=== modified file 'src/downloads/client/ubuntu/download_manager/download_impl.h'
1073--- src/downloads/client/ubuntu/download_manager/download_impl.h 2014-09-08 11:33:57 +0000
1074+++ src/downloads/client/ubuntu/download_manager/download_impl.h 2015-07-24 16:42:57 +0000
1075@@ -1,5 +1,5 @@
1076 /*
1077- * Copyright 2013-2014 Canonical Ltd.
1078+ * Copyright 2013-2015 Canonical Ltd.
1079 *
1080 * This library is free software; you can redistribute it and/or
1081 * modify it under the terms of version 3 of the GNU Lesser General Public
1082@@ -16,8 +16,7 @@
1083 * Boston, MA 02110-1301, USA.
1084 */
1085
1086-#ifndef UBUNTU_DOWNLOADMANAGER_CLIENT_DOWNLOAD_IMPL_H
1087-#define UBUNTU_DOWNLOADMANAGER_CLIENT_DOWNLOAD_IMPL_H
1088+#pragma once
1089
1090 #include <QDBusConnection>
1091 #include <QDBusObjectPath>
1092@@ -97,6 +96,7 @@
1093 void onNetworkError(NetworkErrorStruct);
1094 void onProcessError(ProcessErrorStruct);
1095 void onAuthError(AuthErrorStruct);
1096+ void onHashError(HashErrorStruct);
1097 void onPropertiesChanged(const QString& interfaceName,
1098 const QVariantMap& changedProperties,
1099 const QStringList& invalidatedProperties);
1100@@ -116,4 +116,3 @@
1101
1102 } // DownloadManager
1103
1104-#endif // UBUNTU_DOWNLOADMANAGER_CLIENT_DOWNLOAD_IMPL_H
1105
1106=== modified file 'src/downloads/client/ubuntu/download_manager/download_interface.cpp'
1107--- src/downloads/client/ubuntu/download_manager/download_interface.cpp 2014-01-13 17:26:28 +0000
1108+++ src/downloads/client/ubuntu/download_manager/download_interface.cpp 2015-07-24 16:42:57 +0000
1109@@ -2,7 +2,7 @@
1110 * This file was generated by qdbusxml2cpp version 0.8
1111 * Command line was: qdbusxml2cpp com.canonical.applications.download.xml -i metatypes.h -p download_interface -c DownloadInterface
1112 *
1113- * qdbusxml2cpp is Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
1114+ * qdbusxml2cpp is Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
1115 *
1116 * This is an auto-generated file.
1117 * This file may have been hand-edited. Look for HAND-EDIT comments
1118
1119=== modified file 'src/downloads/client/ubuntu/download_manager/download_interface.h'
1120--- src/downloads/client/ubuntu/download_manager/download_interface.h 2014-09-05 15:11:35 +0000
1121+++ src/downloads/client/ubuntu/download_manager/download_interface.h 2015-07-24 16:42:57 +0000
1122@@ -2,7 +2,7 @@
1123 * This file was generated by qdbusxml2cpp version 0.8
1124 * Command line was: qdbusxml2cpp com.canonical.applications.download.xml -i metatypes.h -p download_interface -c DownloadInterface
1125 *
1126- * qdbusxml2cpp is Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
1127+ * qdbusxml2cpp is Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
1128 *
1129 * This is an auto-generated file.
1130 * Do not edit! All changes made to it will be lost.
1131@@ -149,6 +149,7 @@
1132 void canceled(bool success);
1133 void error(const QString &error);
1134 void finished(const QString &path);
1135+ void hashError(HashErrorStruct error);
1136 void httpError(HttpErrorStruct error);
1137 void networkError(NetworkErrorStruct error);
1138 void paused(bool success);
1139
1140=== modified file 'src/downloads/client/ubuntu/download_manager/error.cpp'
1141--- src/downloads/client/ubuntu/download_manager/error.cpp 2014-02-26 19:54:31 +0000
1142+++ src/downloads/client/ubuntu/download_manager/error.cpp 2015-07-24 16:42:57 +0000
1143@@ -1,5 +1,5 @@
1144 /*
1145- * Copyright 2013-2014 Canonical Ltd.
1146+ * Copyright 2013-2015 Canonical Ltd.
1147 *
1148 * This library is free software; you can redistribute it and/or
1149 * modify it under the terms of version 3 of the GNU Lesser General Public
1150@@ -26,6 +26,7 @@
1151 const QString HTTP_ERROR_STRING = "HttpError: %1 - %2";
1152 const QString NETWORK_ERROR_STRING = "NetworkError: %1 - %2";
1153 const QString PROCESS_ERROR_STRING = "ProcessError: %1 - %2\nExit code: %3\nStdout: %4\nStderr:%5";
1154+ const QString HASH_ERROR_STRING = "Hash validation error using %1: Expected result is %2 but result was %3.";
1155 }
1156
1157 namespace Ubuntu {
1158@@ -45,11 +46,11 @@
1159 q_ptr(parent) {
1160 }
1161
1162- Error::Type type() {
1163+ Error::Type type() const {
1164 return _type;
1165 }
1166
1167- QString errorString() {
1168+ QString errorString() const {
1169 switch(_type) {
1170 case Error::DBus:
1171 return "DBusError";
1172@@ -59,6 +60,8 @@
1173 return "NetworkError";
1174 case Error::Process:
1175 return "ProcessError";
1176+ case Error::Hash:
1177+ return "HashError";
1178 default:
1179 return "";
1180 }
1181@@ -78,15 +81,15 @@
1182 q_ptr(parent) {
1183 }
1184
1185- inline QString message() {
1186+ inline QString message() const {
1187 return _err.message();
1188 }
1189
1190- inline QString name() {
1191+ inline QString name() const {
1192 return _err.name();
1193 }
1194
1195- inline QString errorString() {
1196+ inline QString errorString() const {
1197 return DBUS_ERROR_STRING.arg(_err.name(), _err.message());
1198 }
1199
1200@@ -104,7 +107,7 @@
1201 q_ptr(parent) {
1202 }
1203
1204- inline AuthError::Type type() {
1205+ inline AuthError::Type type() const {
1206 switch(_err.getType()) {
1207 case Transfers::Errors::AuthErrorStruct::Proxy:
1208 return AuthError::Proxy;
1209@@ -113,7 +116,7 @@
1210 }
1211 }
1212
1213- inline QString getTypeString() {
1214+ inline QString getTypeString() const {
1215 switch(_err.getType()) {
1216 case Transfers::Errors::AuthErrorStruct::Proxy:
1217 return "Proxy";
1218@@ -122,11 +125,11 @@
1219 }
1220 }
1221
1222- inline QString phrase() {
1223+ inline QString phrase() const {
1224 return _err.getPhrase();
1225 }
1226
1227- inline QString errorString() {
1228+ inline QString errorString() const {
1229 return AUTH_ERROR_STRING.arg(getTypeString(), _err.getPhrase());
1230 }
1231
1232@@ -144,15 +147,15 @@
1233 q_ptr(parent) {
1234 }
1235
1236- inline int code() {
1237+ inline int code() const {
1238 return _err.getCode();
1239 }
1240
1241- inline QString phrase() {
1242+ inline QString phrase() const {
1243 return _err.getPhrase();
1244 }
1245
1246- inline QString errorString() {
1247+ inline QString errorString() const {
1248 return HTTP_ERROR_STRING.arg(QString::number(_err.getCode()),
1249 _err.getPhrase());
1250 }
1251@@ -172,16 +175,16 @@
1252 q_ptr(parent) {
1253 }
1254
1255- inline NetworkError::ErrorCode code() {
1256+ inline NetworkError::ErrorCode code() const {
1257 auto intCode = static_cast<NetworkError::ErrorCode>(_err.getCode());
1258 return intCode;
1259 }
1260
1261- inline QString phrase() {
1262+ inline QString phrase() const {
1263 return _err.getPhrase();
1264 }
1265
1266- inline QString errorString() {
1267+ inline QString errorString() const {
1268 return NETWORK_ERROR_STRING.arg(QString::number(_err.getCode()),
1269 _err.getPhrase());
1270 }
1271@@ -201,28 +204,28 @@
1272 q_ptr(parent) {
1273 }
1274
1275- QProcess::ProcessError code() {
1276+ QProcess::ProcessError code() const {
1277 auto code = static_cast<QProcess::ProcessError>(_err.getCode());
1278 return code;
1279 }
1280
1281- QString phrase() {
1282+ QString phrase() const {
1283 return _err.getPhrase();
1284 }
1285
1286- inline int exitCode() {
1287+ inline int exitCode() const {
1288 return _err.getExitCode();
1289 }
1290
1291- inline QString standardOut() {
1292+ inline QString standardOut() const {
1293 return _err.getStandardOutput();
1294 }
1295
1296- inline QString standardError() {
1297+ inline QString standardError() const {
1298 return _err.getStandardError();
1299 }
1300
1301- inline QString errorString() {
1302+ inline QString errorString() const {
1303 return PROCESS_ERROR_STRING.arg(QString::number(_err.getCode()),
1304 _err.getPhrase(), QString::number(_err.getExitCode()),
1305 _err.getStandardOutput(), _err.getStandardError());
1306@@ -233,6 +236,36 @@
1307 ProcessError* q_ptr;
1308 };
1309
1310+class HashErrorPrivate {
1311+ Q_DECLARE_PUBLIC(HashError)
1312+
1313+ public:
1314+ HashErrorPrivate (Transfers::Errors::HashErrorStruct err, HashError* parent)
1315+ : _err(err),
1316+ q_ptr(parent) {
1317+ }
1318+
1319+ inline QString method() const {
1320+ return _err.getMethod();
1321+ }
1322+
1323+ inline QString expected() const {
1324+ return _err.getExpected();
1325+ }
1326+
1327+ inline QString checksum() const {
1328+ return _err.getChecksum();
1329+ }
1330+
1331+ inline QString errorString() const {
1332+ return HASH_ERROR_STRING.arg(_err.getMethod()).arg(_err.getExpected()).arg(_err.getChecksum());
1333+ }
1334+
1335+ private:
1336+ Transfers::Errors::HashErrorStruct _err;
1337+ HashError* q_ptr;
1338+};
1339+
1340 /*
1341 * PUBLIC IMPLEMENTATIONS
1342 */
1343@@ -413,6 +446,39 @@
1344 return d->errorString();
1345 }
1346
1347+HashError::HashError(Transfers::Errors::HashErrorStruct errStruct, QObject* parent)
1348+ : Error(Error::Hash, parent),
1349+ d_ptr(new HashErrorPrivate(errStruct, this)) {
1350+}
1351+
1352+HashError::~HashError() {
1353+ delete d_ptr;
1354+}
1355+
1356+QString
1357+HashError::method() {
1358+ Q_D(HashError);
1359+ return d->method();
1360+}
1361+
1362+QString
1363+HashError::expected() {
1364+ Q_D(HashError);
1365+ return d->expected();
1366+}
1367+
1368+QString
1369+HashError::checksum() {
1370+ Q_D(HashError);
1371+ return d->checksum();
1372+}
1373+
1374+QString
1375+HashError::errorString() {
1376+ Q_D(HashError);
1377+ return d->errorString();
1378+}
1379+
1380 } // DownloadManager
1381
1382 } // Ubuntu
1383
1384=== modified file 'src/downloads/client/ubuntu/download_manager/error.h'
1385--- src/downloads/client/ubuntu/download_manager/error.h 2014-06-06 10:05:15 +0000
1386+++ src/downloads/client/ubuntu/download_manager/error.h 2015-07-24 16:42:57 +0000
1387@@ -1,5 +1,5 @@
1388 /*
1389- * Copyright 2013-2014 Canonical Ltd.
1390+ * Copyright 2013-2015 Canonical Ltd.
1391 *
1392 * This library is free software; you can redistribute it and/or
1393 * modify it under the terms of version 3 of the GNU Lesser General Public
1394@@ -16,8 +16,7 @@
1395 * Boston, MA 02110-1301, USA.
1396 */
1397
1398-#ifndef UBUNTU_DOWNLOADMANAGER_CLIENT_ERROR_H
1399-#define UBUNTU_DOWNLOADMANAGER_CLIENT_ERROR_H
1400+#pragma once
1401
1402 #include <QObject>
1403 #include <QProcess>
1404@@ -33,6 +32,7 @@
1405 class HttpErrorStruct;
1406 class NetworkErrorStruct;
1407 class ProcessErrorStruct;
1408+ class HashErrorStruct;
1409 }
1410
1411 }
1412@@ -66,7 +66,8 @@
1413 DBus, /*! The error was due to some problem when communicating with the dbus API.*/
1414 Http, /*! The error was due to a http error, for example a 404.*/
1415 Network, /*! The error was due to network problems such as a missing network interface.*/
1416- Process /*! The error was due to a problem when executing the post download command.*/
1417+ Process, /*! The error was due to a problem when executing the post download command.*/
1418+ Hash /*! The error was due to a problem when verifying the checksum of the download.*/
1419 };
1420
1421 /*!
1422@@ -468,8 +469,72 @@
1423 ProcessErrorPrivate* d_ptr;
1424 };
1425
1426+class HashErrorPrivate;
1427+
1428+/*!
1429+ \class HashError
1430+ \brief The HashError represents an error that occurred during the
1431+ hash validation after the download.
1432+ \since 0.3
1433+*/
1434+class HashError : public Error {
1435+ Q_OBJECT
1436+ Q_DECLARE_PRIVATE(HashError)
1437+
1438+ friend class DownloadImpl;
1439+
1440+ public:
1441+
1442+ /*!
1443+ Disposes of this error and frees any resources associated with it.
1444+ */
1445+ virtual ~HashError();
1446+
1447+ /*!
1448+ /fn QString method()
1449+
1450+ Returns the method that was used to verify the checksum of the download.
1451+ */
1452+ QString method();
1453+
1454+ /*!
1455+ /fn QString expected()
1456+
1457+ Returns the checksum that passed to the download manager to check against once the download
1458+ was completed.
1459+ */
1460+ QString expected();
1461+
1462+ /*!
1463+ /fn QString checksum()
1464+
1465+ Returns the checksum of the download on disk after the download was completed.
1466+ */
1467+ QString checksum();
1468+
1469+ /*!
1470+ /fn QString errorString() override
1471+
1472+ Returns a string representation of the error.
1473+ */
1474+ QString errorString() override;
1475+
1476+ protected:
1477+
1478+ /*!
1479+ Creates a new error from the provided process error struct.
1480+ \internal
1481+ */
1482+ HashError(Transfers::Errors::HashErrorStruct err, QObject* parent);
1483+
1484+ private:
1485+ /*!
1486+ Use pimpl pattern so that users do not have to be recompiled
1487+ \internal
1488+ */
1489+ HashErrorPrivate* d_ptr;
1490+};
1491+
1492 } // DownloadManager
1493
1494 } // Ubuntu
1495-
1496-#endif // ERROR_H
1497
1498=== modified file 'src/downloads/client/ubuntu/download_manager/manager_impl.cpp'
1499--- src/downloads/client/ubuntu/download_manager/manager_impl.cpp 2014-06-29 12:45:29 +0000
1500+++ src/downloads/client/ubuntu/download_manager/manager_impl.cpp 2015-07-24 16:42:57 +0000
1501@@ -1,5 +1,5 @@
1502 /*
1503- * Copyright 2013-2014 Canonical Ltd.
1504+ * Copyright 2013-2015 Canonical Ltd.
1505 *
1506 * This library is free software; you can redistribute it and/or
1507 * modify it under the terms of version 3 of the GNU Lesser General Public
1508@@ -69,6 +69,7 @@
1509 qRegisterMetaType<HttpError*>("HttpError*");
1510 qRegisterMetaType<NetworkError*>("NetworkError*");
1511 qRegisterMetaType<AuthError*>("AuthError*");
1512+ qRegisterMetaType<HashError*>("HashError*");
1513 qRegisterMetaType<ProcessError*>("ProcessError*");
1514 qRegisterMetaType<DownloadsList*>("DownloadsList*");
1515 qDBusRegisterMetaType<StringMap>();
1516@@ -76,6 +77,7 @@
1517 qDBusRegisterMetaType<GroupDownloadStruct>();
1518 qDBusRegisterMetaType<StructList>();
1519 qDBusRegisterMetaType<AuthErrorStruct>();
1520+ qDBusRegisterMetaType<HashErrorStruct>();
1521 qDBusRegisterMetaType<HttpErrorStruct>();
1522 qDBusRegisterMetaType<NetworkErrorStruct>();
1523 qDBusRegisterMetaType<ProcessErrorStruct>();
1524
1525=== modified file 'src/downloads/common/ubuntu/download_manager/metatypes.h'
1526--- src/downloads/common/ubuntu/download_manager/metatypes.h 2014-02-26 19:54:31 +0000
1527+++ src/downloads/common/ubuntu/download_manager/metatypes.h 2015-07-24 16:42:57 +0000
1528@@ -1,5 +1,5 @@
1529 /*
1530- * Copyright 2013-2014 Canonical Ltd.
1531+ * Copyright 2013-2015 Canonical Ltd.
1532 *
1533 * This library is free software; you can redistribute it and/or
1534 * modify it under the terms of version 3 of the GNU Lesser General Public
1535@@ -16,12 +16,12 @@
1536 * Boston, MA 02110-1301, USA.
1537 */
1538
1539-#ifndef DOWNLOADER_LIB_APP_METATYPES_H
1540-#define DOWNLOADER_LIB_APP_METATYPES_H
1541+#pragma once
1542
1543 #include <QMap>
1544 #include <QList>
1545 #include <ubuntu/transfers/errors/auth_error_struct.h>
1546+#include <ubuntu/transfers/errors/hash_error_struct.h>
1547 #include <ubuntu/transfers/errors/http_error_struct.h>
1548 #include <ubuntu/transfers/errors/network_error_struct.h>
1549 #include <ubuntu/transfers/errors/process_error_struct.h>
1550@@ -35,6 +35,7 @@
1551 typedef QList<GroupDownloadStruct> StructList;
1552
1553 Q_DECLARE_METATYPE(AuthErrorStruct)
1554+Q_DECLARE_METATYPE(HashErrorStruct)
1555 Q_DECLARE_METATYPE(HttpErrorStruct)
1556 Q_DECLARE_METATYPE(NetworkErrorStruct)
1557 Q_DECLARE_METATYPE(ProcessErrorStruct)
1558@@ -42,4 +43,3 @@
1559 Q_DECLARE_METATYPE(StringMap)
1560 Q_DECLARE_METATYPE(StructList)
1561
1562-#endif // DOWNLOADER_LIB_APP_METATYPES_H
1563
1564=== modified file 'src/downloads/priv/ubuntu/downloads/download_adaptor.h'
1565--- src/downloads/priv/ubuntu/downloads/download_adaptor.h 2014-09-05 15:11:35 +0000
1566+++ src/downloads/priv/ubuntu/downloads/download_adaptor.h 2015-07-24 16:42:57 +0000
1567@@ -109,6 +109,10 @@
1568 " <annotation value=\"ProcessErrorStruct\" name=\"org.qtproject.QtDBus.QtTypeName.In0\"/>\n"
1569 " <arg direction=\"out\" type=\"(isiss)\" name=\"error\"/>\n"
1570 " </signal>\n"
1571+" <signal name=\"hashError\">\n"
1572+" <annotation value=\"HashErrorStruct\" name=\"org.qtproject.QtDBus.QtTypeName.In0\"/>\n"
1573+" <arg direction=\"out\" type=\"(sss)\" name=\"error\"/>\n"
1574+" </signal>\n"
1575 " <signal name=\"progress\">\n"
1576 " <arg direction=\"out\" type=\"t\" name=\"received\"/>\n"
1577 " <arg direction=\"out\" type=\"t\" name=\"total\"/>\n"
1578@@ -156,6 +160,7 @@
1579 void canceled(bool success);
1580 void error(const QString &error);
1581 void finished(const QString &path);
1582+ void hashError(HashErrorStruct error);
1583 void httpError(HttpErrorStruct error);
1584 void networkError(NetworkErrorStruct error);
1585 void paused(bool success);
1586
1587=== modified file 'src/downloads/priv/ubuntu/downloads/file_download.cpp'
1588--- src/downloads/priv/ubuntu/downloads/file_download.cpp 2015-01-23 11:59:19 +0000
1589+++ src/downloads/priv/ubuntu/downloads/file_download.cpp 2015-07-24 16:42:57 +0000
1590@@ -1,5 +1,5 @@
1591 /*
1592- * Copyright 2013-2014 Canonical Ltd.
1593+ * Copyright 2013-2015 Canonical Ltd.
1594 *
1595 * This library is free software; you can redistribute it and/or
1596 * modify it under the terms of version 3 of the GNU Lesser General Public
1597@@ -931,6 +931,7 @@
1598 QString fileSig = QString(hash->result().toHex());
1599 if (fileSig != _hash) {
1600 DOWN_LOG(ERROR) << HASH_ERROR << fileSig << "!=" << _hash;
1601+ emit hashError(HashErrorStruct(HashAlgorithm::getHashAlgo(_algo), _hash, fileSig));
1602 return false;
1603 }
1604 }
1605
1606=== modified file 'src/downloads/priv/ubuntu/downloads/file_download.h'
1607--- src/downloads/priv/ubuntu/downloads/file_download.h 2015-01-22 22:08:41 +0000
1608+++ src/downloads/priv/ubuntu/downloads/file_download.h 2015-07-24 16:42:57 +0000
1609@@ -1,5 +1,5 @@
1610 /*
1611- * Copyright 2013-2014 Canonical Ltd.
1612+ * Copyright 2013-2015 Canonical Ltd.
1613 *
1614 * This library is free software; you can redistribute it and/or
1615 * modify it under the terms of version 3 of the GNU Lesser General Public
1616@@ -103,6 +103,7 @@
1617 void httpError(HttpErrorStruct error);
1618 void networkError(NetworkErrorStruct error);
1619 void processError(ProcessErrorStruct error);
1620+ void hashError(HashErrorStruct error);
1621 void propertiesChanged(const QVariantMap& changes);
1622
1623 protected:
1624
1625=== modified file 'src/downloads/priv/ubuntu/downloads/manager.cpp'
1626--- src/downloads/priv/ubuntu/downloads/manager.cpp 2014-10-22 23:32:28 +0000
1627+++ src/downloads/priv/ubuntu/downloads/manager.cpp 2015-07-24 16:42:57 +0000
1628@@ -78,6 +78,7 @@
1629 qDBusRegisterMetaType<StructList>();
1630 qDBusRegisterMetaType<AuthErrorStruct>();
1631 qDBusRegisterMetaType<HttpErrorStruct>();
1632+ qDBusRegisterMetaType<HashErrorStruct>();
1633 qDBusRegisterMetaType<NetworkErrorStruct>();
1634 qDBusRegisterMetaType<ProcessErrorStruct>();
1635
1636
1637=== modified file 'src/downloads/test-daemon/testing_daemon.cpp'
1638--- src/downloads/test-daemon/testing_daemon.cpp 2014-03-12 12:59:51 +0000
1639+++ src/downloads/test-daemon/testing_daemon.cpp 2015-07-24 16:42:57 +0000
1640@@ -1,5 +1,5 @@
1641 /*
1642- * Copyright 2013-2014 Canonical Ltd.
1643+ * Copyright 2013-2015 Canonical Ltd.
1644 *
1645 * This library is free software; you can redistribute it and/or
1646 * modify it under the terms of version 3 of the GNU Lesser General Public
1647@@ -65,6 +65,17 @@
1648 }
1649
1650 void
1651+TestingDaemon::returnHashError(const QString &download,
1652+ HashErrorStruct error) {
1653+ qDebug() << "############################################";
1654+ qDebug() << "returnHashError from error";
1655+ qDebug() << "############################################";
1656+
1657+ auto man = qobject_cast<TestingManager*>(manager());
1658+ man->returnHashError(download, error);
1659+}
1660+
1661+void
1662 TestingDaemon::returnHttpError(const QString &download,
1663 HttpErrorStruct error) {
1664 auto man = qobject_cast<TestingManager*>(manager());
1665
1666=== modified file 'src/downloads/test-daemon/testing_daemon.h'
1667--- src/downloads/test-daemon/testing_daemon.h 2014-03-12 12:59:51 +0000
1668+++ src/downloads/test-daemon/testing_daemon.h 2015-07-24 16:42:57 +0000
1669@@ -1,5 +1,5 @@
1670 /*
1671- * Copyright 2013-2014 Canonical Ltd.
1672+ * Copyright 2013-2015 Canonical Ltd.
1673 *
1674 * This library is free software; you can redistribute it and/or
1675 * modify it under the terms of version 3 of the GNU Lesser General Public
1676@@ -16,8 +16,7 @@
1677 * Boston, MA 02110-1301, USA.
1678 */
1679
1680-#ifndef TESTING_DAEMON_H
1681-#define TESTING_DAEMON_H
1682+#pragma once
1683
1684 #include <QObject>
1685 #include <ubuntu/download_manager/metatypes.h>
1686@@ -36,6 +35,7 @@
1687 // let the client test to tell the manager to return dbus errors
1688 void returnDBusErrors(bool errors);
1689 void returnAuthError(const QString &download, AuthErrorStruct error);
1690+ void returnHashError(const QString &download, HashErrorStruct error);
1691 void returnHttpError(const QString &download, HttpErrorStruct error);
1692 void returnNetworkError(const QString &download, NetworkErrorStruct error);
1693 void returnProcessError(const QString &download, ProcessErrorStruct error);
1694@@ -52,4 +52,3 @@
1695
1696 };
1697
1698-#endif // TESTING_DAEMON_H
1699
1700=== modified file 'src/downloads/test-daemon/testing_file_download.cpp'
1701--- src/downloads/test-daemon/testing_file_download.cpp 2014-09-08 10:10:43 +0000
1702+++ src/downloads/test-daemon/testing_file_download.cpp 2015-07-24 16:42:57 +0000
1703@@ -1,5 +1,5 @@
1704 /*
1705- * Copyright 2014 Canonical Ltd.
1706+ * Copyright 2014-2015 Canonical Ltd.
1707 *
1708 * This library is free software; you can redistribute it and/or
1709 * modify it under the terms of version 3 of the GNU Lesser General Public
1710@@ -94,9 +94,20 @@
1711 _returnHttpError = false;
1712 _returnNetworkError = false;
1713 _returnProcessError = false;
1714+ _returnHashError = false;
1715 _authErr = error;
1716 }
1717
1718+void
1719+TestingFileDownload::returnHashError(HashErrorStruct error) {
1720+ _returnAuthError = false;
1721+ _returnHttpError = false;
1722+ _returnNetworkError = false;
1723+ _returnProcessError = false;
1724+ _returnHashError = true;
1725+ _hashErr = error;
1726+}
1727+
1728 qulonglong
1729 TestingFileDownload::progress() {
1730 if (calledFromDBus() && _returnErrors) {
1731@@ -246,6 +257,11 @@
1732 emitError("Forced processerror");
1733 }
1734
1735+ if (_returnHashError) {
1736+ emit hashError(_hashErr);
1737+ emitError("Forced hash error");
1738+ }
1739+
1740 }
1741
1742 void
1743
1744=== modified file 'src/downloads/test-daemon/testing_file_download.h'
1745--- src/downloads/test-daemon/testing_file_download.h 2014-09-08 10:10:43 +0000
1746+++ src/downloads/test-daemon/testing_file_download.h 2015-07-24 16:42:57 +0000
1747@@ -1,5 +1,5 @@
1748 /*
1749- * Copyright 2014 Canonical Ltd.
1750+ * Copyright 2014-2015 Canonical Ltd.
1751 *
1752 * This library is free software; you can redistribute it and/or
1753 * modify it under the terms of version 3 of the GNU Lesser General Public
1754@@ -16,8 +16,7 @@
1755 * Boston, MA 02110-1301, USA.
1756 */
1757
1758-#ifndef TESTING_FILE_DOWNLOAD_H
1759-#define TESTING_FILE_DOWNLOAD_H
1760+#pragma once
1761
1762 #include <QDBusContext>
1763 #include <QObject>
1764@@ -38,6 +37,7 @@
1765 void returnNetworkError(NetworkErrorStruct error);
1766 void returnProcessError(ProcessErrorStruct error);
1767 void returnAuthError(AuthErrorStruct error);
1768+ void returnHashError(HashErrorStruct error);
1769
1770 public slots: // NOLINT(whitespace/indent)
1771 qulonglong progress() override;
1772@@ -73,11 +73,12 @@
1773 bool _returnHttpError = false;
1774 bool _returnNetworkError = false;
1775 bool _returnProcessError = false;
1776+ bool _returnHashError = false;
1777 AuthErrorStruct _authErr;
1778 HttpErrorStruct _httpErr;
1779 NetworkErrorStruct _networkErr;
1780 ProcessErrorStruct _processErr;
1781+ HashErrorStruct _hashErr;
1782 FileDownload* _down = nullptr;
1783 };
1784
1785-#endif // TESTING_FILE_DOWNLOAD_H
1786
1787=== modified file 'src/downloads/test-daemon/testing_interface.cpp'
1788--- src/downloads/test-daemon/testing_interface.cpp 2014-03-12 12:59:51 +0000
1789+++ src/downloads/test-daemon/testing_interface.cpp 2015-07-24 16:42:57 +0000
1790@@ -2,7 +2,7 @@
1791 * This file was generated by qdbusxml2cpp version 0.8
1792 * Command line was: qdbusxml2cpp com.canonical.applications.testing.download_manager.xml -p testing_interface -c TestingInterface
1793 *
1794- * qdbusxml2cpp is Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
1795+ * qdbusxml2cpp is Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
1796 *
1797 * This is an auto-generated file.
1798 * This file may have been hand-edited. Look for HAND-EDIT comments
1799
1800=== modified file 'src/downloads/test-daemon/testing_interface.h'
1801--- src/downloads/test-daemon/testing_interface.h 2014-03-12 12:59:51 +0000
1802+++ src/downloads/test-daemon/testing_interface.h 2015-07-24 16:42:57 +0000
1803@@ -2,7 +2,7 @@
1804 * This file was generated by qdbusxml2cpp version 0.8
1805 * Command line was: qdbusxml2cpp com.canonical.applications.testing.download_manager.xml -p testing_interface -c TestingInterface
1806 *
1807- * qdbusxml2cpp is Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
1808+ * qdbusxml2cpp is Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
1809 *
1810 * This is an auto-generated file.
1811 * Do not edit! All changes made to it will be lost.
1812@@ -51,6 +51,13 @@
1813 return asyncCallWithArgumentList(QLatin1String("returnDBusErrors"), argumentList);
1814 }
1815
1816+ inline QDBusPendingReply<> returnHashError(const QString &download, HashErrorStruct error)
1817+ {
1818+ QList<QVariant> argumentList;
1819+ argumentList << QVariant::fromValue(download) << QVariant::fromValue(error);
1820+ return asyncCallWithArgumentList(QLatin1String("returnHashError"), argumentList);
1821+ }
1822+
1823 inline QDBusPendingReply<> returnHttpError(const QString &download, HttpErrorStruct error)
1824 {
1825 QList<QVariant> argumentList;
1826
1827=== modified file 'src/downloads/test-daemon/testing_manager.cpp'
1828--- src/downloads/test-daemon/testing_manager.cpp 2014-03-25 17:28:41 +0000
1829+++ src/downloads/test-daemon/testing_manager.cpp 2015-07-24 16:42:57 +0000
1830@@ -1,5 +1,5 @@
1831 /*
1832- * Copyright 2013 Canonical Ltd.
1833+ * Copyright 2013-2015 Canonical Ltd.
1834 *
1835 * This library is free software; you can redistribute it and/or
1836 * modify it under the terms of version 3 of the GNU Lesser General Public
1837@@ -86,12 +86,22 @@
1838 }
1839 }
1840
1841+void
1842+TestingManager::returnHashError(const QString &download, HashErrorStruct error) {
1843+ auto q = queue();
1844+ foreach(auto transfer, q->transfers().values()) {
1845+ auto testDown = qobject_cast<TestingFileDownload*>(transfer);
1846+ if (testDown != nullptr && testDown->url() == download) {
1847+ testDown->returnHashError(error);
1848+ }
1849+ }
1850+}
1851+
1852 QDBusObjectPath
1853 TestingManager::registerDownload(Download* download) {
1854 QDBusObjectPath path;
1855 auto fileDown = qobject_cast<FileDownload*>(download);
1856 if (fileDown != nullptr) {
1857- qDebug() << "Register testing file";
1858 auto testDown = new TestingFileDownload(fileDown);
1859 auto downAdaptor = new DownloadAdaptor(testDown);
1860 Q_UNUSED(downAdaptor);
1861@@ -101,7 +111,6 @@
1862 path = DownloadManager::registerDownload(download);
1863 }
1864 // create an adaptor so that we can be exposed to Dbus
1865- qDebug() << "Path" << path.path();
1866 return path;
1867 }
1868
1869
1870=== modified file 'src/downloads/test-daemon/testing_manager.h'
1871--- src/downloads/test-daemon/testing_manager.h 2014-03-25 17:28:41 +0000
1872+++ src/downloads/test-daemon/testing_manager.h 2015-07-24 16:42:57 +0000
1873@@ -1,5 +1,5 @@
1874 /*
1875- * Copyright 2013 Canonical Ltd.
1876+ * Copyright 2013-2015 Canonical Ltd.
1877 *
1878 * This library is free software; you can redistribute it and/or
1879 * modify it under the terms of version 3 of the GNU Lesser General Public
1880@@ -16,8 +16,7 @@
1881 * Boston, MA 02110-1301, USA.
1882 */
1883
1884-#ifndef TESTING_MANAGER_H
1885-#define TESTING_MANAGER_H
1886+#pragma once
1887
1888 #include <QObject>
1889 #include <ubuntu/download_manager/metatypes.h>
1890@@ -60,6 +59,7 @@
1891 void returnNetworkError(const QString &download, NetworkErrorStruct error);
1892 void returnProcessError(const QString &download, ProcessErrorStruct error);
1893 void returnAuthError(const QString &download, AuthErrorStruct error);
1894+ void returnHashError(const QString &download, HashErrorStruct error);
1895
1896 protected:
1897 QDBusObjectPath registerDownload(Download* download) override;
1898@@ -67,4 +67,3 @@
1899 bool _returnErrors = false;
1900 };
1901
1902-#endif // TESTING_MANAGER_H
1903
1904=== modified file 'src/downloads/test-daemon/testing_manager_adaptor.cpp'
1905--- src/downloads/test-daemon/testing_manager_adaptor.cpp 2014-03-12 12:59:51 +0000
1906+++ src/downloads/test-daemon/testing_manager_adaptor.cpp 2015-07-24 16:42:57 +0000
1907@@ -2,7 +2,7 @@
1908 * This file was generated by qdbusxml2cpp version 0.8
1909 * Command line was: qdbusxml2cpp -c TestingManagerAdaptor -a testing_manager_adaptor.h:testing_manager_adaptor.cpp com.canonical.applications.testing.download_manager.xml
1910 *
1911- * qdbusxml2cpp is Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
1912+ * qdbusxml2cpp is Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
1913 *
1914 * This is an auto-generated file.
1915 * Do not edit! All changes made to it will be lost.
1916@@ -17,6 +17,8 @@
1917 #include <QtCore/QStringList>
1918 #include <QtCore/QVariant>
1919
1920+#include <QDebug>
1921+
1922 /*
1923 * Implementation of adaptor class TestingManagerAdaptor
1924 */
1925@@ -45,6 +47,12 @@
1926 QMetaObject::invokeMethod(parent(), "returnDBusErrors", Q_ARG(bool, returnErrors));
1927 }
1928
1929+void TestingManagerAdaptor::returnHashError(const QString &download, HashErrorStruct error)
1930+{
1931+ // handle method call com.canonical.applications.testing.DownloadManager.returnHashError
1932+ QMetaObject::invokeMethod(parent(), "returnHashError", Q_ARG(QString, download), Q_ARG(HashErrorStruct, error));
1933+}
1934+
1935 void TestingManagerAdaptor::returnHttpError(const QString &download, HttpErrorStruct error)
1936 {
1937 // handle method call com.canonical.applications.testing.DownloadManager.returnHttpError
1938
1939=== modified file 'src/downloads/test-daemon/testing_manager_adaptor.h'
1940--- src/downloads/test-daemon/testing_manager_adaptor.h 2014-03-12 12:59:51 +0000
1941+++ src/downloads/test-daemon/testing_manager_adaptor.h 2015-07-24 16:42:57 +0000
1942@@ -2,7 +2,7 @@
1943 * This file was generated by qdbusxml2cpp version 0.8
1944 * Command line was: qdbusxml2cpp -c TestingManagerAdaptor -a testing_manager_adaptor.h:testing_manager_adaptor.cpp com.canonical.applications.testing.download_manager.xml
1945 *
1946- * qdbusxml2cpp is Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
1947+ * qdbusxml2cpp is Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
1948 *
1949 * This is an auto-generated file.
1950 * This file may have been hand-edited. Look for HAND-EDIT comments
1951@@ -57,6 +57,11 @@
1952 " <arg direction=\"in\" type=\"s\" name=\"download\"/>\n"
1953 " <arg direction=\"in\" type=\"(is)\" name=\"error\"/>\n"
1954 " </method>\n"
1955+" <method name=\"returnHashError\">\n"
1956+" <annotation value=\"HashErrorStruct\" name=\"org.qtproject.QtDBus.QtTypeName.In1\"/>\n"
1957+" <arg direction=\"in\" type=\"s\" name=\"download\"/>\n"
1958+" <arg direction=\"in\" type=\"(sss)\" name=\"error\"/>\n"
1959+" </method>\n"
1960 " </interface>\n"
1961 "")
1962 public:
1963@@ -67,6 +72,7 @@
1964 public Q_SLOTS: // METHODS
1965 void returnAuthError(const QString &download, AuthErrorStruct error);
1966 void returnDBusErrors(bool returnErrors);
1967+ void returnHashError(const QString &download, HashErrorStruct error);
1968 void returnHttpError(const QString &download, HttpErrorStruct error);
1969 void returnNetworkError(const QString &download, NetworkErrorStruct error);
1970 void returnProcessError(const QString &download, ProcessErrorStruct error);
1971
1972=== removed file 'src/downloads/test-daemon/ubuntu-download-manager-test-daemon.pro.THIS'
1973--- src/downloads/test-daemon/ubuntu-download-manager-test-daemon.pro.THIS 2014-03-07 15:39:14 +0000
1974+++ src/downloads/test-daemon/ubuntu-download-manager-test-daemon.pro.THIS 1970-01-01 00:00:00 +0000
1975@@ -1,44 +0,0 @@
1976-include( ../common-project-config.pri )
1977-include( ../common-vars.pri )
1978-
1979-QT += core systeminfo
1980-
1981-QT -= gui
1982-
1983-TARGET = ubuntu-download-manager-test-daemon
1984-CONFIG += console
1985-CONFIG -= app_bundle
1986-
1987-TEMPLATE = app
1988-
1989-SOURCES += main.cpp
1990-
1991-LIBS += -L$$OUT_PWD/../udm-common/ -ludm-common
1992-
1993-INCLUDEPATH += $$PWD/../udm-common
1994-DEPENDPATH += $$PWD/../udm-common
1995-
1996-LIBS += -L$$OUT_PWD/../udm-priv-common/ -ludm-priv-common
1997-
1998-INCLUDEPATH += $$PWD/../udm-priv-common
1999-DEPENDPATH += $$PWD/../udm-priv-common
2000-
2001-LIBS += -L$$OUT_PWD/../ubuntu-download-manager-common/ -lubuntu-download-manager-common
2002-
2003-INCLUDEPATH += $$PWD/../ubuntu-download-manager-common
2004-DEPENDPATH += $$PWD/../ubuntu-download-manager-common
2005-
2006-LIBS += -L$$OUT_PWD/../ubuntu-download-manager-priv/ -lubuntu-download-manager-priv
2007-
2008-INCLUDEPATH += $$PWD/../ubuntu-download-manager-priv
2009-DEPENDPATH += $$PWD/../ubuntu-download-manager-priv
2010-
2011-LIBS += -L$$OUT_PWD/../udm-testing/ -ludm-testing
2012-
2013-INCLUDEPATH += $$PWD/../udm-testing
2014-DEPENDPATH += $$PWD/../udm-testing
2015-
2016-LIBS += -L$$OUT_PWD/../ubuntu-download-manager-test-lib/ -lubuntu-download-manager-test-lib
2017-
2018-INCLUDEPATH += $$PWD/../ubuntu-download-manager-test-lib
2019-DEPENDPATH += $$PWD/../ubuntu-download-manager-test-lib
2020
2021=== modified file 'tests/common/daemon_testcase.cpp'
2022--- tests/common/daemon_testcase.cpp 2014-11-17 20:57:20 +0000
2023+++ tests/common/daemon_testcase.cpp 2015-07-24 16:42:57 +0000
2024@@ -1,5 +1,5 @@
2025 /*
2026- * Copyright 2013-2014 Canonical Ltd.
2027+ * Copyright 2013-2015 Canonical Ltd.
2028 *
2029 * This library is free software; you can redistribute it and/or
2030 * modify it under the terms of version 3 of the GNU Lesser General Public
2031@@ -21,8 +21,10 @@
2032 #include <QDBusMessage>
2033 #include <QFile>
2034 #include <QFileInfo>
2035+#include <QProcessEnvironment>
2036 #include <QScopedPointer>
2037-#include <QProcessEnvironment>
2038+#include <QThread>
2039+
2040 #include "testing_interface.h"
2041 #include "daemon_testcase.h"
2042 #define TEST_DAEMON "ubuntu-download-manager-test-daemon"
2043@@ -105,7 +107,7 @@
2044 QSKIP(msg.toUtf8(), SkipSingle);
2045 }
2046 } else {
2047- QFAIL("returnHttpError must be used after init has been executed.");
2048+ QFAIL("returnAuthError must be used after init has been executed.");
2049 }
2050 }
2051
2052@@ -175,6 +177,27 @@
2053 }
2054
2055 void
2056+DaemonTestCase::returnHashError(const QString &download, HashErrorStruct error) {
2057+ if (_daemonProcess != nullptr) {
2058+ auto conn = QDBusConnection::sessionBus();
2059+ QScopedPointer<TestingInterface> testingInterface(new TestingInterface(
2060+ _daemonPath, "/", conn));
2061+ QDBusPendingReply<> reply =
2062+ testingInterface->returnHashError(download, error);
2063+ reply.waitForFinished();
2064+
2065+ if (reply.isError()) {
2066+ auto error = reply.error();
2067+ QString msg = "Could not tell the daemon to return Hash errors: "
2068+ + error.name() + ":" + error.message();
2069+ QSKIP(msg.toUtf8(), SkipSingle);
2070+ }
2071+ } else {
2072+ QFAIL("returnHashError must be used after init has been executed.");
2073+ }
2074+}
2075+
2076+void
2077 DaemonTestCase::startUDMDaemon() {
2078 _daemonProcess = new QProcess();
2079
2080
2081=== modified file 'tests/common/daemon_testcase.h'
2082--- tests/common/daemon_testcase.h 2014-07-03 09:01:01 +0000
2083+++ tests/common/daemon_testcase.h 2015-07-24 16:42:57 +0000
2084@@ -1,5 +1,5 @@
2085 /*
2086- * Copyright 2013 Canonical Ltd.
2087+ * Copyright 2013-2015 Canonical Ltd.
2088 *
2089 * This library is free software; you can redistribute it and/or
2090 * modify it under the terms of version 3 of the GNU Lesser General Public
2091@@ -16,8 +16,7 @@
2092 * Boston, MA 02110-1301, USA.
2093 */
2094
2095-#ifndef DAEMON_TESTCASE_H
2096-#define DAEMON_TESTCASE_H
2097+#pragma once
2098
2099 #include <QDebug>
2100 #include <QObject>
2101@@ -46,6 +45,7 @@
2102 void returnHttpError(const QString &download, HttpErrorStruct error);
2103 void returnNetworkError(const QString &download, NetworkErrorStruct error);
2104 void returnProcessError(const QString &download, ProcessErrorStruct error);
2105+ void returnHashError(const QString &download, HashErrorStruct error);
2106
2107 private:
2108 void startUDMDaemon();
2109@@ -73,4 +73,3 @@
2110
2111 };
2112
2113-#endif // DAEMON_TESTCASE_H
2114
2115=== modified file 'tests/common/testing_interface.cpp'
2116--- tests/common/testing_interface.cpp 2014-07-03 09:01:01 +0000
2117+++ tests/common/testing_interface.cpp 2015-07-24 16:42:57 +0000
2118@@ -2,7 +2,7 @@
2119 * This file was generated by qdbusxml2cpp version 0.8
2120 * Command line was: qdbusxml2cpp com.canonical.applications.testing.download_manager.xml -p testing_interface -c TestingInterface
2121 *
2122- * qdbusxml2cpp is Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
2123+ * qdbusxml2cpp is Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
2124 *
2125 * This is an auto-generated file.
2126 * This file may have been hand-edited. Look for HAND-EDIT comments
2127
2128=== modified file 'tests/common/testing_interface.h'
2129--- tests/common/testing_interface.h 2014-07-03 09:01:01 +0000
2130+++ tests/common/testing_interface.h 2015-07-24 16:42:57 +0000
2131@@ -2,7 +2,7 @@
2132 * This file was generated by qdbusxml2cpp version 0.8
2133 * Command line was: qdbusxml2cpp com.canonical.applications.testing.download_manager.xml -p testing_interface -c TestingInterface
2134 *
2135- * qdbusxml2cpp is Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
2136+ * qdbusxml2cpp is Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
2137 *
2138 * This is an auto-generated file.
2139 * Do not edit! All changes made to it will be lost.
2140@@ -51,6 +51,13 @@
2141 return asyncCallWithArgumentList(QLatin1String("returnDBusErrors"), argumentList);
2142 }
2143
2144+ inline QDBusPendingReply<> returnHashError(const QString &download, HashErrorStruct error)
2145+ {
2146+ QList<QVariant> argumentList;
2147+ argumentList << QVariant::fromValue(download) << QVariant::fromValue(error);
2148+ return asyncCallWithArgumentList(QLatin1String("returnHashError"), argumentList);
2149+ }
2150+
2151 inline QDBusPendingReply<> returnHttpError(const QString &download, HttpErrorStruct error)
2152 {
2153 QList<QVariant> argumentList;
2154
2155=== modified file 'tests/downloads/client/CMakeLists.txt'
2156--- tests/downloads/client/CMakeLists.txt 2014-11-17 23:07:13 +0000
2157+++ tests/downloads/client/CMakeLists.txt 2015-07-24 16:42:57 +0000
2158@@ -1,4 +1,4 @@
2159-# Copyright © 2014 Canonical Ltd.
2160+# Copyright © 2014-2015 Canonical Ltd.
2161 #
2162 # This program is free software: you can redistribute it and/or modify
2163 # it under the terms of the GNU General Public License version 3 as
2164@@ -17,9 +17,10 @@
2165
2166 set(CLIENT_TESTS
2167 test_client_download
2168- # test_download_manager_watch
2169- # test_download_watch
2170- # test_client_manager
2171+ test_download_manager_watch
2172+ test_download_watch
2173+ test_client_manager
2174+ test_group_manager_watch
2175 )
2176
2177 foreach(test ${CLIENT_TESTS})
2178@@ -59,14 +60,14 @@
2179 set(CLIENT_TESTS_LIBS
2180 ${NIH_DBUS_LIBRARIES}
2181 ${GLOG_LIBRARIES}
2182- ${Qt5Network_LIBRARIES}
2183+ ${Qt5Network_LIBRARIES}
2184 ${Qt5Test_LIBRARIES}
2185 udm-common
2186 udm-priv-common
2187 ubuntu-download-manager-common
2188 ubuntu-download-manager-client
2189 ubuntu-download-manager-priv
2190- ubuntu-download-manager-test-lib
2191+ ubuntu-download-manager-test-lib
2192 )
2193
2194 if(DBUS_RUNNER)
2195
2196=== modified file 'tests/downloads/client/test_client_download.cpp'
2197--- tests/downloads/client/test_client_download.cpp 2014-09-28 01:15:28 +0000
2198+++ tests/downloads/client/test_client_download.cpp 2015-07-24 16:42:57 +0000
2199@@ -1,5 +1,5 @@
2200 /*
2201- * Copyright 2014 Canonical Ltd.
2202+ * Copyright 2014-2015 Canonical Ltd.
2203 *
2204 * This library is free software; you can redistribute it and/or
2205 * modify it under the terms of version 3 of the GNU Lesser General Public
2206@@ -440,4 +440,40 @@
2207 QCOMPARE(Error::DBus, _down->error()->type());
2208 }
2209
2210+void
2211+TestDownload::testHashErrorRaised_data() {
2212+ QTest::addColumn<QString>("method");
2213+ QTest::addColumn<QString>("expected");
2214+ QTest::addColumn<QString>("found");
2215+
2216+ QTest::newRow("MD5") << "MD5" << "2323nlkmwe" << "sdscopw";
2217+ QTest::newRow("SHA524") << "Sha524" << "eww23sds" << "dscbnnt32";
2218+ QTest::newRow("Ransom") << "Sha245" << "ew23fv4t" << "2edbg92";
2219+}
2220+
2221+void
2222+TestDownload::testHashErrorRaised() {
2223+ QFETCH(QString, method);
2224+ QFETCH(QString, expected);
2225+ QFETCH(QString, found);
2226+
2227+ HashErrorStruct err(method, expected, found);
2228+ returnHashError(_url, err);
2229+
2230+ SignalBarrier spy(_down, SIGNAL(error(Error*)));
2231+ _down->start();
2232+
2233+ QVERIFY(spy.ensureSignalEmitted());
2234+ QTRY_COMPARE(1, spy.count());
2235+ auto error = spy.takeFirst().at(0).value<Error*>();
2236+ QVERIFY(_down->isError());
2237+ QVERIFY(_down->error() != nullptr);
2238+ QCOMPARE(Error::Hash, error->type());
2239+
2240+ auto hashError = qobject_cast<HashError*>(error);
2241+ QCOMPARE(method, hashError->method());
2242+ QCOMPARE(expected, hashError->expected());
2243+ QCOMPARE(found, hashError->checksum());
2244+}
2245+
2246 QTEST_MAIN(TestDownload)
2247
2248=== modified file 'tests/downloads/client/test_client_download.h'
2249--- tests/downloads/client/test_client_download.h 2014-09-08 10:10:43 +0000
2250+++ tests/downloads/client/test_client_download.h 2015-07-24 16:42:57 +0000
2251@@ -1,5 +1,5 @@
2252 /*
2253- * Copyright 2014 Canonical Ltd.
2254+ * Copyright 2014-2015 Canonical Ltd.
2255 *
2256 * This library is free software; you can redistribute it and/or
2257 * modify it under the terms of version 3 of the GNU Lesser General Public
2258@@ -16,8 +16,7 @@
2259 * Boston, MA 02110-1301, USA.
2260 */
2261
2262-#ifndef TEST_DOWNLOAD_H
2263-#define TEST_DOWNLOAD_H
2264+#pragma once
2265
2266 #include <QObject>
2267 #include <ubuntu/download_manager/manager.h>
2268@@ -61,6 +60,8 @@
2269 void testNetworkErroRaised();
2270 void testProcessErrorRaised_data();
2271 void testProcessErrorRaised();
2272+ void testHashErrorRaised_data();
2273+ void testHashErrorRaised();
2274
2275 // set local dir tests
2276 void testSetLocalDirectory();
2277@@ -77,4 +78,3 @@
2278 Download* _down = nullptr;
2279 };
2280
2281-#endif // TEST_DOWNLOAD_H
2282
2283=== modified file 'tests/downloads/client/test_client_manager.cpp'
2284--- tests/downloads/client/test_client_manager.cpp 2014-09-22 12:09:16 +0000
2285+++ tests/downloads/client/test_client_manager.cpp 2015-07-24 16:42:57 +0000
2286@@ -165,7 +165,7 @@
2287
2288 // ensure that all of the are created
2289 QVERIFY(managerSpy.ensureSignalEmitted());
2290- QTRY_COMPARE(count, managerSpy.count());
2291+ QTRY_COMPARE_WITH_TIMEOUT(count, managerSpy.count(), 20000);
2292 _man->getAllDownloads();
2293
2294 QVERIFY(listSpy.ensureSignalEmitted());
2295
2296=== modified file 'tests/downloads/client/test_group_manager_watch.h'
2297--- tests/downloads/client/test_group_manager_watch.h 2014-07-03 09:01:01 +0000
2298+++ tests/downloads/client/test_group_manager_watch.h 2015-07-24 16:42:57 +0000
2299@@ -1,5 +1,5 @@
2300 /*
2301- * Copyright 2013 Canonical Ltd.
2302+ * Copyright 2013-2015 Canonical Ltd.
2303 *
2304 * This library is free software; you can redistribute it and/or
2305 * modify it under the terms of version 3 of the GNU Lesser General Public
2306@@ -16,15 +16,14 @@
2307 * Boston, MA 02110-1301, USA.
2308 */
2309
2310-#ifndef TEST_GROUP_WATCH_H
2311-#define TEST_GROUP_WATCH_H
2312+#pragma once
2313
2314 #include <functional>
2315 #include <ubuntu/download_manager/group_download.h>
2316 #include <ubuntu/download_manager/error.h>
2317 #include <ubuntu/download_manager/manager.h>
2318+
2319 #include <QObject>
2320-#include <ubuntu/transfers/tests/test_runner.h>
2321 #include "local_tree_testcase.h"
2322
2323 using namespace Ubuntu::DownloadManager;
2324@@ -55,4 +54,3 @@
2325 Manager* _manager = nullptr;
2326 };
2327
2328-#endif // TEST_GROUP_WATCH_H
2329
2330=== modified file 'tests/downloads/daemon/CMakeLists.txt'
2331--- tests/downloads/daemon/CMakeLists.txt 2015-01-22 16:25:08 +0000
2332+++ tests/downloads/daemon/CMakeLists.txt 2015-07-24 16:42:57 +0000
2333@@ -1,4 +1,4 @@
2334-# Copyright © 2014 Canonical Ltd.
2335+# Copyright © 2014-2015 Canonical Ltd.
2336 #
2337 # This program is free software: you can redistribute it and/or modify
2338 # it under the terms of the GNU General Public License version 3 as
2339@@ -53,6 +53,7 @@
2340 download.h
2341 factory.h
2342 filename_mutex.h
2343+ group_download.h
2344 manager.h
2345 pending_reply.h
2346 queue.h
2347
2348=== modified file 'tests/downloads/daemon/test_download.cpp'
2349--- tests/downloads/daemon/test_download.cpp 2015-02-02 11:05:15 +0000
2350+++ tests/downloads/daemon/test_download.cpp 2015-07-24 16:42:57 +0000
2351@@ -1,5 +1,5 @@
2352 /*
2353- * Copyright 2013-2014 Canonical Ltd.
2354+ * Copyright 2013-2015 Canonical Ltd.
2355 *
2356 * This library is free software; you can redistribute it and/or
2357 * modify it under the terms of version 3 of the GNU Lesser General Public
2358@@ -1374,6 +1374,7 @@
2359 _isConfined, _rootPath, _url, "imposible-hash-is-not-hex",
2360 _algo, _metadata, _headers);
2361
2362+ SignalBarrier hashSpy(download, SIGNAL(hashError(HashErrorStruct)));
2363 SignalBarrier errorSpy(download, SIGNAL(error(QString)));
2364 SignalBarrier startedSpy(download, SIGNAL(started(bool)));
2365 SignalBarrier processingSpy(download, SIGNAL(processing(QString)));
2366@@ -1386,6 +1387,7 @@
2367
2368 // the has is a random string so we should get an error signal
2369
2370+ QVERIFY(hashSpy.ensureSignalEmitted());
2371 QVERIFY(errorSpy.ensureSignalEmitted());
2372 QTRY_COMPARE(errorSpy.count(), 1);
2373 QTRY_COMPARE(processingSpy.count(), 1);
2374
2375=== modified file 'tests/downloads/daemon/test_final_state.cpp'
2376--- tests/downloads/daemon/test_final_state.cpp 2014-07-03 09:01:01 +0000
2377+++ tests/downloads/daemon/test_final_state.cpp 2015-07-24 16:42:57 +0000
2378@@ -43,10 +43,6 @@
2379 BaseTestCase::cleanup();
2380 _stateMachine.removeState(_s1);
2381 _stateMachine.removeState(_s2);
2382- delete _obj;
2383- delete _transition;
2384- delete _s1;
2385- delete _s2;
2386 }
2387
2388 void
2389
2390=== modified file 'tests/downloads/qml/CMakeLists.txt'
2391--- tests/downloads/qml/CMakeLists.txt 2014-11-17 23:07:13 +0000
2392+++ tests/downloads/qml/CMakeLists.txt 2015-07-24 16:42:57 +0000
2393@@ -20,18 +20,18 @@
2394 )
2395
2396 foreach(test ${QML_TESTS})
2397- # set the sources per test
2398- set(${test}_QML_SOURCES
2399- ${test}.cpp
2400- )
2401+ # set the sources per test
2402+ set(${test}_QML_SOURCES
2403+ ${test}.cpp
2404+ )
2405
2406- set(${test}_QML_HEADERS
2407- download.h
2408- error.h
2409- manager.h
2410- testable_single_download.h
2411- ${test}.h
2412- )
2413+ set(${test}_QML_HEADERS
2414+ wnload.h
2415+ error.h
2416+ manager.h
2417+ testable_single_download.h
2418+ ${test}.h
2419+ )
2420
2421 endforeach(test)
2422
2423@@ -57,30 +57,36 @@
2424 set(QML_TESTS_LIBS
2425 ${NIH_DBUS_LIBRARIES}
2426 ${GLOG_LIBRARIES}
2427- ${Qt5Core_LIBRARIES}
2428- ${Qt5Sql_LIBRARIES}
2429- ${Qt5DBus_LIBRARIES}
2430+ ${Qt5Core_LIBRARIES}
2431+ ${Qt5Sql_LIBRARIES}
2432+ ${Qt5DBus_LIBRARIES}
2433 ${Qt5Test_LIBRARIES}
2434- ${GMOCK_LIBRARY}
2435- ${GTEST_BOTH_LIBRARIES}
2436+ ${GMOCK_LIBRARY}
2437+ ${GTEST_BOTH_LIBRARIES}
2438 udm-common
2439 ubuntu-download-manager-common
2440- ubuntu-download-manager-test-lib
2441- UbuntuDownloadManager
2442+ ubuntu-download-manager-test-lib
2443+ UbuntuDownloadManager
2444 )
2445
2446-foreach(test ${QML_TESTS})
2447+find_program(XVFB xvfb)
2448+
2449+if(XVFB)
2450+ foreach(test ${QML_TESTS})
2451 # set targets, linked libs and test
2452 add_executable(${test}_qml
2453- ${${test}_QML_SOURCES}
2454- ${${test}_QML_HEADERS}
2455+ ${${test}_QML_SOURCES}
2456+ ${${test}_QML_HEADERS}
2457 )
2458
2459 target_link_libraries(${test}_qml
2460- ${QML_TESTS_LIBS}
2461+ ${QML_TESTS_LIBS}
2462 )
2463
2464
2465- ADD_TEST(NAME qml_${test} COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${test}_qml)
2466-endforeach(test)
2467+ ADD_TEST(NAME qml_${test} COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${test}_qml)
2468+ endforeach(test)
2469+else(XVFB)
2470+ message(WARNING "dbus-test-runner binary not found tests will be disabled")
2471+endif(XVFB)
2472

Subscribers

People subscribed via source and target branches