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 "xmlconfig.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QStandardPaths>
|
||||||
|
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
@ -89,19 +90,7 @@ QString PathUtils::InsertDataPath(QString path)
|
|||||||
*/
|
*/
|
||||||
QString PathUtils::GetStoragePath()
|
QString PathUtils::GetStoragePath()
|
||||||
{
|
{
|
||||||
// This routine works with "/" as the standard:
|
return QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QLatin1Char('/');
|
||||||
// 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user