1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-15 07:29:15 +01:00

OP-1879 remove openpilot hardcoding: use QStandardPaths:CacheLocation for GetStoragePath

This commit is contained in:
James Duley 2015-05-15 08:58:25 +01:00 committed by LibrePilot Packager
parent 11beba3369
commit 95d3de7351

View File

@ -29,6 +29,7 @@
#include "xmlconfig.h"
#include <stdint.h>
#include <QDebug>
#include <QStandardPaths>
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('/');
}
/**