From: Claudio Cambra Date: Thu, 13 Jul 2023 01:28:54 +0000 (+0800) Subject: Set sharingAvailable property in FileDetails from Folder account capabilities X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~92^2^2~89^2~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4bcff7d991b37c911276eee87f4c8ef0c2b1f590;p=nextcloud-desktop.git Set sharingAvailable property in FileDetails from Folder account capabilities Signed-off-by: Claudio Cambra --- diff --git a/src/gui/filedetails/filedetails.cpp b/src/gui/filedetails/filedetails.cpp index 2e24dc265..58c1854ea 100644 --- a/src/gui/filedetails/filedetails.cpp +++ b/src/gui/filedetails/filedetails.cpp @@ -62,6 +62,7 @@ void FileDetails::setLocalPath(const QString &localPath) connect(&_fileWatcher, &QFileSystemWatcher::fileChanged, this, &FileDetails::refreshFileDetails); const auto folder = FolderMan::instance()->folderForPath(_localPath); + Q_ASSERT(folder); const auto file = _localPath.mid(folder->cleanPath().length() + 1); if (!folder->journalDb()->getFileRecord(file, &_fileRecord)) { @@ -74,6 +75,8 @@ void FileDetails::setLocalPath(const QString &localPath) updateLockExpireString(); updateFileTagModel(folder); + _sharingAvailable = folder->accountState()->account()->capabilities().shareAPI(); + Q_EMIT fileChanged(); }