on xenial help sign in
search in /system/etc/ubuntu too, in case there is a device tarball override
aa11e01Michael Zanetti
plugins/Utils/deviceconfigparser.cpp+8
@@ -23,6 +23,7 @@
23
23
24DeviceConfigParser::DeviceConfigParser(QObject *parent): QObject(parent)
24DeviceConfigParser::DeviceConfigParser(QObject *parent): QObject(parent)
25{
25{
26+ // Local files have highest priority
26 QString path;
27 QString path;
27 Q_FOREACH (const QString &standardPath, QStandardPaths::standardLocations(QStandardPaths::GenericConfigLocation)) {
28 Q_FOREACH (const QString &standardPath, QStandardPaths::standardLocations(QStandardPaths::GenericConfigLocation)) {
28 if (QFileInfo(standardPath + "/devices.conf").exists()) {
29 if (QFileInfo(standardPath + "/devices.conf").exists()) {
@@ -31,9 +32,16 @@ DeviceConfigParser::DeviceConfigParser(QObject *parent): QObject(parent)
31 }
32 }
32 }
33 }
33
34
35+ // Check if there is an override in the device tarball (/system/etc/)
36+ if (path.isEmpty() && QFileInfo::exists("/system/etc/ubuntu/devices.conf")) {
37+ path = "/system/etc/ubuntu/devices.conf";
38+ }
39+
40+ // No higher priority files found. Use standard of /etc/
34 if (path.isEmpty()) {
41 if (path.isEmpty()) {
35 path = "/etc/ubuntu/devices.conf";
42 path = "/etc/ubuntu/devices.conf";
36 }
43 }
44+
37 qDebug() << "Using" << path << "as device configuration file";
45 qDebug() << "Using" << path << "as device configuration file";
38 m_config = new QSettings(path, QSettings::IniFormat, this);
46 m_config = new QSettings(path, QSettings::IniFormat, this);
39}
47}