diff --git a/connector/tests/misctests.cpp b/connector/tests/misctests.cpp index f1b935c..c212f80 100644 --- a/connector/tests/misctests.cpp +++ b/connector/tests/misctests.cpp @@ -32,7 +32,9 @@ class MiscTests : public TestFixture { CPPUNIT_TEST(testParsingConfig); CPPUNIT_TEST(testSplittingArguments); CPPUNIT_TEST(testUtils); +#ifdef LIB_SYNCTHING_CONNECTOR_SUPPORT_SYSTEMD CPPUNIT_TEST(testService); +#endif CPPUNIT_TEST(testConnectionSettingsAndLoadingSelfSignedCert); CPPUNIT_TEST(testSyncthingDir); CPPUNIT_TEST_SUITE_END(); @@ -43,7 +45,9 @@ public: void testParsingConfig(); void testSplittingArguments(); void testUtils(); +#ifdef LIB_SYNCTHING_CONNECTOR_SUPPORT_SYSTEMD void testService(); +#endif void testConnectionSettingsAndLoadingSelfSignedCert(); void testSyncthingDir(); @@ -137,6 +141,7 @@ void MiscTests::testUtils() CPPUNIT_ASSERT(!isLocal(QUrl(QStringLiteral("http://157.3.52.34")))); } +#ifdef LIB_SYNCTHING_CONNECTOR_SUPPORT_SYSTEMD /*! * \brief Tests SyncthingService class, but error case with non-existant service so far. */ @@ -152,6 +157,7 @@ void MiscTests::testService() service.toggleRunning(); service.setEnabled(true); } +#endif void MiscTests::testConnectionSettingsAndLoadingSelfSignedCert() { diff --git a/plasmoid/lib/syncthingapplet.cpp b/plasmoid/lib/syncthingapplet.cpp index f3d92eb..4a73b7d 100644 --- a/plasmoid/lib/syncthingapplet.cpp +++ b/plasmoid/lib/syncthingapplet.cpp @@ -62,7 +62,9 @@ SyncthingApplet::SyncthingApplet(QObject *parent, const QVariantList &data) , m_currentConnectionConfig(-1) , m_initialized(false) { +#ifdef LIB_SYNCTHING_CONNECTOR_SUPPORT_SYSTEMD m_notifier.setService(&m_service); +#endif qmlRegisterUncreatableMetaObject(Data::staticMetaObject, "martchus.syncthingplasmoid", 0, 6, "Data", QStringLiteral("only enums")); } @@ -221,7 +223,11 @@ void SyncthingApplet::setCurrentConnectionConfigIndex(int index) bool SyncthingApplet::isStartStopEnabled() const { +#ifdef LIB_SYNCTHING_CONNECTOR_SUPPORT_SYSTEMD return Settings::values().systemd.showButton; +#else + return false; +#endif } bool SyncthingApplet::areNotificationsAvailable() const diff --git a/tray/gui/traywidget.cpp b/tray/gui/traywidget.cpp index 2a41e99..6cf5eca 100644 --- a/tray/gui/traywidget.cpp +++ b/tray/gui/traywidget.cpp @@ -578,7 +578,7 @@ Settings::Launcher::LauncherStatus TrayWidget::handleLauncherStatusChanged() const auto launcherStatus = applyLauncherSettings(false, systemdStatus.relevant, systemdStatus.showStartStopButton); const auto showStartStopButton = systemdStatus.showStartStopButton || launcherStatus.showStartStopButton; #else - const auto launcherStatus = applyLauncherSettings(reconnectRequired); + const auto launcherStatus = applyLauncherSettings(false); const auto showStartStopButton = launcherStatus.showStartStopButton; #endif m_ui->startStopPushButton->setVisible(showStartStopButton); diff --git a/widgets/settings/settings.cpp b/widgets/settings/settings.cpp index 2780be3..dc7bf4b 100644 --- a/widgets/settings/settings.cpp +++ b/widgets/settings/settings.cpp @@ -5,8 +5,8 @@ #include "../../connector/syncthingnotifier.h" #include "../../connector/syncthingprocess.h" -#ifdef LIB_SYNCTHING_CONNECTOR_SUPPORT_SYSTEMD #include "../../connector/syncthingconnection.h" +#ifdef LIB_SYNCTHING_CONNECTOR_SUPPORT_SYSTEMD #include "../../connector/syncthingservice.h" #endif