From 7edaacc6772747a47b65c7063f0681cfc9e952ab Mon Sep 17 00:00:00 2001 From: Martchus Date: Sat, 18 Jan 2020 16:42:43 +0100 Subject: [PATCH] Apply clang-format --- connector/syncthingservice.cpp | 10 ++++------ connector/syncthingservice.h | 3 +-- connector/tests/connectiontests.cpp | 6 +++--- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/connector/syncthingservice.cpp b/connector/syncthingservice.cpp index 3abf0bc..5d22266 100644 --- a/connector/syncthingservice.cpp +++ b/connector/syncthingservice.cpp @@ -117,15 +117,14 @@ void SyncthingService::setupSystemdInterface() // ensure the static systemd interface for the current scope is initialized const auto isUserScope = m_scope == SystemdScope::User; - OrgFreedesktopSystemd1ManagerInterface *&staticSystemdInterface - = isUserScope ? s_systemdUserInterface : s_systemdSystemInterface; + OrgFreedesktopSystemd1ManagerInterface *&staticSystemdInterface = isUserScope ? s_systemdUserInterface : s_systemdSystemInterface; if (!staticSystemdInterface) { // register custom data types qDBusRegisterMetaType(); qDBusRegisterMetaType(); - staticSystemdInterface = new OrgFreedesktopSystemd1ManagerInterface( - QStringLiteral("org.freedesktop.systemd1"), QStringLiteral("/org/freedesktop/systemd1"), isUserScope ? QDBusConnection::sessionBus() : QDBusConnection::systemBus()); + staticSystemdInterface = new OrgFreedesktopSystemd1ManagerInterface(QStringLiteral("org.freedesktop.systemd1"), + QStringLiteral("/org/freedesktop/systemd1"), isUserScope ? QDBusConnection::sessionBus() : QDBusConnection::systemBus()); // enable systemd to emit signals staticSystemdInterface->Subscribe(); @@ -160,8 +159,7 @@ void SyncthingService::setupFreedesktopLoginInterface() /*! * \brief Registers the specified D-Bus \a call to invoke \a handler when it has been concluded. */ -template -void SyncthingService::makeAsyncCall(const QDBusPendingCall &call, HandlerType &&handler) +template void SyncthingService::makeAsyncCall(const QDBusPendingCall &call, HandlerType &&handler) { if (m_currentSystemdInterface) { // disconnect from unit add/removed signals because these seem to be spammed when waiting for permissions diff --git a/connector/syncthingservice.h b/connector/syncthingservice.h index 5b42e40..e846e53 100644 --- a/connector/syncthingservice.h +++ b/connector/syncthingservice.h @@ -114,8 +114,7 @@ private Q_SLOTS: private: void setupSystemdInterface(); void setupFreedesktopLoginInterface(); - template - void makeAsyncCall(const QDBusPendingCall &call, HandlerType &&handler); + template void makeAsyncCall(const QDBusPendingCall &call, HandlerType &&handler); void registerErrorHandler(const QDBusPendingCall &call, const char *context); bool concludeAsyncCall(QDBusPendingCallWatcher *watcher); void clearSystemdInterface(); diff --git a/connector/tests/connectiontests.cpp b/connector/tests/connectiontests.cpp index 0dfd915..d74b66e 100644 --- a/connector/tests/connectiontests.cpp +++ b/connector/tests/connectiontests.cpp @@ -488,7 +488,8 @@ void ConnectionTests::checkDirectories() const const auto devNames = QSet(dir1.deviceNames.begin(), dir1.deviceNames.end()); #endif CPPUNIT_ASSERT_EQUAL(QSet({ QStringLiteral("MMGUI6U-WUEZQCP-XZZ6VYB-LCT4TVC-ER2HAVX-QYT6X7D-S6ZSG2B-323KLQ7"), - QStringLiteral("6EIS2PN-J2IHWGS-AXS3YUL-HC5FT3K-77ZXTLL-AKQLJ4C-7SWVPUS-AZW4RQ4") }), devIds); + QStringLiteral("6EIS2PN-J2IHWGS-AXS3YUL-HC5FT3K-77ZXTLL-AKQLJ4C-7SWVPUS-AZW4RQ4") }), + devIds); CPPUNIT_ASSERT_EQUAL(QSet({ QStringLiteral("Test dev 2"), QStringLiteral("Test dev 1") }), devNames); const SyncthingDir &dir2 = dirInfo.back(); CPPUNIT_ASSERT_EQUAL(QStringLiteral("test2"), dir2.id); @@ -506,8 +507,7 @@ void ConnectionTests::checkDirectories() const const auto devIds2 = QSet(dir2.deviceIds.begin(), dir2.deviceIds.end()); const auto devNames2 = QSet(dir2.deviceNames.begin(), dir2.deviceNames.end()); #endif - CPPUNIT_ASSERT_EQUAL( - QSet({ QStringLiteral("MMGUI6U-WUEZQCP-XZZ6VYB-LCT4TVC-ER2HAVX-QYT6X7D-S6ZSG2B-323KLQ7") }), devIds2); + CPPUNIT_ASSERT_EQUAL(QSet({ QStringLiteral("MMGUI6U-WUEZQCP-XZZ6VYB-LCT4TVC-ER2HAVX-QYT6X7D-S6ZSG2B-323KLQ7") }), devIds2); CPPUNIT_ASSERT_EQUAL(QSet({ QStringLiteral("Test dev 2") }), devNames2); }