diff --git a/src/gui/folderman.cpp b/src/gui/folderman.cpp index 06cbf0e168d1f..5c6539a0f99e9 100644 --- a/src/gui/folderman.cpp +++ b/src/gui/folderman.cpp @@ -1612,7 +1612,7 @@ void FolderMan::slotLeaveShare(const QString &localFile, const QByteArray &folde void FolderMan::trayOverallStatus(const QList &folders, SyncResult::Status *status, bool *unresolvedConflicts, - const ProgressInfo **overallProgressInfo) + ProgressInfo **const overallProgressInfo) { *status = SyncResult::Undefined; *unresolvedConflicts = false; @@ -1647,7 +1647,7 @@ void FolderMan::trayOverallStatus(const QList &folders, } } *unresolvedConflicts = syncResult.hasUnresolvedConflicts(); - *overallProgressInfo = &folder->syncEngine().progressInfo(); + *overallProgressInfo = folder->syncEngine().progressInfo(); } } else { auto errorsSeen = false; @@ -1714,7 +1714,7 @@ void FolderMan::trayOverallStatus(const QList &folders, } } -QString FolderMan::trayTooltipStatusString(SyncResult::Status syncStatus, bool hasUnresolvedConflicts, bool paused, const ProgressInfo *progress) +QString FolderMan::trayTooltipStatusString(SyncResult::Status syncStatus, bool hasUnresolvedConflicts, bool paused, ProgressInfo *const progress) { QString folderMessage; switch (syncStatus) { diff --git a/src/gui/folderman.h b/src/gui/folderman.h index 0f9cb0bd84e81..f41be2fde02ad 100644 --- a/src/gui/folderman.h +++ b/src/gui/folderman.h @@ -137,11 +137,10 @@ class FolderMan : public QObject bool startFromScratch(const QString &); /// Produce text for use in the tray tooltip - static QString trayTooltipStatusString(SyncResult::Status syncStatus, bool hasUnresolvedConflicts, bool paused, const ProgressInfo *progress); + static QString trayTooltipStatusString(SyncResult::Status syncStatus, bool hasUnresolvedConflicts, bool paused, ProgressInfo *progress); /// Compute status summarizing multiple folders - static void - trayOverallStatus(const QList &folders, SyncResult::Status *status, bool *unresolvedConflicts, const ProgressInfo **overallProgressInfo); + static void trayOverallStatus(const QList &folders, SyncResult::Status *status, bool *unresolvedConflicts, ProgressInfo **overallProgressInfo); // Escaping of the alias which is used in QSettings AND the file // system, thus need to be escaped. diff --git a/src/gui/owncloudgui.cpp b/src/gui/owncloudgui.cpp index cff58c1a3bc0b..ae0b210a87550 100644 --- a/src/gui/owncloudgui.cpp +++ b/src/gui/owncloudgui.cpp @@ -384,7 +384,7 @@ void ownCloudGui::slotComputeOverallSyncStatus() SyncResult::Status overallStatus = SyncResult::Undefined; bool hasUnresolvedConflicts = false; - const ProgressInfo *overallProgressInfo = nullptr; + ProgressInfo *overallProgressInfo = nullptr; FolderMan::trayOverallStatus(map.values(), &overallStatus, &hasUnresolvedConflicts, &overallProgressInfo); #ifdef BUILD_FILE_PROVIDER_MODULE @@ -430,7 +430,7 @@ void ownCloudGui::slotComputeOverallSyncStatus() QString folderMessage = FolderMan::trayTooltipStatusString(folder->syncResult().status(), folder->syncResult().hasUnresolvedConflicts(), folder->syncPaused(), - &folder->syncEngine().progressInfo()); + folder->syncEngine().progressInfo()); allStatusStrings += tr("%1: %2").arg(folder->shortGuiLocalPath(), folderMessage); } #ifdef BUILD_FILE_PROVIDER_MODULE diff --git a/src/libsync/syncengine.h b/src/libsync/syncengine.h index 0d47e57cce2e9..ea9b3c21ad004 100644 --- a/src/libsync/syncengine.h +++ b/src/libsync/syncengine.h @@ -78,9 +78,9 @@ class OWNCLOUDSYNC_EXPORT SyncEngine : public QObject [[nodiscard]] SyncOptions syncOptions() const { return _syncOptions; } [[nodiscard]] bool ignoreHiddenFiles() const { return _ignore_hidden_files; } - [[nodiscard]] const ProgressInfo &progressInfo() const + [[nodiscard]] ProgressInfo *progressInfo() const { - return *_progressInfo; + return _progressInfo.get(); } [[nodiscard]] ExcludedFiles &excludedFiles() const { return *_excludedFiles; }