Merge lp:~marcustomlinson/keeper/client-lib into lp:keeper
- client-lib
- Merge into trunk
Proposed by
Marcus Tomlinson
Status: | Merged |
---|---|
Approved by: | Charles Kerr |
Approved revision: | 84 |
Merged at revision: | 73 |
Proposed branch: | lp:~marcustomlinson/keeper/client-lib |
Merge into: | lp:keeper |
Diff against target: |
735 lines (+263/-49) 23 files modified
CMakeLists.txt (+5/-1) debian/control (+20/-0) debian/keeper-client-dev.install (+2/-0) debian/libkeeper-client.install (+1/-0) include/client/client.h (+48/-0) src/CMakeLists.txt (+1/-0) src/cli/main.cpp (+4/-4) src/client/CMakeLists.txt (+54/-0) src/client/client.cpp (+78/-0) src/client/keeper-client.pc.in (+6/-0) src/helper/backup-helper.cpp (+6/-6) src/helper/data-dir-registry.cpp (+2/-2) src/service/backup-choices.cpp (+1/-1) src/service/keeper-helper.cpp (+1/-1) src/service/keeper.cpp (+2/-2) src/storage-framework/storage_framework_client.cpp (+8/-8) src/tar/main.cpp (+2/-2) tests/fakes/fake-backup-helper.cpp (+1/-1) tests/integration/helpers/helpers-test-failure.cpp (+2/-2) tests/integration/helpers/helpers-test.cc (+4/-4) tests/integration/helpers/test-helpers-base.cpp (+7/-7) tests/unit/tar/tar-creator-libarchive-failure-test.cpp (+1/-1) tests/utils/file-utils.cpp (+7/-7) |
To merge this branch: | bzr merge lp:~marcustomlinson/keeper/client-lib |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Charles Kerr (community) | Approve | ||
Review via email: mp+302386@code.launchpad.net |
Commit message
Add keeper-client lib
Description of the change
To post a comment you must log in.
- 85. By Marcus Tomlinson
-
Missing QVariant include
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2016-08-09 04:39:25 +0000 | |||
3 | +++ CMakeLists.txt 2016-08-11 00:26:19 +0000 | |||
4 | @@ -1,3 +1,7 @@ | |||
5 | 1 | # Version | ||
6 | 2 | set(KEEPER_MAJOR "0") | ||
7 | 3 | set(KEEPER_MINOR "0") | ||
8 | 4 | set(KEEPER_MICRO "1") | ||
9 | 1 | 5 | ||
10 | 2 | # Default install location. Must be set here, before setting the project. | 6 | # Default install location. Must be set here, before setting the project. |
11 | 3 | if(NOT DEFINED CMAKE_INSTALL_PREFIX) | 7 | if(NOT DEFINED CMAKE_INSTALL_PREFIX) |
12 | @@ -5,8 +9,8 @@ | |||
13 | 5 | set(LOCAL_INSTALL "ON") | 9 | set(LOCAL_INSTALL "ON") |
14 | 6 | endif() | 10 | endif() |
15 | 7 | 11 | ||
16 | 8 | project(keeper C CXX) | ||
17 | 9 | cmake_minimum_required(VERSION 3.0.2) | 12 | cmake_minimum_required(VERSION 3.0.2) |
18 | 13 | project(keeper VERSION ${KEEPER_MAJOR}.${KEEPER_MINOR}.${KEEPER_MICRO} LANGUAGES C CXX) | ||
19 | 10 | 14 | ||
20 | 11 | ## | 15 | ## |
21 | 12 | ## Build Type | 16 | ## Build Type |
22 | 13 | 17 | ||
23 | === modified file 'debian/control' | |||
24 | --- debian/control 2016-07-28 13:52:30 +0000 | |||
25 | +++ debian/control 2016-08-11 00:26:19 +0000 | |||
26 | @@ -55,3 +55,23 @@ | |||
27 | 55 | systemd | systemd-shim, | 55 | systemd | systemd-shim, |
28 | 56 | Description: Backup Tool | 56 | Description: Backup Tool |
29 | 57 | A backup/restore utility for Ubuntu (client application) | 57 | A backup/restore utility for Ubuntu (client application) |
30 | 58 | |||
31 | 59 | Package: libkeeper-client | ||
32 | 60 | Architecture: any | ||
33 | 61 | Multi-Arch: same | ||
34 | 62 | Pre-Depends: ${misc:Pre-Depends}, | ||
35 | 63 | Depends: ${misc:Depends}, | ||
36 | 64 | ${shlibs:Depends}, | ||
37 | 65 | Description: Client library for Keeper | ||
38 | 66 | Runtime support for Keeper clients. | ||
39 | 67 | |||
40 | 68 | Package: keeper-client-dev | ||
41 | 69 | Section: libdevel | ||
42 | 70 | Architecture: any | ||
43 | 71 | Multi-Arch: same | ||
44 | 72 | Pre-Depends: ${misc:Pre-Depends}, | ||
45 | 73 | Depends: libkeeper-client (= ${binary:Version}), | ||
46 | 74 | ${misc:Depends}, | ||
47 | 75 | Description: Header files for the Keeper client libraries | ||
48 | 76 | Development headers for Keeper clients. | ||
49 | 77 | |||
50 | 58 | 78 | ||
51 | === added file 'debian/keeper-client-dev.install' | |||
52 | --- debian/keeper-client-dev.install 1970-01-01 00:00:00 +0000 | |||
53 | +++ debian/keeper-client-dev.install 2016-08-11 00:26:19 +0000 | |||
54 | @@ -0,0 +1,2 @@ | |||
55 | 1 | usr/include/keeper | ||
56 | 2 | usr/lib/*/pkgconfig/keeper-client.pc | ||
57 | 0 | 3 | ||
58 | === added file 'debian/libkeeper-client.install' | |||
59 | --- debian/libkeeper-client.install 1970-01-01 00:00:00 +0000 | |||
60 | +++ debian/libkeeper-client.install 2016-08-11 00:26:19 +0000 | |||
61 | @@ -0,0 +1,1 @@ | |||
62 | 1 | usr/lib/*/libkeeper-client-*.so | ||
63 | 0 | 2 | ||
64 | === added directory 'include/client' | |||
65 | === added file 'include/client/client.h' | |||
66 | --- include/client/client.h 1970-01-01 00:00:00 +0000 | |||
67 | +++ include/client/client.h 2016-08-11 00:26:19 +0000 | |||
68 | @@ -0,0 +1,48 @@ | |||
69 | 1 | /* | ||
70 | 2 | * Copyright (C) 2016 Canonical, Ltd. | ||
71 | 3 | * | ||
72 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
73 | 5 | * under the terms of the GNU General Public License version 3, as published | ||
74 | 6 | * by the Free Software Foundation. | ||
75 | 7 | * | ||
76 | 8 | * This program is distributed in the hope that it will be useful, but | ||
77 | 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of | ||
78 | 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
79 | 11 | * PURPOSE. See the GNU General Public License for more details. | ||
80 | 12 | * | ||
81 | 13 | * You should have received a copy of the GNU General Public License along | ||
82 | 14 | * with this program. If not, see <http://www.gnu.org/licenses/>. | ||
83 | 15 | * | ||
84 | 16 | * Authors: | ||
85 | 17 | * Marcus Tomlinson <marcus.tomlinson@canonical.com> | ||
86 | 18 | */ | ||
87 | 19 | |||
88 | 20 | #pragma once | ||
89 | 21 | |||
90 | 22 | #define KEEPER_EXPORT __attribute__((visibility("default"))) | ||
91 | 23 | |||
92 | 24 | #include <QObject> | ||
93 | 25 | #include <QScopedPointer> | ||
94 | 26 | #include <QVariant> | ||
95 | 27 | |||
96 | 28 | class KeeperClientPrivate; | ||
97 | 29 | |||
98 | 30 | class KEEPER_EXPORT KeeperClient final : public QObject | ||
99 | 31 | { | ||
100 | 32 | Q_OBJECT | ||
101 | 33 | Q_DISABLE_COPY(KeeperClient) | ||
102 | 34 | |||
103 | 35 | public: | ||
104 | 36 | explicit KeeperClient(QObject* parent = nullptr); | ||
105 | 37 | ~KeeperClient(); | ||
106 | 38 | |||
107 | 39 | QMap<QString, QVariantMap> GetBackupChoices() const; | ||
108 | 40 | void StartBackup(QStringList const& uuids) const; | ||
109 | 41 | |||
110 | 42 | QMap<QString, QVariantMap> GetState() const; | ||
111 | 43 | |||
112 | 44 | Q_SIGNALS: | ||
113 | 45 | |||
114 | 46 | private: | ||
115 | 47 | QScopedPointer<KeeperClientPrivate> const d_ptr; | ||
116 | 48 | }; | ||
117 | 0 | 49 | ||
118 | === modified file 'src/CMakeLists.txt' | |||
119 | --- src/CMakeLists.txt 2016-07-28 13:52:30 +0000 | |||
120 | +++ src/CMakeLists.txt 2016-08-11 00:26:19 +0000 | |||
121 | @@ -4,6 +4,7 @@ | |||
122 | 4 | ) | 4 | ) |
123 | 5 | 5 | ||
124 | 6 | add_subdirectory(cli) | 6 | add_subdirectory(cli) |
125 | 7 | add_subdirectory(client) | ||
126 | 7 | add_subdirectory(helper) | 8 | add_subdirectory(helper) |
127 | 8 | add_subdirectory(qdbus-stubs) | 9 | add_subdirectory(qdbus-stubs) |
128 | 9 | add_subdirectory(service) | 10 | add_subdirectory(service) |
129 | 10 | 11 | ||
130 | === modified file 'src/cli/main.cpp' | |||
131 | --- src/cli/main.cpp 2016-08-10 05:41:26 +0000 | |||
132 | +++ src/cli/main.cpp 2016-08-11 00:26:19 +0000 | |||
133 | @@ -51,7 +51,7 @@ | |||
134 | 51 | qDebug() << QDBusConnection::sessionBus().baseService(); | 51 | qDebug() << QDBusConnection::sessionBus().baseService(); |
135 | 52 | } | 52 | } |
136 | 53 | 53 | ||
138 | 54 | qDebug() << "Argc = " << argc; | 54 | qDebug() << "Argc =" << argc; |
139 | 55 | if (argc == 2 && QString("--use-uuids") == argv[1]) | 55 | if (argc == 2 && QString("--use-uuids") == argv[1]) |
140 | 56 | { | 56 | { |
141 | 57 | QScopedPointer<DBusInterfaceKeeperUser> user_iface(new DBusInterfaceKeeperUser( | 57 | QScopedPointer<DBusInterfaceKeeperUser> user_iface(new DBusInterfaceKeeperUser( |
142 | @@ -62,7 +62,7 @@ | |||
143 | 62 | QDBusReply<QVariantDictMap> choices = user_iface->call("GetBackupChoices"); | 62 | QDBusReply<QVariantDictMap> choices = user_iface->call("GetBackupChoices"); |
144 | 63 | if (!choices.isValid()) | 63 | if (!choices.isValid()) |
145 | 64 | { | 64 | { |
147 | 65 | qWarning() << "Error getting backup choices: " << choices.error().message(); | 65 | qWarning() << "Error getting backup choices:" << choices.error().message(); |
148 | 66 | } | 66 | } |
149 | 67 | 67 | ||
150 | 68 | QStringList uuids; | 68 | QStringList uuids; |
151 | @@ -76,7 +76,7 @@ | |||
152 | 76 | if (iter_values.value().toString() == "folder") | 76 | if (iter_values.value().toString() == "folder") |
153 | 77 | { | 77 | { |
154 | 78 | // got it | 78 | // got it |
156 | 79 | qDebug() << "Adding uuid " << iter.key() << " with type: " << "folder"; | 79 | qDebug() << "Adding uuid" << iter.key() << "with type:" << "folder"; |
157 | 80 | uuids << iter.key(); | 80 | uuids << iter.key(); |
158 | 81 | } | 81 | } |
159 | 82 | } | 82 | } |
160 | @@ -86,7 +86,7 @@ | |||
161 | 86 | 86 | ||
162 | 87 | if (!backup_reply.isValid()) | 87 | if (!backup_reply.isValid()) |
163 | 88 | { | 88 | { |
165 | 89 | qWarning() << "Error starting backup: " << backup_reply.error().message(); | 89 | qWarning() << "Error starting backup:" << backup_reply.error().message(); |
166 | 90 | } | 90 | } |
167 | 91 | } | 91 | } |
168 | 92 | else | 92 | else |
169 | 93 | 93 | ||
170 | === added directory 'src/client' | |||
171 | === added file 'src/client/CMakeLists.txt' | |||
172 | --- src/client/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
173 | +++ src/client/CMakeLists.txt 2016-08-11 00:26:19 +0000 | |||
174 | @@ -0,0 +1,54 @@ | |||
175 | 1 | set( | ||
176 | 2 | CLIENT_LIB | ||
177 | 3 | keeper-client-${KEEPER_MAJOR}.${KEEPER_MINOR} | ||
178 | 4 | ) | ||
179 | 5 | |||
180 | 6 | set( | ||
181 | 7 | CLIENT_HEADERS | ||
182 | 8 | ${CMAKE_SOURCE_DIR}/include/client/client.h | ||
183 | 9 | ) | ||
184 | 10 | |||
185 | 11 | add_library( | ||
186 | 12 | ${CLIENT_LIB} SHARED | ||
187 | 13 | client.cpp | ||
188 | 14 | ${CLIENT_HEADERS} | ||
189 | 15 | ) | ||
190 | 16 | |||
191 | 17 | set_target_properties( | ||
192 | 18 | ${CLIENT_LIB} | ||
193 | 19 | PROPERTIES | ||
194 | 20 | AUTOMOC TRUE | ||
195 | 21 | ) | ||
196 | 22 | |||
197 | 23 | target_link_libraries( | ||
198 | 24 | ${CLIENT_LIB} | ||
199 | 25 | qdbus-stubs | ||
200 | 26 | Qt5::Core | ||
201 | 27 | Qt5::DBus | ||
202 | 28 | ) | ||
203 | 29 | |||
204 | 30 | set( | ||
205 | 31 | COVERAGE_REPORT_TARGETS | ||
206 | 32 | ${COVERAGE_REPORT_TARGETS} | ||
207 | 33 | ${CLIENT_LIB} | ||
208 | 34 | PARENT_SCOPE | ||
209 | 35 | ) | ||
210 | 36 | |||
211 | 37 | install( | ||
212 | 38 | FILES ${CLIENT_HEADERS} | ||
213 | 39 | DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/keeper | ||
214 | 40 | ) | ||
215 | 41 | |||
216 | 42 | install( | ||
217 | 43 | TARGETS ${CLIENT_LIB} | ||
218 | 44 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
219 | 45 | ) | ||
220 | 46 | |||
221 | 47 | configure_file( | ||
222 | 48 | keeper-client.pc.in | ||
223 | 49 | keeper-client.pc | ||
224 | 50 | ) | ||
225 | 51 | install( | ||
226 | 52 | FILES ${CMAKE_CURRENT_BINARY_DIR}/keeper-client.pc | ||
227 | 53 | DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig | ||
228 | 54 | ) | ||
229 | 0 | 55 | ||
230 | === added file 'src/client/client.cpp' | |||
231 | --- src/client/client.cpp 1970-01-01 00:00:00 +0000 | |||
232 | +++ src/client/client.cpp 2016-08-11 00:26:19 +0000 | |||
233 | @@ -0,0 +1,78 @@ | |||
234 | 1 | /* | ||
235 | 2 | * Copyright (C) 2016 Canonical, Ltd. | ||
236 | 3 | * | ||
237 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
238 | 5 | * under the terms of the GNU General Public License version 3, as published | ||
239 | 6 | * by the Free Software Foundation. | ||
240 | 7 | * | ||
241 | 8 | * This program is distributed in the hope that it will be useful, but | ||
242 | 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of | ||
243 | 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
244 | 11 | * PURPOSE. See the GNU General Public License for more details. | ||
245 | 12 | * | ||
246 | 13 | * You should have received a copy of the GNU General Public License along | ||
247 | 14 | * with this program. If not, see <http://www.gnu.org/licenses/>. | ||
248 | 15 | * | ||
249 | 16 | * Authors: | ||
250 | 17 | * Marcus Tomlinson <marcus.tomlinson@canonical.com> | ||
251 | 18 | */ | ||
252 | 19 | |||
253 | 20 | #include <client/client.h> | ||
254 | 21 | |||
255 | 22 | #include <qdbus-stubs/keeper_user_interface.h> | ||
256 | 23 | |||
257 | 24 | class KeeperClientPrivate final | ||
258 | 25 | { | ||
259 | 26 | Q_DISABLE_COPY(KeeperClientPrivate) | ||
260 | 27 | |||
261 | 28 | public: | ||
262 | 29 | KeeperClientPrivate() | ||
263 | 30 | : user_iface(new DBusInterfaceKeeperUser( | ||
264 | 31 | DBusTypes::KEEPER_SERVICE, | ||
265 | 32 | DBusTypes::KEEPER_USER_PATH, | ||
266 | 33 | QDBusConnection::sessionBus() | ||
267 | 34 | )) | ||
268 | 35 | { | ||
269 | 36 | } | ||
270 | 37 | |||
271 | 38 | ~KeeperClientPrivate() = default; | ||
272 | 39 | |||
273 | 40 | QScopedPointer<DBusInterfaceKeeperUser> user_iface; | ||
274 | 41 | }; | ||
275 | 42 | |||
276 | 43 | KeeperClient::KeeperClient(QObject* parent) | ||
277 | 44 | : QObject{parent} | ||
278 | 45 | , d_ptr(new KeeperClientPrivate()) | ||
279 | 46 | { | ||
280 | 47 | DBusTypes::registerMetaTypes(); | ||
281 | 48 | } | ||
282 | 49 | |||
283 | 50 | KeeperClient::~KeeperClient() = default; | ||
284 | 51 | |||
285 | 52 | QMap<QString, QVariantMap> KeeperClient::GetBackupChoices() const | ||
286 | 53 | { | ||
287 | 54 | QDBusReply<QMap<QString, QVariantMap>> choices = d_ptr->user_iface->call("GetBackupChoices"); | ||
288 | 55 | |||
289 | 56 | if (!choices.isValid()) | ||
290 | 57 | { | ||
291 | 58 | qWarning() << "Error getting backup choices:" << choices.error().message(); | ||
292 | 59 | return QMap<QString, QVariantMap>(); | ||
293 | 60 | } | ||
294 | 61 | |||
295 | 62 | return choices.value(); | ||
296 | 63 | } | ||
297 | 64 | |||
298 | 65 | void KeeperClient::StartBackup(const QStringList& uuids) const | ||
299 | 66 | { | ||
300 | 67 | QDBusReply<void> backup_reply = d_ptr->user_iface->call("StartBackup", uuids); | ||
301 | 68 | |||
302 | 69 | if (!backup_reply.isValid()) | ||
303 | 70 | { | ||
304 | 71 | qWarning() << "Error starting backup:" << backup_reply.error().message(); | ||
305 | 72 | } | ||
306 | 73 | } | ||
307 | 74 | |||
308 | 75 | QMap<QString, QVariantMap> KeeperClient::GetState() const | ||
309 | 76 | { | ||
310 | 77 | return d_ptr->user_iface->state(); | ||
311 | 78 | } | ||
312 | 0 | 79 | ||
313 | === added file 'src/client/keeper-client.pc.in' | |||
314 | --- src/client/keeper-client.pc.in 1970-01-01 00:00:00 +0000 | |||
315 | +++ src/client/keeper-client.pc.in 2016-08-11 00:26:19 +0000 | |||
316 | @@ -0,0 +1,6 @@ | |||
317 | 1 | Name: keeper-client | ||
318 | 2 | Description: A Qt client library for Keeper | ||
319 | 3 | Version: @PROJECT_VERSION@ | ||
320 | 4 | Requires.private: Qt5Core Qt5DBus | ||
321 | 5 | Cflags: -I@CMAKE_INSTALL_FULL_INCLUDEDIR@/keeper | ||
322 | 6 | Libs: @CMAKE_INSTALL_FULL_LIBDIR@/libkeeper-client-@KEEPER_MAJOR@.@KEEPER_MINOR@.so | ||
323 | 0 | 7 | ||
324 | === modified file 'src/helper/backup-helper.cpp' | |||
325 | --- src/helper/backup-helper.cpp 2016-08-09 03:58:59 +0000 | |||
326 | +++ src/helper/backup-helper.cpp 2016-08-11 00:26:19 +0000 | |||
327 | @@ -195,7 +195,7 @@ | |||
328 | 195 | else { | 195 | else { |
329 | 196 | if (n < 0) { | 196 | if (n < 0) { |
330 | 197 | write_error_ = true; | 197 | write_error_ = true; |
332 | 198 | qWarning() << "Write error: " << storage_framework_socket_->errorString(); | 198 | qWarning() << "Write error:" << storage_framework_socket_->errorString(); |
333 | 199 | stop(); | 199 | stop(); |
334 | 200 | } | 200 | } |
335 | 201 | break; | 201 | break; |
336 | @@ -263,11 +263,11 @@ | |||
337 | 263 | 263 | ||
338 | 264 | void ual_start(QStringList const& url_strings) | 264 | void ual_start(QStringList const& url_strings) |
339 | 265 | { | 265 | { |
341 | 266 | qDebug() << "Starting helper for app: " << appid_; | 266 | qDebug() << "Starting helper for app:" << appid_; |
342 | 267 | 267 | ||
343 | 268 | std::vector<ubuntu::app_launch::Helper::URL> urls; | 268 | std::vector<ubuntu::app_launch::Helper::URL> urls; |
344 | 269 | for(const auto& url_string : url_strings) { | 269 | for(const auto& url_string : url_strings) { |
346 | 270 | qDebug() << "url " << url_string; | 270 | qDebug() << "url" << url_string; |
347 | 271 | urls.push_back(ubuntu::app_launch::Helper::URL::from_raw(url_string.toStdString())); | 271 | urls.push_back(ubuntu::app_launch::Helper::URL::from_raw(url_string.toStdString())); |
348 | 272 | } | 272 | } |
349 | 273 | 273 | ||
350 | @@ -281,7 +281,7 @@ | |||
351 | 281 | 281 | ||
352 | 282 | void ual_stop() | 282 | void ual_stop() |
353 | 283 | { | 283 | { |
355 | 284 | qDebug() << "Stopping helper for app: " << appid_; | 284 | qDebug() << "Stopping helper for app:" << appid_; |
356 | 285 | auto backupType = ubuntu::app_launch::Helper::Type::from_raw(HELPER_TYPE); | 285 | auto backupType = ubuntu::app_launch::Helper::Type::from_raw(HELPER_TYPE); |
357 | 286 | 286 | ||
358 | 287 | auto appid = ubuntu::app_launch::AppID::parse(appid_.toStdString()); | 287 | auto appid = ubuntu::app_launch::AppID::parse(appid_.toStdString()); |
359 | @@ -298,14 +298,14 @@ | |||
360 | 298 | 298 | ||
361 | 299 | static void on_helper_started(const char* appid, const char* /*instance*/, const char* /*type*/, void* vself) | 299 | static void on_helper_started(const char* appid, const char* /*instance*/, const char* /*type*/, void* vself) |
362 | 300 | { | 300 | { |
364 | 301 | qDebug() << "HELPER STARTED +++++++++++++++++++++++++++++++++++++ " << appid; | 301 | qDebug() << "HELPER STARTED +++++++++++++++++++++++++++++++++++++" << appid; |
365 | 302 | auto self = static_cast<BackupHelperPrivate*>(vself); | 302 | auto self = static_cast<BackupHelperPrivate*>(vself); |
366 | 303 | self->q_ptr->set_state(Helper::State::STARTED); | 303 | self->q_ptr->set_state(Helper::State::STARTED); |
367 | 304 | } | 304 | } |
368 | 305 | 305 | ||
369 | 306 | static void on_helper_stopped(const char* appid, const char* /*instance*/, const char* /*type*/, void* vself) | 306 | static void on_helper_stopped(const char* appid, const char* /*instance*/, const char* /*type*/, void* vself) |
370 | 307 | { | 307 | { |
372 | 308 | qDebug() << "HELPER STOPPED +++++++++++++++++++++++++++++++++++++ " << appid; | 308 | qDebug() << "HELPER STOPPED +++++++++++++++++++++++++++++++++++++" << appid; |
373 | 309 | auto self = static_cast<BackupHelperPrivate*>(vself); | 309 | auto self = static_cast<BackupHelperPrivate*>(vself); |
374 | 310 | self->check_for_done(); | 310 | self->check_for_done(); |
375 | 311 | self->stop_inactivity_timer(); | 311 | self->stop_inactivity_timer(); |
376 | 312 | 312 | ||
377 | === modified file 'src/helper/data-dir-registry.cpp' | |||
378 | --- src/helper/data-dir-registry.cpp 2016-08-09 04:39:25 +0000 | |||
379 | +++ src/helper/data-dir-registry.cpp 2016-08-11 00:26:19 +0000 | |||
380 | @@ -101,9 +101,9 @@ | |||
381 | 101 | } | 101 | } |
382 | 102 | 102 | ||
383 | 103 | for (auto const& url : urls_in) | 103 | for (auto const& url : urls_in) |
385 | 104 | qDebug() << "in: " << url; | 104 | qDebug() << "in:" << url; |
386 | 105 | for (auto const& url : urls) | 105 | for (auto const& url : urls) |
388 | 106 | qDebug() << "out: " << url; | 106 | qDebug() << "out:" << url; |
389 | 107 | 107 | ||
390 | 108 | return urls; | 108 | return urls; |
391 | 109 | } | 109 | } |
392 | 110 | 110 | ||
393 | === modified file 'src/service/backup-choices.cpp' | |||
394 | --- src/service/backup-choices.cpp 2016-08-09 01:07:04 +0000 | |||
395 | +++ src/service/backup-choices.cpp 2016-08-11 00:26:19 +0000 | |||
396 | @@ -79,7 +79,7 @@ | |||
397 | 79 | } | 79 | } |
398 | 80 | if (error != nullptr) | 80 | if (error != nullptr) |
399 | 81 | { | 81 | { |
401 | 82 | qCritical() << "Error getting click manifests: " << error->message; | 82 | qCritical() << "Error getting click manifests:" << error->message; |
402 | 83 | g_clear_error(&error); | 83 | g_clear_error(&error); |
403 | 84 | } | 84 | } |
404 | 85 | 85 | ||
405 | 86 | 86 | ||
406 | === modified file 'src/service/keeper-helper.cpp' | |||
407 | --- src/service/keeper-helper.cpp 2016-07-12 21:18:30 +0000 | |||
408 | +++ src/service/keeper-helper.cpp 2016-08-11 00:26:19 +0000 | |||
409 | @@ -50,5 +50,5 @@ | |||
410 | 50 | 50 | ||
411 | 51 | void KeeperHelper::UpdateStatus(const QString &app_id, const QString &status, double percentage) | 51 | void KeeperHelper::UpdateStatus(const QString &app_id, const QString &status, double percentage) |
412 | 52 | { | 52 | { |
414 | 53 | qDebug() << "KeeperHelper::UpdateStatus( " << app_id << ", " << status << ", " << percentage << ")"; | 53 | qDebug() << "KeeperHelper::UpdateStatus(" << app_id << "," << status << "," << percentage << ")"; |
415 | 54 | } | 54 | } |
416 | 55 | 55 | ||
417 | === modified file 'src/service/keeper.cpp' | |||
418 | --- src/service/keeper.cpp 2016-08-10 07:34:02 +0000 | |||
419 | +++ src/service/keeper.cpp 2016-08-11 00:26:19 +0000 | |||
420 | @@ -81,7 +81,7 @@ | |||
421 | 81 | 81 | ||
422 | 82 | void start_task(QString const &uuid) | 82 | void start_task(QString const &uuid) |
423 | 83 | { | 83 | { |
425 | 84 | qDebug() << "Starting task: " << uuid; | 84 | qDebug() << "Starting task:" << uuid; |
426 | 85 | auto metadata = get_uuid_metadata(cached_backup_choices_, uuid); | 85 | auto metadata = get_uuid_metadata(cached_backup_choices_, uuid); |
427 | 86 | if (metadata.uuid() == uuid) | 86 | if (metadata.uuid() == uuid) |
428 | 87 | { | 87 | { |
429 | @@ -91,7 +91,7 @@ | |||
430 | 91 | if (urls.isEmpty()) | 91 | if (urls.isEmpty()) |
431 | 92 | { | 92 | { |
432 | 93 | // TODO Report error to user | 93 | // TODO Report error to user |
434 | 94 | qWarning() << "ERROR: uuid: " << uuid << " has no url"; | 94 | qWarning() << "ERROR: uuid:" << uuid << "has no url"; |
435 | 95 | return; | 95 | return; |
436 | 96 | } | 96 | } |
437 | 97 | 97 | ||
438 | 98 | 98 | ||
439 | === modified file 'src/storage-framework/storage_framework_client.cpp' | |||
440 | --- src/storage-framework/storage_framework_client.cpp 2016-08-10 06:44:47 +0000 | |||
441 | +++ src/storage-framework/storage_framework_client.cpp 2016-08-11 00:26:19 +0000 | |||
442 | @@ -73,7 +73,7 @@ | |||
443 | 73 | } | 73 | } |
444 | 74 | catch (std::exception & e) | 74 | catch (std::exception & e) |
445 | 75 | { | 75 | { |
447 | 76 | qDebug() << "ERROR: StorageFrameworkClient::getNewFileForBackup(): " << e.what(); | 76 | qDebug() << "ERROR: StorageFrameworkClient::getNewFileForBackup():" << e.what(); |
448 | 77 | } | 77 | } |
449 | 78 | } | 78 | } |
450 | 79 | 79 | ||
451 | @@ -103,14 +103,14 @@ | |||
452 | 103 | } | 103 | } |
453 | 104 | catch (std::exception & e) | 104 | catch (std::exception & e) |
454 | 105 | { | 105 | { |
456 | 106 | qDebug() << "ERROR: StorageFrameworkClient::closeUploader(): " << e.what(); | 106 | qDebug() << "ERROR: StorageFrameworkClient::closeUploader():" << e.what(); |
457 | 107 | } | 107 | } |
458 | 108 | } | 108 | } |
459 | 109 | 109 | ||
460 | 110 | void StorageFrameworkClient::onUploaderClosed() | 110 | void StorageFrameworkClient::onUploaderClosed() |
461 | 111 | { | 111 | { |
462 | 112 | auto file = uploader_closed_watcher_.result(); | 112 | auto file = uploader_closed_watcher_.result(); |
464 | 113 | qDebug() << "Uploader for file " << file->name() << " was closed"; | 113 | qDebug() << "Uploader for file" << file->name() << "was closed"; |
465 | 114 | qDebug() << "Uploader was closed"; | 114 | qDebug() << "Uploader was closed"; |
466 | 115 | uploader_->socket()->disconnectFromServer(); | 115 | uploader_->socket()->disconnectFromServer(); |
467 | 116 | uploader_.reset(); | 116 | uploader_.reset(); |
468 | @@ -133,7 +133,7 @@ | |||
469 | 133 | } | 133 | } |
470 | 134 | try | 134 | try |
471 | 135 | { | 135 | { |
473 | 136 | qDebug() << "Retrieving parents of file " << file->name(); | 136 | qDebug() << "Retrieving parents of file" << file->name(); |
474 | 137 | 137 | ||
475 | 138 | // block here until we get a response | 138 | // block here until we get a response |
476 | 139 | QVector<std::shared_ptr<Folder>> parents = file->parents().result(); | 139 | QVector<std::shared_ptr<Folder>> parents = file->parents().result(); |
477 | @@ -143,7 +143,7 @@ | |||
478 | 143 | 143 | ||
479 | 144 | if (file->name().length() < suffix.length() + 1) | 144 | if (file->name().length() < suffix.length() + 1) |
480 | 145 | { | 145 | { |
482 | 146 | qWarning() << "The file " << file->name() << " has an invalid name, and could not remove the suffix " << TMP_SUFFIX << " from it"; | 146 | qWarning() << "The file" << file->name() << "has an invalid name, and could not remove the suffix" << TMP_SUFFIX << "from it"; |
483 | 147 | return false; | 147 | return false; |
484 | 148 | } | 148 | } |
485 | 149 | newName.remove((file->name().length() - suffix.length()), suffix.length()); | 149 | newName.remove((file->name().length() - suffix.length()), suffix.length()); |
486 | @@ -152,12 +152,12 @@ | |||
487 | 152 | for (const auto& parent : parents) | 152 | for (const auto& parent : parents) |
488 | 153 | { | 153 | { |
489 | 154 | auto item = file->move(parent, newName).result(); | 154 | auto item = file->move(parent, newName).result(); |
491 | 155 | qDebug() << "File name changed to " << item->name(); | 155 | qDebug() << "File name changed to" << item->name(); |
492 | 156 | } | 156 | } |
493 | 157 | } | 157 | } |
494 | 158 | catch (std::exception & e) | 158 | catch (std::exception & e) |
495 | 159 | { | 159 | { |
497 | 160 | qDebug() << "ERROR: StorageFrameworkClient::removeTmpSuffix(): " << e.what(); | 160 | qDebug() << "ERROR: StorageFrameworkClient::removeTmpSuffix():" << e.what(); |
498 | 161 | return false; | 161 | return false; |
499 | 162 | } | 162 | } |
500 | 163 | return true; | 163 | return true; |
501 | @@ -172,7 +172,7 @@ | |||
502 | 172 | } | 172 | } |
503 | 173 | catch (std::exception & e) | 173 | catch (std::exception & e) |
504 | 174 | { | 174 | { |
506 | 175 | qDebug() << "ERROR: StorageFrameworkClient::deleteFile(): " << e.what(); | 175 | qDebug() << "ERROR: StorageFrameworkClient::deleteFile():" << e.what(); |
507 | 176 | return false; | 176 | return false; |
508 | 177 | } | 177 | } |
509 | 178 | return true; | 178 | return true; |
510 | 179 | 179 | ||
511 | === modified file 'src/tar/main.cpp' | |||
512 | --- src/tar/main.cpp 2016-08-03 18:58:01 +0000 | |||
513 | +++ src/tar/main.cpp 2016-08-11 00:26:19 +0000 | |||
514 | @@ -107,14 +107,14 @@ | |||
515 | 107 | 107 | ||
516 | 108 | // gotta have the bus path | 108 | // gotta have the bus path |
517 | 109 | if (bus_path.isEmpty()) { | 109 | if (bus_path.isEmpty()) { |
519 | 110 | std::cerr << "Missing required argument: --bus-path " << std::endl; | 110 | std::cerr << "Missing required argument: --bus-path" << std::endl; |
520 | 111 | parser.showHelp(EXIT_FAILURE); | 111 | parser.showHelp(EXIT_FAILURE); |
521 | 112 | } | 112 | } |
522 | 113 | 113 | ||
523 | 114 | // gotta have files | 114 | // gotta have files |
524 | 115 | const auto filenames = get_filenames_from_file(stdin); | 115 | const auto filenames = get_filenames_from_file(stdin); |
525 | 116 | for (const auto& filename : filenames) | 116 | for (const auto& filename : filenames) |
527 | 117 | qDebug() << "filename: " << filename; | 117 | qDebug() << "filename:" << filename; |
528 | 118 | if (filenames.empty()) { | 118 | if (filenames.empty()) { |
529 | 119 | std::cerr << "no files listed" << std::endl; | 119 | std::cerr << "no files listed" << std::endl; |
530 | 120 | parser.showHelp(EXIT_FAILURE); | 120 | parser.showHelp(EXIT_FAILURE); |
531 | 121 | 121 | ||
532 | === modified file 'tests/fakes/fake-backup-helper.cpp' | |||
533 | --- tests/fakes/fake-backup-helper.cpp 2016-08-05 14:10:32 +0000 | |||
534 | +++ tests/fakes/fake-backup-helper.cpp 2016-08-11 00:26:19 +0000 | |||
535 | @@ -51,7 +51,7 @@ | |||
536 | 51 | const auto object_path = QString::fromUtf8(DBusTypes::KEEPER_HELPER_PATH); | 51 | const auto object_path = QString::fromUtf8(DBusTypes::KEEPER_HELPER_PATH); |
537 | 52 | DBusInterfaceKeeperHelper helper_iface (DBusTypes::KEEPER_SERVICE, object_path, conn); | 52 | DBusInterfaceKeeperHelper helper_iface (DBusTypes::KEEPER_SERVICE, object_path, conn); |
538 | 53 | 53 | ||
540 | 54 | qDebug() << "Is valid: " << helper_iface.isValid(); | 54 | qDebug() << "Is valid:" << helper_iface.isValid(); |
541 | 55 | 55 | ||
542 | 56 | auto blob_size = blob.size(); | 56 | auto blob_size = blob.size(); |
543 | 57 | #ifdef COMPILE_WITH_FAILURE | 57 | #ifdef COMPILE_WITH_FAILURE |
544 | 58 | 58 | ||
545 | === modified file 'tests/integration/helpers/helpers-test-failure.cpp' | |||
546 | --- tests/integration/helpers/helpers-test-failure.cpp 2016-08-09 03:58:59 +0000 | |||
547 | +++ tests/integration/helpers/helpers-test-failure.cpp 2016-08-11 00:26:19 +0000 | |||
548 | @@ -55,7 +55,7 @@ | |||
549 | 55 | 55 | ||
550 | 56 | auto user_dir = qgetenv(user_option.toLatin1().data()); | 56 | auto user_dir = qgetenv(user_option.toLatin1().data()); |
551 | 57 | ASSERT_FALSE(user_dir.isEmpty()); | 57 | ASSERT_FALSE(user_dir.isEmpty()); |
553 | 58 | qDebug() << "USER DIR: " << user_dir; | 58 | qDebug() << "USER DIR:" << user_dir; |
554 | 59 | 59 | ||
555 | 60 | // fill something in the music dir | 60 | // fill something in the music dir |
556 | 61 | ASSERT_TRUE(FileUtils::fillTemporaryDirectory(user_dir, qrand() % 1000)); | 61 | ASSERT_TRUE(FileUtils::fillTemporaryDirectory(user_dir, qrand() % 1000)); |
557 | @@ -63,7 +63,7 @@ | |||
558 | 63 | // search for the user folder uuid | 63 | // search for the user folder uuid |
559 | 64 | auto user_folder_uuid = getUUIDforXdgFolderPath(user_dir, choices.value()); | 64 | auto user_folder_uuid = getUUIDforXdgFolderPath(user_dir, choices.value()); |
560 | 65 | ASSERT_FALSE(user_folder_uuid.isEmpty()); | 65 | ASSERT_FALSE(user_folder_uuid.isEmpty()); |
562 | 66 | qDebug() << "User folder UUID is: " << user_folder_uuid; | 66 | qDebug() << "User folder UUID is:" << user_folder_uuid; |
563 | 67 | 67 | ||
564 | 68 | // Now we know the music folder uuid, let's start the backup for it. | 68 | // Now we know the music folder uuid, let's start the backup for it. |
565 | 69 | QDBusReply<void> backup_reply = user_iface->call("StartBackup", QStringList{user_folder_uuid}); | 69 | QDBusReply<void> backup_reply = user_iface->call("StartBackup", QStringList{user_folder_uuid}); |
566 | 70 | 70 | ||
567 | === modified file 'tests/integration/helpers/helpers-test.cc' | |||
568 | --- tests/integration/helpers/helpers-test.cc 2016-08-09 03:58:59 +0000 | |||
569 | +++ tests/integration/helpers/helpers-test.cc 2016-08-11 00:26:19 +0000 | |||
570 | @@ -240,7 +240,7 @@ | |||
571 | 240 | 240 | ||
572 | 241 | auto user_dir = qgetenv(user_option.toLatin1().data()); | 241 | auto user_dir = qgetenv(user_option.toLatin1().data()); |
573 | 242 | ASSERT_FALSE(user_dir.isEmpty()); | 242 | ASSERT_FALSE(user_dir.isEmpty()); |
575 | 243 | qDebug() << "USER DIR: " << user_dir; | 243 | qDebug() << "USER DIR:" << user_dir; |
576 | 244 | 244 | ||
577 | 245 | // fill something in the music dir | 245 | // fill something in the music dir |
578 | 246 | ASSERT_TRUE(FileUtils::fillTemporaryDirectory(user_dir, qrand() % 1000)); | 246 | ASSERT_TRUE(FileUtils::fillTemporaryDirectory(user_dir, qrand() % 1000)); |
579 | @@ -248,13 +248,13 @@ | |||
580 | 248 | // search for the user folder uuid | 248 | // search for the user folder uuid |
581 | 249 | auto user_folder_uuid = getUUIDforXdgFolderPath(user_dir, choices.value()); | 249 | auto user_folder_uuid = getUUIDforXdgFolderPath(user_dir, choices.value()); |
582 | 250 | ASSERT_FALSE(user_folder_uuid.isEmpty()); | 250 | ASSERT_FALSE(user_folder_uuid.isEmpty()); |
584 | 251 | qDebug() << "User folder UUID is: " << user_folder_uuid; | 251 | qDebug() << "User folder UUID is:" << user_folder_uuid; |
585 | 252 | 252 | ||
586 | 253 | QString user_option_2 = "XDG_VIDEOS_DIR"; | 253 | QString user_option_2 = "XDG_VIDEOS_DIR"; |
587 | 254 | 254 | ||
588 | 255 | auto user_dir_2 = qgetenv(user_option_2.toLatin1().data()); | 255 | auto user_dir_2 = qgetenv(user_option_2.toLatin1().data()); |
589 | 256 | ASSERT_FALSE(user_dir_2.isEmpty()); | 256 | ASSERT_FALSE(user_dir_2.isEmpty()); |
591 | 257 | qDebug() << "USER DIR 2: " << user_dir_2; | 257 | qDebug() << "USER DIR 2:" << user_dir_2; |
592 | 258 | 258 | ||
593 | 259 | // fill something in the music dir | 259 | // fill something in the music dir |
594 | 260 | ASSERT_TRUE(FileUtils::fillTemporaryDirectory(user_dir_2, qrand() % 1000)); | 260 | ASSERT_TRUE(FileUtils::fillTemporaryDirectory(user_dir_2, qrand() % 1000)); |
595 | @@ -262,7 +262,7 @@ | |||
596 | 262 | // search for the user folder uuid | 262 | // search for the user folder uuid |
597 | 263 | auto user_folder_uuid_2 = getUUIDforXdgFolderPath(user_dir_2, choices.value()); | 263 | auto user_folder_uuid_2 = getUUIDforXdgFolderPath(user_dir_2, choices.value()); |
598 | 264 | ASSERT_FALSE(user_folder_uuid_2.isEmpty()); | 264 | ASSERT_FALSE(user_folder_uuid_2.isEmpty()); |
600 | 265 | qDebug() << "User folder 2 UUID is: " << user_folder_uuid_2; | 265 | qDebug() << "User folder 2 UUID is:" << user_folder_uuid_2; |
601 | 266 | 266 | ||
602 | 267 | // Now we know the music folder uuid, let's start the backup for it. | 267 | // Now we know the music folder uuid, let's start the backup for it. |
603 | 268 | QDBusReply<void> backup_reply = user_iface->call("StartBackup", QStringList{user_folder_uuid, user_folder_uuid_2}); | 268 | QDBusReply<void> backup_reply = user_iface->call("StartBackup", QStringList{user_folder_uuid, user_folder_uuid_2}); |
604 | 269 | 269 | ||
605 | === modified file 'tests/integration/helpers/test-helpers-base.cpp' | |||
606 | --- tests/integration/helpers/test-helpers-base.cpp 2016-08-10 07:44:55 +0000 | |||
607 | +++ tests/integration/helpers/test-helpers-base.cpp 2016-08-11 00:26:19 +0000 | |||
608 | @@ -88,7 +88,7 @@ | |||
609 | 88 | g_setenv("XDG_CACHE_HOME", CMAKE_SOURCE_DIR "/libertine-data", TRUE); | 88 | g_setenv("XDG_CACHE_HOME", CMAKE_SOURCE_DIR "/libertine-data", TRUE); |
610 | 89 | g_setenv("XDG_DATA_HOME", xdg_data_home_dir.path().toLatin1().data(), TRUE); | 89 | g_setenv("XDG_DATA_HOME", xdg_data_home_dir.path().toLatin1().data(), TRUE); |
611 | 90 | 90 | ||
613 | 91 | qDebug() << "XDG_DATA_HOME ON SETUP is: " << xdg_data_home_dir.path(); | 91 | qDebug() << "XDG_DATA_HOME ON SETUP is:" << xdg_data_home_dir.path(); |
614 | 92 | 92 | ||
615 | 93 | service = dbus_test_service_new(NULL); | 93 | service = dbus_test_service_new(NULL); |
616 | 94 | 94 | ||
617 | @@ -308,22 +308,22 @@ | |||
618 | 308 | { | 308 | { |
619 | 309 | QTemporaryDir tempDir; | 309 | QTemporaryDir tempDir; |
620 | 310 | 310 | ||
622 | 311 | qDebug() << "Comparing tar content for dir: " << sourceDir << " with tar: " << tarPath; | 311 | qDebug() << "Comparing tar content for dir:" << sourceDir << "with tar:" << tarPath; |
623 | 312 | 312 | ||
624 | 313 | QFileInfo checkFile(tarPath); | 313 | QFileInfo checkFile(tarPath); |
625 | 314 | if (!checkFile.exists()) | 314 | if (!checkFile.exists()) |
626 | 315 | { | 315 | { |
628 | 316 | qWarning() << "File: " << tarPath << " does not exist"; | 316 | qWarning() << "File:" << tarPath << "does not exist"; |
629 | 317 | return false; | 317 | return false; |
630 | 318 | } | 318 | } |
631 | 319 | if (!checkFile.isFile()) | 319 | if (!checkFile.isFile()) |
632 | 320 | { | 320 | { |
634 | 321 | qWarning() << "Item: " << tarPath << " is not a file"; | 321 | qWarning() << "Item:" << tarPath << "is not a file"; |
635 | 322 | return false; | 322 | return false; |
636 | 323 | } | 323 | } |
637 | 324 | if (!tempDir.isValid()) | 324 | if (!tempDir.isValid()) |
638 | 325 | { | 325 | { |
640 | 326 | qWarning() << "Temporary directory: " << tempDir.path() << " is not valid"; | 326 | qWarning() << "Temporary directory:" << tempDir.path() << "is not valid"; |
641 | 327 | return false; | 327 | return false; |
642 | 328 | } | 328 | } |
643 | 329 | 329 | ||
644 | @@ -413,7 +413,7 @@ | |||
645 | 413 | QFile storage_framework_file(lastFile); | 413 | QFile storage_framework_file(lastFile); |
646 | 414 | if(!storage_framework_file.open(QFile::ReadOnly)) | 414 | if(!storage_framework_file.open(QFile::ReadOnly)) |
647 | 415 | { | 415 | { |
649 | 416 | qWarning() << "ERROR: opening file: " << lastFile; | 416 | qWarning() << "ERROR: opening file:" << lastFile; |
650 | 417 | return false; | 417 | return false; |
651 | 418 | } | 418 | } |
652 | 419 | 419 | ||
653 | @@ -451,7 +451,7 @@ | |||
654 | 451 | { | 451 | { |
655 | 452 | helper_mark.remove(); | 452 | helper_mark.remove(); |
656 | 453 | timer.restart(); | 453 | timer.restart(); |
658 | 454 | qDebug() << "HELPER FINISHED, WAITING FOR " << times_to_wait << " MORE"; | 454 | qDebug() << "HELPER FINISHED, WAITING FOR" << times_to_wait << "MORE"; |
659 | 455 | } | 455 | } |
660 | 456 | else | 456 | else |
661 | 457 | { | 457 | { |
662 | 458 | 458 | ||
663 | === modified file 'tests/unit/tar/tar-creator-libarchive-failure-test.cpp' | |||
664 | --- tests/unit/tar/tar-creator-libarchive-failure-test.cpp 2016-08-04 18:28:25 +0000 | |||
665 | +++ tests/unit/tar/tar-creator-libarchive-failure-test.cpp 2016-08-11 00:26:19 +0000 | |||
666 | @@ -179,5 +179,5 @@ | |||
667 | 179 | 179 | ||
668 | 180 | EXPECT_TRUE(error_string.contains(QString::fromUtf8(FATAL_ERROR_MESSAGE))) | 180 | EXPECT_TRUE(error_string.contains(QString::fromUtf8(FATAL_ERROR_MESSAGE))) |
669 | 181 | << "expected: '" << FATAL_ERROR_MESSAGE << "'" << std::endl | 181 | << "expected: '" << FATAL_ERROR_MESSAGE << "'" << std::endl |
671 | 182 | << " got: '" << qPrintable(error_string) << "'" << std::endl; | 182 | << "got: '" << qPrintable(error_string) << "'" << std::endl; |
672 | 183 | } | 183 | } |
673 | 184 | 184 | ||
674 | === modified file 'tests/utils/file-utils.cpp' | |||
675 | --- tests/utils/file-utils.cpp 2016-07-29 14:20:23 +0000 | |||
676 | +++ tests/utils/file-utils.cpp 2016-08-11 00:26:19 +0000 | |||
677 | @@ -49,7 +49,7 @@ | |||
678 | 49 | f.setAutoRemove(false); | 49 | f.setAutoRemove(false); |
679 | 50 | if(!f.open()) | 50 | if(!f.open()) |
680 | 51 | { | 51 | { |
682 | 52 | qWarning() << "Error opening temporary file: " << f.errorString(); | 52 | qWarning() << "Error opening temporary file:" << f.errorString(); |
683 | 53 | return info; | 53 | return info; |
684 | 54 | } | 54 | } |
685 | 55 | static constexpr qint64 max_step = 1024; | 55 | static constexpr qint64 max_step = 1024; |
686 | @@ -62,7 +62,7 @@ | |||
687 | 62 | buf[i] = 'a' + char(qrand() % ('z'-'a')); | 62 | buf[i] = 'a' + char(qrand() % ('z'-'a')); |
688 | 63 | if (f.write(buf, this_step) < this_step) | 63 | if (f.write(buf, this_step) < this_step) |
689 | 64 | { | 64 | { |
691 | 65 | qWarning() << "Error writing to temporary file: " << f.errorString(); | 65 | qWarning() << "Error writing to temporary file:" << f.errorString(); |
692 | 66 | } | 66 | } |
693 | 67 | left -= this_step; | 67 | left -= this_step; |
694 | 68 | } | 68 | } |
695 | @@ -71,7 +71,7 @@ | |||
696 | 71 | // get a checksum | 71 | // get a checksum |
697 | 72 | if(!f.open()) | 72 | if(!f.open()) |
698 | 73 | { | 73 | { |
700 | 74 | qWarning() << "Error opening temporary file: " << f.errorString(); | 74 | qWarning() << "Error opening temporary file:" << f.errorString(); |
701 | 75 | return info; | 75 | return info; |
702 | 76 | } | 76 | } |
703 | 77 | QCryptographicHash hash(QCryptographicHash::Sha1); | 77 | QCryptographicHash hash(QCryptographicHash::Sha1); |
704 | @@ -104,7 +104,7 @@ | |||
705 | 104 | auto newDirName = QString("Directory_%1").arg(j); | 104 | auto newDirName = QString("Directory_%1").arg(j); |
706 | 105 | if (!dir.mkdir(newDirName)) | 105 | if (!dir.mkdir(newDirName)) |
707 | 106 | { | 106 | { |
709 | 107 | qWarning() << "Error creating temporary directory " << newDirName << " under " << dirPath; | 107 | qWarning() << "Error creating temporary directory" << newDirName << "under" << dirPath; |
710 | 108 | return false; | 108 | return false; |
711 | 109 | } | 109 | } |
712 | 110 | 110 | ||
713 | @@ -191,19 +191,19 @@ | |||
714 | 191 | QFileInfo info2(filePath2); | 191 | QFileInfo info2(filePath2); |
715 | 192 | if (!info1.isFile()) | 192 | if (!info1.isFile()) |
716 | 193 | { | 193 | { |
718 | 194 | qWarning() << "Origin file: " << info1.absoluteFilePath() << " does not exist"; | 194 | qWarning() << "Origin file:" << info1.absoluteFilePath() << "does not exist"; |
719 | 195 | return false; | 195 | return false; |
720 | 196 | } | 196 | } |
721 | 197 | if (!info2.isFile()) | 197 | if (!info2.isFile()) |
722 | 198 | { | 198 | { |
724 | 199 | qWarning() << "File to compare: " << info2.absoluteFilePath() << " does not exist"; | 199 | qWarning() << "File to compare:" << info2.absoluteFilePath() << "does not exist"; |
725 | 200 | return false; | 200 | return false; |
726 | 201 | } | 201 | } |
727 | 202 | auto checksum1 = fileChecksum(filePath1, QCryptographicHash::Md5); | 202 | auto checksum1 = fileChecksum(filePath1, QCryptographicHash::Md5); |
728 | 203 | auto checksum2 = fileChecksum(filePath1, QCryptographicHash::Md5); | 203 | auto checksum2 = fileChecksum(filePath1, QCryptographicHash::Md5); |
729 | 204 | if (checksum1 != checksum2) | 204 | if (checksum1 != checksum2) |
730 | 205 | { | 205 | { |
732 | 206 | qWarning() << "Checksum for file: " << filePath1 << " differ"; | 206 | qWarning() << "Checksum for file:" << filePath1 << "differ"; |
733 | 207 | } | 207 | } |
734 | 208 | return checksum1 == checksum2; | 208 | return checksum1 == checksum2; |
735 | 209 | } | 209 | } |
LGTM