use path to save json file (sellers)

This commit is contained in:
Martin Brodbeck 2018-08-09 13:16:00 +02:00
parent 0967a01994
commit 0a1d946397
3 changed files with 6 additions and 4 deletions

View File

@ -5,10 +5,10 @@
#include <fstream>
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";

View File

@ -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);

View File

@ -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()