mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-03-16 08:29:15 +01:00
OP-1879 remove openpilot hardcoding: use QStandardPaths:CacheLocation for GetStoragePath
This commit is contained in:
parent
11beba3369
commit
95d3de7351
@ -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('/');
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user