diff --git a/scwx-qt/source/scwx/qt/main/main_window.cpp b/scwx-qt/source/scwx/qt/main/main_window.cpp index fd72560c..fd237a56 100644 --- a/scwx-qt/source/scwx/qt/main/main_window.cpp +++ b/scwx-qt/source/scwx/qt/main/main_window.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -41,7 +42,23 @@ public: elevationButtonsChanged_ {false}, resizeElevationButtons_ {false} { - settings_.setCacheDatabasePath("/tmp/mbgl-cache.db"); + std::string appDataPath { + QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + .toStdString()}; + std::string cacheDbPath {appDataPath + "/mbgl-cache.db"}; + + if (!std::filesystem::exists(appDataPath)) + { + if (!std::filesystem::create_directories(appDataPath)) + { + BOOST_LOG_TRIVIAL(error) + << logPrefix_ + << "Unable to create application local data directory: \"" + << appDataPath << "\""; + } + } + + settings_.setCacheDatabasePath(QString {cacheDbPath.c_str()}); settings_.setCacheDatabaseMaximumSize(20 * 1024 * 1024); } ~MainWindowImpl() = default; diff --git a/scwx-qt/ts/scwx_en_US.ts b/scwx-qt/ts/scwx_en_US.ts index 030a9249..35c2eac2 100644 --- a/scwx-qt/ts/scwx_en_US.ts +++ b/scwx-qt/ts/scwx_en_US.ts @@ -102,7 +102,7 @@ scwx::qt::main::MainWindow - + Unrecognized NEXRAD Product: