From e75f10addc9c91b35c7d3bc398576c8f98b9856d Mon Sep 17 00:00:00 2001 From: Aslan2142 Date: Mon, 20 Apr 2020 08:18:19 +0200 Subject: [PATCH] Bug Fixed and Fixed Crashes --- LICENSE | 0 PKGBUILD_amd64 | 2 +- PKGBUILD_arm64 | 2 +- README.md | 0 control_amd64 | 2 +- control_arm64 | 2 +- main.cpp | 6 +++--- mainwindow.cpp | 46 +++++++++++++++++++++++++++++++++++++++++--- mainwindow.h | 0 mainwindow.ui | 0 makearchpkg.sh | 0 makedebpkg.sh | 0 parameterparser.cpp | 0 parameterparser.h | 0 passman.cpp | 0 passman.h | 0 passman.pro | 0 passman_icon.svg | 0 qaesencryption.cpp | 0 qaesencryption.h | 0 resources.qrc | 0 screenshot.png | Bin 22 files changed, 50 insertions(+), 10 deletions(-) mode change 100644 => 100755 LICENSE mode change 100644 => 100755 PKGBUILD_amd64 mode change 100644 => 100755 PKGBUILD_arm64 mode change 100644 => 100755 README.md mode change 100644 => 100755 control_amd64 mode change 100644 => 100755 control_arm64 mode change 100644 => 100755 main.cpp mode change 100644 => 100755 mainwindow.cpp mode change 100644 => 100755 mainwindow.h mode change 100644 => 100755 mainwindow.ui mode change 100644 => 100755 makearchpkg.sh mode change 100644 => 100755 makedebpkg.sh mode change 100644 => 100755 parameterparser.cpp mode change 100644 => 100755 parameterparser.h mode change 100644 => 100755 passman.cpp mode change 100644 => 100755 passman.h mode change 100644 => 100755 passman.pro mode change 100644 => 100755 passman_icon.svg mode change 100644 => 100755 qaesencryption.cpp mode change 100644 => 100755 qaesencryption.h mode change 100644 => 100755 resources.qrc mode change 100644 => 100755 screenshot.png diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/PKGBUILD_amd64 b/PKGBUILD_amd64 old mode 100644 new mode 100755 index b5af069..6354c80 --- a/PKGBUILD_amd64 +++ b/PKGBUILD_amd64 @@ -1,5 +1,5 @@ pkgname=passman -pkgver=1.0.2 +pkgver=1.0.3 pkgrel=1 pkgdesc="A Simple Password Manager with AES-256 Encryption" arch=('x86_64') diff --git a/PKGBUILD_arm64 b/PKGBUILD_arm64 old mode 100644 new mode 100755 index e1c2532..fd0ad5f --- a/PKGBUILD_arm64 +++ b/PKGBUILD_arm64 @@ -1,5 +1,5 @@ pkgname=passman -pkgver=1.0.2 +pkgver=1.0.3 pkgrel=1 pkgdesc="A Simple Password Manager with AES-256 Encryption" arch=('aarch64') diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/control_amd64 b/control_amd64 old mode 100644 new mode 100755 index 60fec78..137f86d --- a/control_amd64 +++ b/control_amd64 @@ -1,5 +1,5 @@ Package: passman -Version: 1.0.2 +Version: 1.0.3 Section: utils Priority: optional Architecture: amd64 diff --git a/control_arm64 b/control_arm64 old mode 100644 new mode 100755 index 985ab9e..a6b0d18 --- a/control_arm64 +++ b/control_arm64 @@ -1,5 +1,5 @@ Package: passman -Version: 1.0.2 +Version: 1.0.3 Section: utils Priority: optional Architecture: arm64 diff --git a/main.cpp b/main.cpp old mode 100644 new mode 100755 index 9b7702b..325012d --- a/main.cpp +++ b/main.cpp @@ -6,7 +6,7 @@ int main(int argc, char *argv[]) { - QString version = "1.0.2"; + QString version = "1.0.3"; if (argc == 1) { @@ -32,8 +32,8 @@ int main(int argc, char *argv[]) std::cout << "-h | --help | Shows this Help Screen\n"; std::cout << "-p | --pass | Input Password\n"; std::cout << "-d | --create-database | Creates new Database if it doesn't already exist\n"; - std::cout << "-n | --new | Creates new Database Entry\n"; - std::cout << "-r | --remove | Removes Database Entry\n"; + std::cout << "-n | --new | Creates new Database Entry\n"; + std::cout << "-r | --remove | Removes Database Entry\n"; std::cout << "-b | --backup | Makes Database Backup\n"; std::cout << "-a | --show-all | Shows all Database Entries\n"; std::cout << "-s | --show | Shows all Database Entries for given Website\n\n"; diff --git a/mainwindow.cpp b/mainwindow.cpp old mode 100644 new mode 100755 index 9b154d7..a35bf16 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -77,6 +77,8 @@ void MainWindow::decrypt_database() ui->tableWidgetCredentials->setHorizontalHeaderLabels({"Website", "Username", "Password", "Note"}); ui->tableWidgetCredentials->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); + + ui->lineEditSearch->setFocus(); } void MainWindow::backup_database() @@ -128,7 +130,21 @@ void MainWindow::remove_entry() { QList selected = ui->tableWidgetCredentials->selectedItems(); - saved = selected.size() <= 0; + if (selected.size() > 0) + { + saved = false; + } + + int last_row = -1; + for (int i = 0; i < selected.size(); i++) + { + if (last_row == selected[i]->row()) + { + selected.removeAt(i--); + continue; + } + last_row = selected[i]->row(); + } for (QTableWidgetItem* item : selected) { @@ -140,7 +156,21 @@ void MainWindow::generate_password() { QList selected = ui->tableWidgetCredentials->selectedItems(); - saved = selected.size() <= 0; + if (selected.size() > 0) + { + saved = false; + } + + int last_row = -1; + for (int i = 0; i < selected.size(); i++) + { + if (last_row == selected[i]->row()) + { + selected.removeAt(i--); + continue; + } + last_row = selected[i]->row(); + } for (QTableWidgetItem* item : selected) { @@ -247,7 +277,17 @@ void MainWindow::on_tableWidgetCredentials_itemChanged() void MainWindow::on_tableWidgetCredentials_itemSelectionChanged() { - if (ui->tableWidgetCredentials->selectedItems().size() > 1) + QList selected = ui->tableWidgetCredentials->selectedItems(); + + int count = 0; + int last_row = -1; + for (QTableWidgetItem* item : selected) + { + if (last_row != item->row()) count++; + last_row = item->row(); + } + + if (count > 1) { ui->pushButtonRemoveEntry->setText("Remove Selected Entries"); } else { diff --git a/mainwindow.h b/mainwindow.h old mode 100644 new mode 100755 diff --git a/mainwindow.ui b/mainwindow.ui old mode 100644 new mode 100755 diff --git a/makearchpkg.sh b/makearchpkg.sh old mode 100644 new mode 100755 diff --git a/makedebpkg.sh b/makedebpkg.sh old mode 100644 new mode 100755 diff --git a/parameterparser.cpp b/parameterparser.cpp old mode 100644 new mode 100755 diff --git a/parameterparser.h b/parameterparser.h old mode 100644 new mode 100755 diff --git a/passman.cpp b/passman.cpp old mode 100644 new mode 100755 diff --git a/passman.h b/passman.h old mode 100644 new mode 100755 diff --git a/passman.pro b/passman.pro old mode 100644 new mode 100755 diff --git a/passman_icon.svg b/passman_icon.svg old mode 100644 new mode 100755 diff --git a/qaesencryption.cpp b/qaesencryption.cpp old mode 100644 new mode 100755 diff --git a/qaesencryption.h b/qaesencryption.h old mode 100644 new mode 100755 diff --git a/resources.qrc b/resources.qrc old mode 100644 new mode 100755 diff --git a/screenshot.png b/screenshot.png old mode 100644 new mode 100755