diff --git a/plasmoid/lib/syncthingapplet.cpp b/plasmoid/lib/syncthingapplet.cpp index 4ebee5f..6deb953 100644 --- a/plasmoid/lib/syncthingapplet.cpp +++ b/plasmoid/lib/syncthingapplet.cpp @@ -4,6 +4,8 @@ #include #include +#include + #include #include #include @@ -12,10 +14,9 @@ #include #include #include - -#include - -#include +#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0) +#include +#endif #include "resources/config.h" #include "resources/qtconfig.h" @@ -366,6 +367,12 @@ void SyncthingApplet::showSettingsDlg() { if (!m_settingsDlg) { m_settingsDlg = new SettingsDialog(*this); + // create a launcher as its monitoring of whether the network is metered is required by the connection settings +#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0) + if (!SyncthingLauncher::mainInstance()) { + SyncthingLauncher::setMainInstance(new SyncthingLauncher(m_settingsDlg)); + } +#endif // show wizard when requested connect(m_settingsDlg, &SettingsDialog::wizardRequested, this, &SyncthingApplet::showWizard); // ensure settings take effect when applied