diff --git a/src/core/database.cpp b/src/core/database.cpp index 1a0d483..973633c 100644 --- a/src/core/database.cpp +++ b/src/core/database.cpp @@ -14,7 +14,6 @@ Database::Database(const std::string& dbname) Database::Database() { namespace fs = std::filesystem; - #if defined(__linux__) fs::path dbpath = fs::path(std::getenv("HOME")) / ".local/share/kima2-cpp"; #elif defined(__WIN64) || defined(__WIN32) @@ -22,7 +21,6 @@ Database::Database() #else throw std::runtime_error("Platform not supported."); #endif - if (!fs::exists(dbpath)) { try { fs::create_directories(dbpath); diff --git a/src/gui/sellerdialog.cpp b/src/gui/sellerdialog.cpp index b2a284e..2b741d7 100644 --- a/src/gui/sellerdialog.cpp +++ b/src/gui/sellerdialog.cpp @@ -34,16 +34,8 @@ void SellerDialog::on_deleteButton_clicked() auto selModel = ui_.tableView->selectionModel(); if (selModel->hasSelection() == false) return; - - auto dlgResult = - QMessageBox(QMessageBox::Icon::Warning, "Sind Sie sicher?", - "Löschen wirkt sich direkt auf die Datenbank aus. Möchten Sie fortfahren?", - QMessageBox::StandardButton::Yes | QMessageBox::StandardButton::No, this) - .exec(); - if (dlgResult == QMessageBox::No) - return; - auto indexes = selModel->selectedRows(); + std::sort(indexes.begin(), indexes.end()); // Deleting the rows, beginning with the last one! diff --git a/src/gui/sellermodel.cpp b/src/gui/sellermodel.cpp index a21decd..109d5df 100644 --- a/src/gui/sellermodel.cpp +++ b/src/gui/sellermodel.cpp @@ -147,10 +147,7 @@ bool SellerModel::removeRows(int row, int count, const QModelIndex& parent) marketplace_->getSellers().end()); emit endRemoveRows(); } else { - emit beginRemoveRows(parent, row, row + count - 1); seller->setState(Seller::State::DELETE); - marketplace_->storeToDb(); - emit endRemoveRows(); } return false;