Merge pull request #438 from nextcloud/bugfix/413/hide-decrypt-option

Hide decrypt option since it does only work for empty folders
This commit is contained in:
Roeland Jago Douma 2018-06-23 21:20:46 +02:00 committed by GitHub
commit 9eb950bdcf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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());