|
|
@ -16,18 +16,15 @@ Settings *Settings::_singleton = NULL; |
|
|
|
|
|
|
|
Settings::Settings() |
|
|
|
{ |
|
|
|
m_rooms_names << QString(tr("Bedroom")); |
|
|
|
m_rooms_names << QString(tr("Workspace")); |
|
|
|
m_rooms_names << QString(tr("Living room")); |
|
|
|
m_rooms_names << QString(tr("Bathroom")); |
|
|
|
m_sensor_topics << QString::fromUtf8("sensors/chambre_so/xiaomi"); |
|
|
|
m_sensor_topics << QString::fromUtf8("sensors/chambre_rico/xiaomi"); |
|
|
|
m_sensor_topics << QString::fromUtf8("sensors/salon/xiaomi"); |
|
|
|
m_sensor_topics << QString::fromUtf8("sensors/salle_de_bains/xiaomi"); |
|
|
|
m_availability_topics << QString::fromUtf8("sensors/chambre_so/availability"); |
|
|
|
m_availability_topics << QString::fromUtf8("sensors/chambre_rico/availability"); |
|
|
|
m_availability_topics << QString::fromUtf8("sensors/salon/availability"); |
|
|
|
m_availability_topics << QString::fromUtf8("sensors/salle_de_bains/availability"); |
|
|
|
QSettings s; |
|
|
|
(void)s.beginReadArray("rooms"); |
|
|
|
for (int i = 0; i < NB_ZONES; ++i) { |
|
|
|
s.setArrayIndex(i); |
|
|
|
m_rooms_names << s.value("name", "").toString(); |
|
|
|
m_sensor_topics << s.value("sensor_topic", "").toString(); |
|
|
|
m_availability_topics << s.value("availability_topic", "").toString(); |
|
|
|
} |
|
|
|
s.endArray(); |
|
|
|
} |
|
|
|
|
|
|
|
Settings::~Settings() |
|
|
|