diff --git a/src/core/jsonutil.cpp b/src/core/jsonutil.cpp index 9d3bde3..b4d9dc3 100644 --- a/src/core/jsonutil.cpp +++ b/src/core/jsonutil.cpp @@ -67,10 +67,10 @@ void JsonUtil::importSellers(const std::filesystem::path& filePath, Marketplace* market->storeToDb(); } -void JsonUtil::exportSales(const std::string& filename, Marketplace* market, int cashPointNo) +void JsonUtil::exportSales(const std::filesystem::path& filePath, Marketplace* market, int cashPointNo) { Json::Value root; - std::ofstream file(filename); + std::ofstream file(filePath); Json::StreamWriterBuilder builder; builder["commentStyle"] = "None"; diff --git a/src/core/jsonutil.h b/src/core/jsonutil.h index 9ec6ddc..d85d79f 100644 --- a/src/core/jsonutil.h +++ b/src/core/jsonutil.h @@ -11,7 +11,7 @@ class JsonUtil public: static void exportSellers(const std::string& filename, Marketplace* market); static void importSellers(const std::filesystem::path& filePath, Marketplace* market); - static void exportSales(const std::string& filename, Marketplace* market, int cashPointNo); + static void exportSales(const std::filesystem::path& filePath, Marketplace* market, int cashPointNo); static void importSales(const std::filesystem::path& filePath, Marketplace* market, int cashPointNo); }; diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 280ca62..d9a1da5 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -425,7 +425,9 @@ void MainWindow::onExportSalesJsonActionTriggered() if (filename.isEmpty()) return; - JsonUtil::exportSales(filename.toStdString(), marketplace_.get(), + std::filesystem::path filePath(filename.toStdWString()); + + JsonUtil::exportSales(filePath, marketplace_.get(), settings.value("global/cashPointNo").toInt()); }