From fc6ecf818620441b3f75141ca4db3884ae7b93f0 Mon Sep 17 00:00:00 2001 From: Camila Ayres Date: Tue, 29 Oct 2024 20:12:20 +0100 Subject: [PATCH] Use slots as slots. Signed-off-by: Camila Ayres --- src/gui/application.cpp | 11 +++-------- src/gui/application.h | 1 - src/gui/owncloudgui.cpp | 10 ---------- src/gui/owncloudgui.h | 2 -- src/gui/settingsdialog.cpp | 2 +- 5 files changed, 4 insertions(+), 22 deletions(-) diff --git a/src/gui/application.cpp b/src/gui/application.cpp index fb3464761..ebcaa25fc 100644 --- a/src/gui/application.cpp +++ b/src/gui/application.cpp @@ -365,7 +365,7 @@ Application::Application(int &argc, char **argv) } _theme->setSystrayUseMonoIcons(ConfigFile().monoIcons()); - connect(_theme, &Theme::systrayUseMonoIconsChanged, this, &Application::slotUseMonoIconsChanged); + connect(_theme, &Theme::systrayUseMonoIconsChanged, _gui, &ownCloudGui::slotComputeOverallSyncStatus); connect(this, &Application::systemPaletteChanged, _theme, &Theme::systemPaletteHasChanged); @@ -589,7 +589,7 @@ void Application::slotAccountStateRemoved(AccountState *accountState) { if (_gui) { disconnect(accountState, &AccountState::stateChanged, - _gui.data(), &ownCloudGui::slotAccountStateChanged); + _gui.data(), &ownCloudGui::slotComputeOverallSyncStatus); disconnect(accountState->account().data(), &Account::serverVersionChanged, _gui.data(), &ownCloudGui::slotTrayMessageIfServerUnsupported); } @@ -611,7 +611,7 @@ void Application::slotAccountStateRemoved(AccountState *accountState) void Application::slotAccountStateAdded(AccountState *accountState) { connect(accountState, &AccountState::stateChanged, - _gui.data(), &ownCloudGui::slotAccountStateChanged); + _gui.data(), &ownCloudGui::slotComputeOverallSyncStatus); connect(accountState->account().data(), &Account::serverVersionChanged, _gui.data(), &ownCloudGui::slotTrayMessageIfServerUnsupported); connect(accountState, &AccountState::termsOfServiceChanged, @@ -716,11 +716,6 @@ void Application::setupLogging() qCInfo(lcApplication) << "Arguments:" << qApp->arguments(); } -void Application::slotUseMonoIconsChanged(bool) -{ - _gui->slotComputeOverallSyncStatus(); -} - void Application::slotParseMessage(const QString &msg, QObject *) { if (msg.startsWith(QLatin1String("MSG_PARSEOPTIONS:"))) { diff --git a/src/gui/application.h b/src/gui/application.h index f2c41fe45..c3936da43 100644 --- a/src/gui/application.h +++ b/src/gui/application.h @@ -101,7 +101,6 @@ signals: protected slots: void slotParseMessage(const QString &, QObject *); void slotCheckConnection(); - void slotUseMonoIconsChanged(bool); void slotCleanup(); void slotAccountStateAdded(OCC::AccountState *accountState); void slotAccountStateRemoved(OCC::AccountState *accountState); diff --git a/src/gui/owncloudgui.cpp b/src/gui/owncloudgui.cpp index e4f07f243..dccdcc3a8 100644 --- a/src/gui/owncloudgui.cpp +++ b/src/gui/owncloudgui.cpp @@ -258,21 +258,11 @@ void ownCloudGui::slotSyncStateChange(Folder *folder) } } -void ownCloudGui::slotFoldersChanged() -{ - slotComputeOverallSyncStatus(); -} - void ownCloudGui::slotOpenPath(const QString &path) { showInFileManager(path); } -void ownCloudGui::slotAccountStateChanged() -{ - slotComputeOverallSyncStatus(); -} - void ownCloudGui::slotTrayMessageIfServerUnsupported(Account *account) { if (account->serverVersionUnsupported()) { diff --git a/src/gui/owncloudgui.h b/src/gui/owncloudgui.h index 2370d9d3f..446b58a9c 100644 --- a/src/gui/owncloudgui.h +++ b/src/gui/owncloudgui.h @@ -79,7 +79,6 @@ public slots: void slotFolderOpenAction(const QString &alias); void slotUpdateProgress(const QString &folder, const OCC::ProgressInfo &progress); void slotShowGuiMessage(const QString &title, const QString &message); - void slotFoldersChanged(); void slotShowSettings(); void slotShowSyncProtocol(); void slotShutdown(); @@ -92,7 +91,6 @@ public slots: void slotSettingsDialogActivated(); void slotHelp(); void slotOpenPath(const QString &path); - void slotAccountStateChanged(); void slotTrayMessageIfServerUnsupported(OCC::Account *account); void slotNeedToAcceptTermsOfService(OCC::AccountPtr account, OCC::AccountState::State state); diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp index fc09c0cdc..7b4d77894 100644 --- a/src/gui/settingsdialog.cpp +++ b/src/gui/settingsdialog.cpp @@ -261,7 +261,7 @@ void SettingsDialog::accountAdded(AccountState *s) _actionForAccount.insert(s->account().data(), accountAction); accountAction->trigger(); - connect(accountSettings, &AccountSettings::folderChanged, _gui, &ownCloudGui::slotFoldersChanged); + connect(accountSettings, &AccountSettings::folderChanged, _gui, &ownCloudGui::slotComputeOverallSyncStatus); connect(accountSettings, &AccountSettings::openFolderAlias, _gui, &ownCloudGui::slotFolderOpenAction); connect(accountSettings, &AccountSettings::showIssuesList, this, &SettingsDialog::showIssuesList); -- 2.30.2