mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-20 10:54:14 +01:00
LP-419 add handling of os specific default GCS configuration file
if a os specific file (for example default_linux.xml) is found it will be loaded alongside the common default.xml file. no os specific dfault files are provided yet...
This commit is contained in:
parent
f00e40da4f
commit
47d9219a09
@ -36,6 +36,7 @@
|
||||
|
||||
namespace Utils {
|
||||
static const QString DEFAULT_CONFIG_DIRNAME = "configurations";
|
||||
|
||||
static const QString DEFAULT_CONFIG_FILENAME = "default.xml";
|
||||
|
||||
const QLatin1String CONFIG_OPTION("-D");
|
||||
@ -196,16 +197,25 @@ void initSettings(const QString &factoryDefaultsFileName)
|
||||
|
||||
QStringList files;
|
||||
|
||||
// defaults
|
||||
// common default
|
||||
files << fileName;
|
||||
|
||||
// OS specific default
|
||||
#ifdef Q_OS_MAC
|
||||
files << directory.absoluteFilePath("default_macos.xml");
|
||||
#elif defined(Q_OS_LINUX)
|
||||
files << directory.absoluteFilePath("default_linux.xml");
|
||||
#else
|
||||
files << directory.absoluteFilePath("default_windows.xml");
|
||||
#endif
|
||||
|
||||
foreach(QString file, files) {
|
||||
file = checkFile(file);
|
||||
|
||||
QSettings const *settings = new QSettings(file, XmlConfig::XmlFormat);
|
||||
qDebug() << "settings - loaded factory defaults" << file;
|
||||
|
||||
factorySettingsList.append(settings);
|
||||
if (!file.isEmpty()) {
|
||||
QSettings const *settings = new QSettings(file, XmlConfig::XmlFormat);
|
||||
qDebug() << "settings - loaded factory defaults" << file;
|
||||
factorySettingsList.append(settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user