@@ -19,15 +19,22 @@
1919#include <QSettings>
2020#include <QFileInfo>
2121#include <QDebug>
22+#include <QStandardPaths>
2223
2324DeviceConfigParser::DeviceConfigParser(QObject *parent): QObject(parent)
2425{
2526 QString path;
26− if (QFileInfo("./devices.conf").exists()) {
27− path = "./devices.conf";
28− } else {
27+ Q_FOREACH (const QString &standardPath, QStandardPaths::standardLocations(QStandardPaths::GenericConfigLocation)) {
28+ if (QFileInfo(standardPath + "/devices.conf").exists()) {
29+ path = standardPath + "/devices.conf";
30+ break;
31+ }
32+ }
33+
34+ if (path.isEmpty()) {
2935 path = "/etc/ubuntu/devices.conf";
3036 }
37+ qDebug() << "Using" << path << "as device configuration file";
3138 m_config = new QSettings(path, QSettings::IniFormat, this);
3239}
3340