mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
only empty top folders offer the menu entry to encrypt
in the contextual menu shown in files explorer will show encrypt menu entry only for top folders that are non-encrypted and empty Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
parent
1c3743d670
commit
539be0a16a
@ -1242,7 +1242,8 @@ void SocketApi::sendEncryptFolderCommandMenuEntries(const QFileInfo &fileInfo,
|
||||
!fileData.folder->accountState()->account() ||
|
||||
!fileData.folder->accountState()->account()->capabilities().clientSideEncryptionAvailable() ||
|
||||
!FileSystem::isDir(fileInfo.absoluteFilePath()) ||
|
||||
isE2eEncryptedPath) {
|
||||
isE2eEncryptedPath ||
|
||||
!fileData.isFolderEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1328,6 +1329,15 @@ QString SocketApi::FileData::folderRelativePathNoVfsSuffix() const
|
||||
return result;
|
||||
}
|
||||
|
||||
bool SocketApi::FileData::isFolderEmpty() const
|
||||
{
|
||||
if (FileSystem::isDir(localPath)) {
|
||||
const auto nativeFolder = QDir{localPath};
|
||||
return nativeFolder.isEmpty();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
SyncFileStatus SocketApi::FileData::syncFileStatus() const
|
||||
{
|
||||
if (!folder)
|
||||
|
||||
@ -98,6 +98,8 @@ private:
|
||||
// Relative path of the file locally, without any vfs suffix
|
||||
[[nodiscard]] QString folderRelativePathNoVfsSuffix() const;
|
||||
|
||||
[[nodiscard]] bool isFolderEmpty() const;
|
||||
|
||||
Folder *folder = nullptr;
|
||||
// Absolute path of the file locally. (May be a virtual file)
|
||||
QString localPath;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user