From 95d3de7351eef9aa3592219be097f1c23abc448d Mon Sep 17 00:00:00 2001 From: James Duley Date: Fri, 15 May 2015 08:58:25 +0100 Subject: [PATCH] OP-1879 remove openpilot hardcoding: use QStandardPaths:CacheLocation for GetStoragePath --- ground/openpilotgcs/src/libs/utils/pathutils.cpp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/ground/openpilotgcs/src/libs/utils/pathutils.cpp b/ground/openpilotgcs/src/libs/utils/pathutils.cpp index 8ab1163f3..2f0b234b6 100644 --- a/ground/openpilotgcs/src/libs/utils/pathutils.cpp +++ b/ground/openpilotgcs/src/libs/utils/pathutils.cpp @@ -29,6 +29,7 @@ #include "xmlconfig.h" #include #include +#include namespace Utils { @@ -89,19 +90,7 @@ QString PathUtils::InsertDataPath(QString path) */ QString PathUtils::GetStoragePath() { - // This routine works with "/" as the standard: - // Work out where the settings are stored on the machine - QSettings set(XmlConfig::XmlSettingsFormat, QSettings::UserScope, QLatin1String("OpenPilot"), QLatin1String("OpenPilotGCS_config")); - QFileInfo f(set.fileName()); - QDir dir(f.absoluteDir()); - - const QString homeDirPath = dir.canonicalPath(); - QString storagePath = homeDirPath; - - storagePath += QLatin1Char('/'); - // storagePath += QLatin1String("OpenPilot"); - // storagePath += QLatin1Char('/'); - return storagePath; + return QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QLatin1Char('/'); } /**