Skip to content

Commit

Permalink
Merge pull request #604 from FSMaxB/fix-accidental-deletion-of-all-pa…
Browse files Browse the repository at this point in the history
…sswords

Fix accidental deletion of entire passwordstore
  • Loading branch information
annejan authored Jan 28, 2023
2 parents bc2c04c + 92a724d commit f66720d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,14 @@ void MainWindow::addPassword() {
* sure.
*/
void MainWindow::onDelete() {
QModelIndex currentIndex = ui->treeView->currentIndex();
if (!currentIndex.isValid()) {
// This fixes https://github.com/IJHack/QtPass/issues/556
// Otherwise the entire password directory would be deleted if
// nothing is selected in the tree view.
return;
}

QFileInfo fileOrFolder =
model.fileInfo(proxyModel.mapToSource(ui->treeView->currentIndex()));
QString file = "";
Expand Down

0 comments on commit f66720d

Please sign in to comment.