Apply clang-format

This commit is contained in:
Martchus 2020-01-18 16:42:43 +01:00
parent 10fd09901b
commit 7edaacc677
3 changed files with 8 additions and 11 deletions

View File

@ -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<ManagerDBusUnitFileChange>();
qDBusRegisterMetaType<ManagerDBusUnitFileChangeList>();
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<typename HandlerType>
void SyncthingService::makeAsyncCall(const QDBusPendingCall &call, HandlerType &&handler)
template <typename HandlerType> 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

View File

@ -114,8 +114,7 @@ private Q_SLOTS:
private:
void setupSystemdInterface();
void setupFreedesktopLoginInterface();
template<typename HandlerType>
void makeAsyncCall(const QDBusPendingCall &call, HandlerType &&handler);
template <typename HandlerType> void makeAsyncCall(const QDBusPendingCall &call, HandlerType &&handler);
void registerErrorHandler(const QDBusPendingCall &call, const char *context);
bool concludeAsyncCall(QDBusPendingCallWatcher *watcher);
void clearSystemdInterface();

View File

@ -488,7 +488,8 @@ void ConnectionTests::checkDirectories() const
const auto devNames = QSet(dir1.deviceNames.begin(), dir1.deviceNames.end());
#endif
CPPUNIT_ASSERT_EQUAL(QSet<QString>({ 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<QString>({ 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<QString>({ QStringLiteral("MMGUI6U-WUEZQCP-XZZ6VYB-LCT4TVC-ER2HAVX-QYT6X7D-S6ZSG2B-323KLQ7") }), devIds2);
CPPUNIT_ASSERT_EQUAL(QSet<QString>({ QStringLiteral("MMGUI6U-WUEZQCP-XZZ6VYB-LCT4TVC-ER2HAVX-QYT6X7D-S6ZSG2B-323KLQ7") }), devIds2);
CPPUNIT_ASSERT_EQUAL(QSet<QString>({ QStringLiteral("Test dev 2") }), devNames2);
}