From 993ee6cb5b4f0b493e009a916a6e3838bcda5250 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Wed, 5 Jul 2023 00:39:03 +0800 Subject: [PATCH] Remove redundant "optional" gui log functions which relly just call gui log under the hood Signed-off-by: Claudio Cambra --- src/gui/folder.cpp | 8 ++++---- src/gui/owncloudgui.cpp | 13 ++----------- src/gui/owncloudgui.h | 1 - src/libsync/logger.cpp | 5 ----- src/libsync/logger.h | 2 -- 5 files changed, 6 insertions(+), 23 deletions(-) diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index 9879ed302..5d6caf2f1 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -486,7 +486,7 @@ void Folder::createGuiLog(const QString &filename, LogStatus status, int count, if (!text.isEmpty()) { // Ignores the settings in case of an error or conflict if(status == LogStatusError || status == LogStatusConflict) - logger->postOptionalGuiLog(tr("Sync Activity"), text); + logger->postGuiLog(tr("Sync Activity"), text); } } } @@ -1213,7 +1213,7 @@ void Folder::slotNewBigFolderDiscovered(const QString &newF, bool isExternal) message += tr("Please go in the settings to select it if you wish to download it."); auto logger = Logger::instance(); - logger->postOptionalGuiLog(Theme::instance()->appNameGUI(), message); + logger->postGuiLog(Theme::instance()->appNameGUI(), message); } } @@ -1234,7 +1234,7 @@ void Folder::slotExistingFolderNowBig(const QString &folderPath) const auto message = tr("A folder has surpassed the set folder size limit of %1MB: %2.\n" "Please go into the settings and disable it if you wish to stop synchronising it.") .arg(QString::number(ConfigFile().newBigFolderSizeLimit().second), folderPath); - Logger::instance()->postOptionalGuiLog(Theme::instance()->appNameGUI(), message); + Logger::instance()->postGuiLog(Theme::instance()->appNameGUI(), message); } } @@ -1303,7 +1303,7 @@ void Folder::warnOnNewExcludedItem(const SyncJournalFileRecord &record, const QS "It will not be synchronized.") .arg(fi.filePath()); - Logger::instance()->postOptionalGuiLog(Theme::instance()->appNameGUI(), message); + Logger::instance()->postGuiLog(Theme::instance()->appNameGUI(), message); } void Folder::slotWatcherUnreliable(const QString &message) diff --git a/src/gui/owncloudgui.cpp b/src/gui/owncloudgui.cpp index 2ea725564..9d1d5856f 100644 --- a/src/gui/owncloudgui.cpp +++ b/src/gui/owncloudgui.cpp @@ -107,12 +107,8 @@ ownCloudGui::ownCloudGui(Application *parent) connect(folderMan, &FolderMan::folderSyncStateChange, this, &ownCloudGui::slotSyncStateChange); - connect(Logger::instance(), &Logger::guiLog, - this, &ownCloudGui::slotShowTrayMessage); - connect(Logger::instance(), &Logger::optionalGuiLog, - this, &ownCloudGui::slotShowOptionalTrayMessage); - connect(Logger::instance(), &Logger::guiMessage, - this, &ownCloudGui::slotShowGuiMessage); + connect(Logger::instance(), &Logger::guiLog, this, &ownCloudGui::slotShowTrayMessage); + connect(Logger::instance(), &Logger::guiMessage, this, &ownCloudGui::slotShowGuiMessage); qmlRegisterType("com.nextcloud.desktopclient", 1, 0, "SyncStatusSummary"); qmlRegisterType("com.nextcloud.desktopclient", 1, 0, "EmojiModel"); @@ -426,11 +422,6 @@ void ownCloudGui::slotShowTrayUpdateMessage(const QString &title, const QString } } -void ownCloudGui::slotShowOptionalTrayMessage(const QString &title, const QString &msg) -{ - slotShowTrayMessage(title, msg); -} - /* * open the folder with the given Alias */ diff --git a/src/gui/owncloudgui.h b/src/gui/owncloudgui.h index 41c7895ef..8315fe228 100644 --- a/src/gui/owncloudgui.h +++ b/src/gui/owncloudgui.h @@ -76,7 +76,6 @@ public slots: void slotComputeOverallSyncStatus(); void slotShowTrayMessage(const QString &title, const QString &msg); void slotShowTrayUpdateMessage(const QString &title, const QString &msg, const QUrl &webUrl); - void slotShowOptionalTrayMessage(const QString &title, const QString &msg); void slotFolderOpenAction(const QString &alias); void slotUpdateProgress(const QString &folder, const OCC::ProgressInfo &progress); void slotShowGuiMessage(const QString &title, const QString &message); diff --git a/src/libsync/logger.cpp b/src/libsync/logger.cpp index fffbbc14c..8cd029cf9 100644 --- a/src/libsync/logger.cpp +++ b/src/libsync/logger.cpp @@ -100,11 +100,6 @@ void Logger::postGuiLog(const QString &title, const QString &message) emit guiLog(title, message); } -void Logger::postOptionalGuiLog(const QString &title, const QString &message) -{ - emit optionalGuiLog(title, message); -} - void Logger::postGuiMessage(const QString &title, const QString &message) { emit guiMessage(title, message); diff --git a/src/libsync/logger.h b/src/libsync/logger.h index 5fd14431e..bfcb2989d 100644 --- a/src/libsync/logger.h +++ b/src/libsync/logger.h @@ -42,7 +42,6 @@ public: static Logger *instance(); void postGuiLog(const QString &title, const QString &message); - void postOptionalGuiLog(const QString &title, const QString &message); void postGuiMessage(const QString &title, const QString &message); QString logFile() const; @@ -87,7 +86,6 @@ signals: void guiLog(const QString &, const QString &); void guiMessage(const QString &, const QString &); - void optionalGuiLog(const QString &, const QString &); public slots: void enterNextLogFile(); -- 2.30.2