From 839c056b8d595f7aa01ded27bbacc8f075b3bcfc Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Wed, 17 Jun 2020 12:42:57 +0200 Subject: [PATCH] Don't show the encrypt action in subfolders of encrypted folders 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 --- src/gui/accountsettings.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index 2e9579638..9ee4d5ed6 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -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 { -- 2.30.2