- A small cash point program for children's stuff markets. German language only.
+ A small cash point program for children’s stuff markets. German language only.
diff --git a/meson.build b/meson.build
index 0f06586..a0f8b23 100644
--- a/meson.build
+++ b/meson.build
@@ -1,4 +1,4 @@
-project('kima2', 'cpp', default_options : ['cpp_std=c++20'], version : '1.8.0')
+project('kima2', 'cpp', default_options : ['cpp_std=c++20'], version : '1.6.1')
conf_data = configuration_data()
conf_data.set('PROJECT_VERSION', '"' + meson.project_version() + '"')
diff --git a/src/core/jsonutil.cpp b/src/core/jsonutil.cpp
index 095a7b0..bd24b4e 100644
--- a/src/core/jsonutil.cpp
+++ b/src/core/jsonutil.cpp
@@ -102,10 +102,8 @@ void JsonUtil::importSales(const std::filesystem::path &filePath, Marketplace *m
int source_no = jsonValues["source_no"];
if (source_no == cashPointNo) {
- std::string ret = "Die Kassen-Nr. ";
- ret += std::to_string(source_no);
- ret += " der zu imporierenden Daten wird von dieser Kasse hier bereits verwendet.";
- throw std::runtime_error(ret);
+ throw std::runtime_error("Die Kassen-Nr. der zu imporierenden Daten wird von dieser Kasse "
+ "hier bereits verwendet.");
}
market->setSalesToDelete(jsonValues["source_no"]);
diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp
index a94b7f1..d61a95e 100644
--- a/src/gui/mainwindow.cpp
+++ b/src/gui/mainwindow.cpp
@@ -504,30 +504,27 @@ void MainWindow::onImportSalesJsonActionTriggered()
{
QSettings settings;
- auto filenames = QFileDialog::getOpenFileNames(this, "Umsätze/Transaktionen importieren",
+ auto filename = QFileDialog::getOpenFileName(this, "Umsätze/Transaktionen importieren",
QString(), "JSON Dateien (*.json)");
- if (filenames.isEmpty())
+ if (filename.isEmpty())
return;
- for(auto filename: filenames) {
#if defined(_WIN64) || defined(_WIN32)
- fs::path filePath(filename.toStdWString());
+ fs::path filePath(filename.toStdWString());
#else
- fs::path filePath(filename.toStdString());
+ fs::path filePath(filename.toStdString());
#endif
- delete m_ui.salesView->model();
- try {
- JsonUtil::importSales(filePath, m_marketplace.get(),
- settings.value("global/cashPointNo").toInt());
- } catch (std::runtime_error &err) {
- QMessageBox(QMessageBox::Icon::Warning, "Import nicht möglich", err.what(), QMessageBox::Ok,
- this)
- .exec();
- }
+ delete m_ui.salesView->model();
+ try {
+ JsonUtil::importSales(filePath, m_marketplace.get(),
+ settings.value("global/cashPointNo").toInt());
+ } catch (std::runtime_error &err) {
+ QMessageBox(QMessageBox::Icon::Warning, "Import nicht möglich", err.what(), QMessageBox::Ok,
+ this)
+ .exec();
}
-
setSaleModel();
updateStatLabel();
}