Skip to content

Commit

Permalink
only add Encrypt context menu entry for top folder in settings dialog
Browse files Browse the repository at this point in the history
will omit Encrypt menu item for child fodlers as displayed in selective
sync folders tree in settings dialog

Signed-off-by: Matthieu Gallien <[email protected]>
  • Loading branch information
mgallien authored and backportbot[bot] committed Sep 2, 2024
1 parent 76190e2 commit 82c0ab8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gui/accountsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Check warning on line 581 in src/gui/accountsettings.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/accountsettings.cpp:581:9 [bugprone-branch-clone]

if with identical then and else branches
ac = menu.addAction(tr("Encrypt"));
connect(ac, &QAction::triggered, [this, info] { slotMarkSubfolderEncrypted(info); });
} else {
Expand Down

0 comments on commit 82c0ab8

Please sign in to comment.