From 82c0ab873430a9734013a3d32f7472d63087a6c8 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Mon, 2 Sep 2024 16:18:44 +0200 Subject: [PATCH] only add Encrypt context menu entry for top folder in settings dialog will omit Encrypt menu item for child fodlers as displayed in selective sync folders tree in settings dialog Signed-off-by: Matthieu Gallien --- 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 719f85704f8d..8f5621704d47 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -576,8 +576,9 @@ void AccountSettings::slotSubfolderContextMenuRequested(const QModelIndex& index const auto isEncrypted = info->isEncrypted(); const auto isParentEncrypted = _model->isAnyAncestorEncrypted(index); + const auto isTopFolder = index.parent().isValid() && !index.parent().parent().isValid(); - if (!isEncrypted && !isParentEncrypted) { + if (!isEncrypted && !isParentEncrypted && isTopFolder) { ac = menu.addAction(tr("Encrypt")); connect(ac, &QAction::triggered, [this, info] { slotMarkSubfolderEncrypted(info); }); } else {