Compare commits

..

No commits in common. "f5ba2f601470ed1dc2336980af223e2df15ac2ec" and "c1ca54a1d1f0f2084210eba434f7930fb853b545" have entirely different histories.

3 changed files with 1 additions and 14 deletions

View file

@ -14,7 +14,6 @@ Database::Database(const std::string& dbname)
Database::Database() Database::Database()
{ {
namespace fs = std::filesystem; namespace fs = std::filesystem;
#if defined(__linux__) #if defined(__linux__)
fs::path dbpath = fs::path(std::getenv("HOME")) / ".local/share/kima2-cpp"; fs::path dbpath = fs::path(std::getenv("HOME")) / ".local/share/kima2-cpp";
#elif defined(__WIN64) || defined(__WIN32) #elif defined(__WIN64) || defined(__WIN32)
@ -22,7 +21,6 @@ Database::Database()
#else #else
throw std::runtime_error("Platform not supported."); throw std::runtime_error("Platform not supported.");
#endif #endif
if (!fs::exists(dbpath)) { if (!fs::exists(dbpath)) {
try { try {
fs::create_directories(dbpath); fs::create_directories(dbpath);

View file

@ -34,16 +34,8 @@ void SellerDialog::on_deleteButton_clicked()
auto selModel = ui_.tableView->selectionModel(); auto selModel = ui_.tableView->selectionModel();
if (selModel->hasSelection() == false) if (selModel->hasSelection() == false)
return; 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(); auto indexes = selModel->selectedRows();
std::sort(indexes.begin(), indexes.end()); std::sort(indexes.begin(), indexes.end());
// Deleting the rows, beginning with the last one! // Deleting the rows, beginning with the last one!

View file

@ -147,10 +147,7 @@ bool SellerModel::removeRows(int row, int count, const QModelIndex& parent)
marketplace_->getSellers().end()); marketplace_->getSellers().end());
emit endRemoveRows(); emit endRemoveRows();
} else { } else {
emit beginRemoveRows(parent, row, row + count - 1);
seller->setState(Seller::State::DELETE); seller->setState(Seller::State::DELETE);
marketplace_->storeToDb();
emit endRemoveRows();
} }
return false; return false;