Hide decrypt option since it does only work for empty folders

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2018-06-22 12:13:04 +02:00
parent 73969e2515
commit 92480ec8fb
No known key found for this signature in database
GPG key ID: 4C614C6ED2CDE6DF

View file

@ -511,12 +511,13 @@ void AccountSettings::slotSubfolderContextMenuRequested(const QModelIndex& index
// Verify if the folder is empty before attempting to encrypt.
bool isEncrypted = acc->e2e()->isFolderEncrypted(info->_path);
ac = menu.addAction( isEncrypted ? tr("Decrypt") : tr("Encrypt"));
if (!isEncrypted) {
ac = menu.addAction(tr("Encrypt"));
connect(ac, &QAction::triggered, [this, &info] { slotMarkSubfolderEncrpted(info); });
} else {
connect(ac, &QAction::triggered, [this, &info] { slotMarkSubfolderDecrypted(info); });
// Ingore decrypting for now since it only works with an empty folder
// connect(ac, &QAction::triggered, [this, &info] { slotMarkSubfolderDecrypted(info); });
}
}
menu.exec(QCursor::pos());