From 6b96aee84d38ea655610600b02f78130d1776756 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 2ac67f6adce53..210ed222ddbce 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -554,8 +554,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 {