@@ -40,7 +40,7 @@ RowLayout {
Label {
Layout.alignment: Qt.AlignRight
Layout.rightMargin: Kirigami.Units.smallSpacing
- text: !!fan ? fan.path : ""
+ text: !!fan ? fan.id : ""
horizontalAlignment: Text.AlignRight
}
@@ -40,4 +40,13 @@ Sensor::Sensor(Hwmon *parent, uint index, const QString &type, bool device) : QO
connect(this, &Sensor::error, parent, &Hwmon::error);
+void Sensor::setId(const QString& id)
+{
+ if (m_id == id)
+ return;
+
+ m_id = id;
+}
@@ -64,7 +64,7 @@ signals:
protected:
- QString m_id;
+ void setId(const QString &id);
private:
@@ -72,6 +72,7 @@ private:
Hwmon *const m_parent;
const uint m_index;
QString m_path;
+ QString m_id;
bool m_device;
};
@@ -70,7 +70,7 @@ Temp::Temp(uint index, Hwmon *parent, bool device) :
if (labelFile->open(QFile::ReadOnly))
{
m_label = QTextStream(labelFile).readLine();
- m_id = parent->name() + "/" + m_label;
+ setId(parent->name() + "/" + m_label);
else
emit error(i18n("Can't open label file: \'%1\'", path + "/temp" + QString::number(index) + "_label"));