From 51627ef9890399103f1d9e3ea9a119ca993beac3 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Fri, 10 May 2024 13:10:43 +0800 Subject: [PATCH] Constify openLocalFolder Signed-off-by: Claudio Cambra --- src/gui/tray/usermodel.cpp | 6 ++---- src/gui/tray/usermodel.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/gui/tray/usermodel.cpp b/src/gui/tray/usermodel.cpp index 9c9f3cf81..3121fc5f2 100644 --- a/src/gui/tray/usermodel.cpp +++ b/src/gui/tray/usermodel.cpp @@ -925,11 +925,9 @@ UnifiedSearchResultsListModel *User::getUnifiedSearchResultsListModel() const return _unifiedSearchResultsModel; } -void User::openLocalFolder() +void User::openLocalFolder() const { - const auto folder = getFolder(); - - if (folder) { + if (const auto folder = getFolder()) { QDesktopServices::openUrl(QUrl::fromLocalFile(folder->path())); } } diff --git a/src/gui/tray/usermodel.h b/src/gui/tray/usermodel.h index 33c3ae455..466cd6ab8 100644 --- a/src/gui/tray/usermodel.h +++ b/src/gui/tray/usermodel.h @@ -76,7 +76,7 @@ public: [[nodiscard]] Folder *getFolder() const; ActivityListModel *getActivityModel(); [[nodiscard]] UnifiedSearchResultsListModel *getUnifiedSearchResultsListModel() const; - void openLocalFolder(); + void openLocalFolder() const; void openFolderLocallyOrInBrowser(const QString &fullRemotePath); [[nodiscard]] QString name() const; [[nodiscard]] QString server(bool shortened = true) const;