Merge lp:~marcustomlinson/keeper/client-lib into lp:keeper

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
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve
Review via email: mp+302386@code.launchpad.net

Commit message

Add keeper-client lib

To post a comment you must log in.
85. By Marcus Tomlinson

Missing QVariant include

Revision history for this message
Charles Kerr (charlesk) wrote :

LGTM

review: Approve

Preview Diff

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

Subscribers

People subscribed via source and target branches

to all changes: