diff --git a/widgets/settings/settingsdialog.cpp b/widgets/settings/settingsdialog.cpp index 6e4cbb5..600b30f 100644 --- a/widgets/settings/settingsdialog.cpp +++ b/widgets/settings/settingsdialog.cpp @@ -750,9 +750,6 @@ LauncherOptionPage::LauncherOptionPage(const QString &tool, QWidget *parentWidge LauncherOptionPage::~LauncherOptionPage() { - for (const QMetaObject::Connection &connection : m_connections) { - QObject::disconnect(connection); - } } QWidget *LauncherOptionPage::setupWidget() @@ -776,7 +773,7 @@ QWidget *LauncherOptionPage::setupWidget() m_restoreArgsButton->setPixmap( QIcon::fromTheme(QStringLiteral("edit-undo"), QIcon(QStringLiteral(":/icons/hicolor/scalable/actions/edit-paste.svg"))).pixmap(16)); m_restoreArgsButton->setToolTip(QCoreApplication::translate("QtGui::LauncherOptionPage", "Restore default")); - QObject::connect(m_restoreArgsButton, &IconButton::clicked, this, &LauncherOptionPage::restoreDefaultArguments); + connect(m_restoreArgsButton, &IconButton::clicked, this, &LauncherOptionPage::restoreDefaultArguments); ui()->argumentsLineEdit->insertCustomButton(0, m_restoreArgsButton); } @@ -790,20 +787,17 @@ QWidget *LauncherOptionPage::setupWidget() // connect signals & slots if (m_process) { - m_connections << connect(m_process, &SyncthingProcess::readyRead, this, &LauncherOptionPage::handleSyncthingReadyRead, Qt::QueuedConnection); - m_connections << connect(m_process, - static_cast(&SyncthingProcess::finished), this, + connect(m_process, &SyncthingProcess::readyRead, this, &LauncherOptionPage::handleSyncthingReadyRead, Qt::QueuedConnection); + connect(m_process, static_cast(&SyncthingProcess::finished), this, &LauncherOptionPage::handleSyncthingExited, Qt::QueuedConnection); - m_connections << connect(m_process, &SyncthingProcess::errorOccurred, this, &LauncherOptionPage::handleSyncthingError, Qt::QueuedConnection); + connect(m_process, &SyncthingProcess::errorOccurred, this, &LauncherOptionPage::handleSyncthingError, Qt::QueuedConnection); } else if (m_launcher) { - m_connections << connect( - m_launcher, &SyncthingLauncher::outputAvailable, this, &LauncherOptionPage::handleSyncthingOutputAvailable, Qt::QueuedConnection); - m_connections << connect(m_launcher, &SyncthingLauncher::exited, this, &LauncherOptionPage::handleSyncthingExited, Qt::QueuedConnection); - m_connections << connect( - m_launcher, &SyncthingLauncher::errorOccurred, this, &LauncherOptionPage::handleSyncthingError, Qt::QueuedConnection); + connect(m_launcher, &SyncthingLauncher::outputAvailable, this, &LauncherOptionPage::handleSyncthingOutputAvailable, Qt::QueuedConnection); + connect(m_launcher, &SyncthingLauncher::exited, this, &LauncherOptionPage::handleSyncthingExited, Qt::QueuedConnection); + connect(m_launcher, &SyncthingLauncher::errorOccurred, this, &LauncherOptionPage::handleSyncthingError, Qt::QueuedConnection); } - QObject::connect(ui()->launchNowPushButton, &QPushButton::clicked, this, &LauncherOptionPage::launch); - QObject::connect(ui()->stopPushButton, &QPushButton::clicked, this, &LauncherOptionPage::stop); + connect(ui()->launchNowPushButton, &QPushButton::clicked, this, &LauncherOptionPage::launch); + connect(ui()->stopPushButton, &QPushButton::clicked, this, &LauncherOptionPage::stop); return widget; } diff --git a/widgets/settings/settingsdialog.h b/widgets/settings/settingsdialog.h index 41c0d07..ffe3188 100644 --- a/widgets/settings/settingsdialog.h +++ b/widgets/settings/settingsdialog.h @@ -121,7 +121,6 @@ private: Data::SyncthingProcess *const m_process; Data::SyncthingLauncher *const m_launcher; QtUtilities::IconButton *m_restoreArgsButton; - QList m_connections; bool m_kill; QString m_tool; };