From 7571ef6a13613ea931197d8f01774be438899fbe Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Tue, 9 Oct 2018 08:04:47 +0200 Subject: [PATCH] Fix creating new db --- src/core/database.cpp | 2 ++ src/gui/mainwindow.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/src/core/database.cpp b/src/core/database.cpp index d89d156..0a07ddd 100644 --- a/src/core/database.cpp +++ b/src/core/database.cpp @@ -41,6 +41,8 @@ void Database::newDb() { namespace fs = std::filesystem; + sqlite3_close(db_); + fs::path sourcePath = dbname_; fs::path destPath = sourcePath.parent_path() / sourcePath.stem(); destPath += std::string("_") += boost::posix_time::to_iso_string(boost::posix_time::second_clock::local_time()) += ".db"; diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 420e4a3..929ee2c 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -62,6 +62,7 @@ MainWindow::MainWindow() dynamic_cast(ui_.basketView->model())->cancelSale(); marketplace_->clear(); setSaleModel(); + updateStatLabel(); }); ui_.sellerNoEdit->installEventFilter(this);