From: Claudio Cambra Date: Wed, 12 Apr 2023 03:37:01 +0000 (+0800) Subject: Simplify file tag model updating in filedetails, only require folder pointer X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~10^2~49^2~20 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=65e7f6da9cb71478e7e247da908a4061c0754e74;p=nextcloud-desktop.git Simplify file tag model updating in filedetails, only require folder pointer Signed-off-by: Claudio Cambra --- diff --git a/src/gui/filedetails/filedetails.cpp b/src/gui/filedetails/filedetails.cpp index f2243e840..37ef696c6 100644 --- a/src/gui/filedetails/filedetails.cpp +++ b/src/gui/filedetails/filedetails.cpp @@ -72,7 +72,7 @@ void FileDetails::setLocalPath(const QString &localPath) _filelockState = _fileRecord._lockstate; updateLockExpireString(); - updateFileTagModel(file, folder); + updateFileTagModel(folder); Q_EMIT fileChanged(); } @@ -160,12 +160,14 @@ FileTagModel *FileDetails::fileTagModel() const return _fileTagModel.get(); } -void FileDetails::updateFileTagModel(const QString &serverRelPath, const Folder * const folder) +void FileDetails::updateFileTagModel(const Folder * const folder) { Q_ASSERT(folder); const auto account = folder->accountState()->account(); Q_ASSERT(account); + const auto serverRelPath = QString(folder->remotePathTrailingSlash() + name()); + _fileTagModel = std::make_unique(serverRelPath, account); Q_EMIT fileTagModelChanged(); } diff --git a/src/gui/filedetails/filedetails.h b/src/gui/filedetails/filedetails.h index d2d324323..a1fbf9ac5 100644 --- a/src/gui/filedetails/filedetails.h +++ b/src/gui/filedetails/filedetails.h @@ -64,7 +64,7 @@ signals: private slots: void refreshFileDetails(); void updateLockExpireString(); - void updateFileTagModel(const QString &serverRelPath, const Folder * const folder); + void updateFileTagModel(const OCC::Folder * const folder); private: QString _localPath;