From 155e8227f6c1cc218eb5eecb2d39c607bda51b0e 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 15498d5629f5b..6446876cd0f19 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -584,8 +584,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 {