Don't show the encrypt action in subfolders of encrypted folders
authorKevin Ottens <kevin.ottens@nextcloud.com>
Wed, 17 Jun 2020 10:42:57 +0000 (12:42 +0200)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 30 Jun 2020 09:29:08 +0000 (11:29 +0200)
Since we want to move to a place where the encryption of subfolders is
always enforced it makes no sense to leave it in control of the user.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
src/gui/accountsettings.cpp

index 2e95796389e02389c57ccb1320a1b720ae368c13..9ee4d5ed6d2ef4e3966478f57fc931e5ebeb9145 100644 (file)
@@ -556,8 +556,9 @@ void AccountSettings::slotSubfolderContextMenuRequested(const QModelIndex& index
         // Verify if the folder is empty before attempting to encrypt.
 
         bool isEncrypted = acc->e2e()->isFolderEncrypted(info->_path);
+        bool isParentEncrypted = acc->e2e()->isAnyParentFolderEncrypted(info->_path);
 
-        if (!isEncrypted) {
+        if (!isEncrypted && !isParentEncrypted) {
             ac = menu.addAction(tr("Encrypt"));
             connect(ac, &QAction::triggered, [this, info] { slotMarkSubfolderEncrypted(info); });
         } else {