@@ -19,15 +19,22 @@
19#include <QSettings>
19#include <QSettings>
20#include <QFileInfo>
20#include <QFileInfo>
21#include <QDebug>
21#include <QDebug>
22+#include <QStandardPaths>
23DeviceConfigParser::DeviceConfigParser(QObject *parent): QObject(parent)
24DeviceConfigParser::DeviceConfigParser(QObject *parent): QObject(parent)
25 QString path;
26 QString path;
27+ Q_FOREACH (const QString &standardPath, QStandardPaths::standardLocations(QStandardPaths::GenericConfigLocation)) {
26− if (QFileInfo("./devices.conf").exists()) {
28+ if (QFileInfo(standardPath + "/devices.conf").exists()) {
27− path = "./devices.conf";
29+ path = standardPath + "/devices.conf";
34+ if (path.isEmpty()) {
29 path = "/etc/ubuntu/devices.conf";
35 path = "/etc/ubuntu/devices.conf";
37+ qDebug() << "Using" << path << "as device configuration file";
31 m_config = new QSettings(path, QSettings::IniFormat, this);
38 m_config = new QSettings(path, QSettings::IniFormat, this);