From: Kevin Ottens Date: Wed, 17 Jun 2020 10:42:57 +0000 (+0200) Subject: Don't show the encrypt action in subfolders of encrypted folders X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~222^2^2~130^2~16 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=839c056b8d595f7aa01ded27bbacc8f075b3bcfc;p=nextcloud-desktop.git 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 --- 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 {