diff --git a/src/core/excelreader.cpp b/src/core/excelreader.cpp index 37e2d80..4453988 100644 --- a/src/core/excelreader.cpp +++ b/src/core/excelreader.cpp @@ -3,9 +3,7 @@ #include #include -namespace fs = std::filesystem; - -void ExcelReader::readSellersFromFile(const fs::path& filePath, Marketplace* market) +void ExcelReader::readSellersFromFile(const std::filesystem::path& filePath, Marketplace* market) { xlnt::workbook wb; std::ifstream mystream(filePath, std::ios::binary); diff --git a/src/core/jsonutil.cpp b/src/core/jsonutil.cpp index ab4f86c..cb6de76 100644 --- a/src/core/jsonutil.cpp +++ b/src/core/jsonutil.cpp @@ -5,9 +5,7 @@ #include -namespace fs = std::filesystem; - -void JsonUtil::exportSellers(const fs::path& filePath, Marketplace* market) +void JsonUtil::exportSellers(const std::filesystem::path& filePath, Marketplace* market) { Json::Value root; std::ofstream file(filePath); @@ -31,7 +29,7 @@ void JsonUtil::exportSellers(const fs::path& filePath, Marketplace* market) writer->write(root, &file); } -void JsonUtil::importSellers(const fs::path& filePath, Marketplace* market) +void JsonUtil::importSellers(const std::filesystem::path& filePath, Marketplace* market) { for (auto& seller : market->getSellers()) { seller->setState(Seller::State::DELETE); @@ -69,7 +67,7 @@ void JsonUtil::importSellers(const fs::path& filePath, Marketplace* market) market->storeToDb(); } -void JsonUtil::exportSales(const fs::path& filePath, Marketplace* market, int cashPointNo) +void JsonUtil::exportSales(const std::filesystem::path& filePath, Marketplace* market, int cashPointNo) { Json::Value root; std::ofstream file(filePath); @@ -108,7 +106,7 @@ void JsonUtil::exportSales(const fs::path& filePath, Marketplace* market, int ca writer->write(root, &file); } -void JsonUtil::importSales(const fs::path& filePath, Marketplace* market, int cashPointNo) +void JsonUtil::importSales(const std::filesystem::path& filePath, Marketplace* market, int cashPointNo) { Json::Value jsonValues; std::ifstream file(filePath); diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 28c4d6d..b643204 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -24,8 +24,6 @@ #include #include -namespace fs = std::filesystem; - constexpr int STATUSBAR_TIMEOUT = 5000; MainWindow::MainWindow() @@ -380,7 +378,7 @@ void MainWindow::onImportSellerExcelActionTriggered() if (filename.isEmpty()) return; - fs::path filePath(filename.toStdWString()); + std::filesystem::path filePath(filename.toStdWString()); ExcelReader::readSellersFromFile(filePath, marketplace_.get()); } @@ -401,7 +399,7 @@ void MainWindow::onImportSellerJsonActionTriggered() if (filename.isEmpty()) return; - fs::path filePath(filename.toStdWString()); + std::filesystem::path filePath(filename.toStdWString()); JsonUtil::importSellers(filePath, marketplace_.get()); } @@ -414,7 +412,7 @@ void MainWindow::onExportSellerJsonActionTriggered() if (filename.isEmpty()) return; - fs::path filePath(filename.toStdWString()); + std::filesystem::path filePath(filename.toStdWString()); JsonUtil::exportSellers(filePath, marketplace_.get()); } @@ -429,7 +427,7 @@ void MainWindow::onExportSalesJsonActionTriggered() if (filename.isEmpty()) return; - fs::path filePath(filename.toStdWString()); + std::filesystem::path filePath(filename.toStdWString()); JsonUtil::exportSales(filePath, marketplace_.get(), settings.value("global/cashPointNo").toInt()); @@ -445,7 +443,7 @@ void MainWindow::onImportSalesJsonActionTriggered() if (filename.isEmpty()) return; - fs::path filePath(filename.toStdWString()); + std::filesystem::path filePath(filename.toStdWString()); delete ui_.salesView->model(); try {