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 <matthieu.gallien@nextcloud.com>
This commit is contained in:
Matthieu Gallien 2024-09-02 16:18:44 +02:00 committed by backportbot[bot]
parent df7d5c5814
commit 155e8227f6

View file

@ -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 {