Remove redundant "optional" gui log functions which relly just call gui log under...
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Tue, 4 Jul 2023 16:39:03 +0000 (00:39 +0800)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Fri, 4 Aug 2023 09:40:39 +0000 (17:40 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/folder.cpp
src/gui/owncloudgui.cpp
src/gui/owncloudgui.h
src/libsync/logger.cpp
src/libsync/logger.h

index 9879ed30284fb1eed9c03a0134a3b15c1385aa0e..5d6caf2f10d011b372a12599174a4cb6f4f6b3ef 100644 (file)
@@ -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)
index 2ea72556493762c528f1fe3c103486720698ecb4..9d1d5856f340586483da76bca0e82781cbb3676f 100644 (file)
@@ -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<SyncStatusSummary>("com.nextcloud.desktopclient", 1, 0, "SyncStatusSummary");
     qmlRegisterType<EmojiModel>("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
  */
index 41c7895ef68635d31f082c274aa70f6dc5d633bc..8315fe228caa6ca828d2951314ed513d246cb74a 100644 (file)
@@ -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);
index fffbbc14c636bead050f1603f30b2cde9e04e475..8cd029cf9b1e03ff937ef4df7925a2613c06b70a 100644 (file)
@@ -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);
index 5fd14431e5eef1002de94a2695bf0d16d9e96a07..bfcb2989d5db06cddf710d5f2513aa712aa8c6be 100644 (file)
@@ -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();