diff --git a/src/core/jsonutil.cpp b/src/core/jsonutil.cpp index b4d9dc3..cb6de76 100644 --- a/src/core/jsonutil.cpp +++ b/src/core/jsonutil.cpp @@ -5,10 +5,10 @@ #include -void JsonUtil::exportSellers(const std::string& filename, Marketplace* market) +void JsonUtil::exportSellers(const std::filesystem::path& filePath, Marketplace* market) { 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 d85d79f..3663dcc 100644 --- a/src/core/jsonutil.h +++ b/src/core/jsonutil.h @@ -9,7 +9,7 @@ class JsonUtil { public: - static void exportSellers(const std::string& filename, Marketplace* market); + static void exportSellers(const std::filesystem::path& filePath, Marketplace* market); static void importSellers(const std::filesystem::path& filePath, Marketplace* market); 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 d9a1da5..b643204 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -412,7 +412,9 @@ void MainWindow::onExportSellerJsonActionTriggered() if (filename.isEmpty()) return; - JsonUtil::exportSellers(filename.toStdString(), marketplace_.get()); + std::filesystem::path filePath(filename.toStdWString()); + + JsonUtil::exportSellers(filePath, marketplace_.get()); } void MainWindow::onExportSalesJsonActionTriggered()