diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index 719f85704f8d4..8f5621704d47b 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 {