diff options
author | Grigorii Zimin <gzimin@luxoft.com> | 2019-10-16 10:59:52 +0300 |
---|---|---|
committer | Grigorii Zimin <gzimin@luxoft.com> | 2019-12-02 10:43:32 +0000 |
commit | fd42d077b0325c65e94bb9b1361054d40cd90356 (patch) | |
tree | 78e643d34042bb149b2ceda822be52b9c066af05 | |
parent | 847417cbeb773ec6bccfd6cfda438d21f3420448 (diff) |
[mapplugin] extend map plugin to prevent mixing
Update mapshelper plugin with an option to separate maps caches.
Task-number: AUTOSUITE-1273
Change-Id: Id427280b6fd4a785164c0e636d3f677dd653815a
Reviewed-by: Egor Nemtsev <enemtsev@luxoft.com>
-rw-r--r-- | plugins/com.pelagicore.map/mapshelper.cpp | 6 | ||||
-rw-r--r-- | plugins/com.pelagicore.map/mapshelper.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/plugins/com.pelagicore.map/mapshelper.cpp b/plugins/com.pelagicore.map/mapshelper.cpp index 0220c492..9bf38276 100644 --- a/plugins/com.pelagicore.map/mapshelper.cpp +++ b/plugins/com.pelagicore.map/mapshelper.cpp @@ -57,12 +57,14 @@ QString MapsHelper::appPath() const return m_appPath; } -void MapsHelper::initMap() +void MapsHelper::initMap(const QString &uniqueDirName) { // copy mapboxgl offline DB const QString sourceFile = m_appPath + QStringLiteral("maps/mapboxgl.db"); const QString destDir = QStandardPaths::writableLocation(QStandardPaths::CacheLocation); - const QString destFile = destDir + QStringLiteral("/mapboxgl.db"); + const QString destFile = destDir + + (uniqueDirName.isEmpty() ? uniqueDirName : '/' + uniqueDirName) + + QStringLiteral("/mapboxgl.db"); QString subSourceFile = sourceFile.mid(7); QDir dir; diff --git a/plugins/com.pelagicore.map/mapshelper.h b/plugins/com.pelagicore.map/mapshelper.h index 036f05ea..8bbaf0fa 100644 --- a/plugins/com.pelagicore.map/mapshelper.h +++ b/plugins/com.pelagicore.map/mapshelper.h @@ -48,7 +48,7 @@ public: void setAppPath(const QString &appPath); QString appPath() const; - Q_INVOKABLE void initMap(); + Q_INVOKABLE void initMap(const QString &uniqueDirName = QString()); signals: void appPathChanged(); |