Browse Source

added configPath property to loader

Maldela 8 years ago
parent
commit
0c1ee404be
2 changed files with 3 additions and 1 deletions
  1. 1 1
      fancontrol-gui/package/contents/ui/ConfigfileTab.qml
  2. 2 0
      import/src/loader.h

+ 1 - 1
fancontrol-gui/package/contents/ui/ConfigfileTab.qml

@@ -32,7 +32,7 @@ ColumnLayout {
 
 
     Label {
     Label {
         anchors.top: parent.top
         anchors.top: parent.top
-        text: !!loader ? decodeURIComponent(loader.configUrl) : ""
+        text: !!loader ? decodeURIComponent(loader.configPath) : ""
     }
     }
 
 
     Rectangle {
     Rectangle {

+ 2 - 0
import/src/loader.h

@@ -45,6 +45,7 @@ class Loader : public QObject
 {
 {
     Q_OBJECT
     Q_OBJECT
     Q_PROPERTY(QUrl configUrl READ configUrl NOTIFY configUrlChanged)
     Q_PROPERTY(QUrl configUrl READ configUrl NOTIFY configUrlChanged)
+    Q_PROPERTY(QString configPath READ configPath NOTIFY configUrlChanged)
     Q_PROPERTY(QString configFile READ configFile NOTIFY configFileChanged)
     Q_PROPERTY(QString configFile READ configFile NOTIFY configFileChanged)
     Q_PROPERTY(QList<QObject *> hwmons READ hwmonsAsObjects NOTIFY hwmonsChanged)
     Q_PROPERTY(QList<QObject *> hwmons READ hwmonsAsObjects NOTIFY hwmonsChanged)
     Q_PROPERTY(int interval READ interval WRITE setInterval NOTIFY intervalChanged)
     Q_PROPERTY(int interval READ interval WRITE setInterval NOTIFY intervalChanged)
@@ -63,6 +64,7 @@ public:
     Q_INVOKABLE void abortTestingFans();
     Q_INVOKABLE void abortTestingFans();
     Q_INVOKABLE void detectSensors();
     Q_INVOKABLE void detectSensors();
     QUrl configUrl() const { return m_configUrl; }
     QUrl configUrl() const { return m_configUrl; }
+    QString configPath() const { return m_configUrl.path(); }
     QString configFile() const { return m_configFile; }
     QString configFile() const { return m_configFile; }
     QList<Hwmon *> hwmons() const { return m_hwmons; }
     QList<Hwmon *> hwmons() const { return m_hwmons; }
     bool sensorsDetected() const { return m_sensorsDetected; }
     bool sensorsDetected() const { return m_sensorsDetected; }