mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 13:30:06 +00:00
Move mbgl cache to application local data storage
This commit is contained in:
parent
5489552ff3
commit
e075e88c7f
2 changed files with 19 additions and 2 deletions
|
|
@ -14,6 +14,7 @@
|
|||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QSplitter>
|
||||
#include <QStandardPaths>
|
||||
#include <QToolButton>
|
||||
|
||||
#include <boost/log/trivial.hpp>
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue