From 87629ba85ac7ea6675d7d4ba7565d5ae15d156cb Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Tue, 26 Nov 2019 10:23:05 -0800 Subject: tbtnavi: add qml invokable function for cache location Bug-AGL: SPEC-2985 Change-Id: I5b412e968cac0d1034be35822de3bff70bb073c1 Signed-off-by: Matt Ranostay --- app/file_operation.cpp | 12 ++++++++++++ app/file_operation.h | 1 + 2 files changed, 13 insertions(+) diff --git a/app/file_operation.cpp b/app/file_operation.cpp index 8da7227..ff51b19 100644 --- a/app/file_operation.cpp +++ b/app/file_operation.cpp @@ -1,3 +1,4 @@ +#include #include "file_operation.h" File_Operation::File_Operation(){ @@ -101,3 +102,14 @@ double File_Operation::getStartLongitude(){ QString File_Operation::getMapStyleUrls() { return m_mapStyleUrls; } + +QString File_Operation::getCachePath(QString name) +{ + QString path("/var/run/user/"); + + path.append(QString::number(getuid())); + path.append("/usrshr/cache/"); + path.append(name); + + return path; +} diff --git a/app/file_operation.h b/app/file_operation.h index 8d28bfb..da753a8 100644 --- a/app/file_operation.h +++ b/app/file_operation.h @@ -36,6 +36,7 @@ public: Q_INVOKABLE double getStartLongitude(); Q_INVOKABLE QString getMapStyleUrls(); Q_INVOKABLE bool isOSMEnabled() { return m_enable_osm; }; + Q_INVOKABLE QString getCachePath(QString name); private: void initFileOperation(); -- cgit 1.2.3-korg