Index: sources/view/hd/alarm/VAlarmStatus.cpp =================================================================== diff -u -r814f897483a2ea7369e5e924ac92cf7914c52fa4 -ra84120f4c6d438b4b506a0303806d37c7dcb5615 --- sources/view/hd/alarm/VAlarmStatus.cpp (.../VAlarmStatus.cpp) (revision 814f897483a2ea7369e5e924ac92cf7914c52fa4) +++ sources/view/hd/alarm/VAlarmStatus.cpp (.../VAlarmStatus.cpp) (revision a84120f4c6d438b4b506a0303806d37c7dcb5615) @@ -256,9 +256,12 @@ emit alarm_AlarmIDChanged(_alarm_AlarmID); // to get the dialog content in sync with the Alarm.conf in case there is an early alarm. } -QStringList VAlarmStatus::updateReplacements(const QString &vGroup, const QString &vKey, const int &vAlarmID, const int &vIndex) +QStringList VAlarmStatus::updateReplacements(const QString &vGroup, + const QString &vKey, + const int &vAlarmID, + const int &vIndex) { - QRegExp regx("\\{\\s*\\d+\\s*:\\s*\\d+\\s*:\\s*\\w*\\s*:\\s*\\d*\\s*\\}"); + QRegExp regx("\\{\\s*\\d+\\s*:\\s*\\d+\\s*:\\s*\\w+\\s*:\\s*\\d+\\s*\\}"); QString key = vKey; int replacementCount = key.count(regx); QStringList keyList; @@ -270,11 +273,22 @@ keyList += ""; // value placeholder key.remove(0, pos + regx.matchedLength()); QStringList lst = blk.split(":"); - quint16 id = lst[0].toUInt(); - quint16 ix = lst[1].toUInt(); - QString ex = lst[2] ; - quint16 rd = lst[3].toUInt(); - Q_UNUSED(vGroup); + + if ( lst.size() != 4 ) + continue; + + bool okId = false; + bool okIx = false; + bool okRd = false; + + quint16 id = lst[0].trimmed().toUInt(&okId); + quint16 ix = lst[1].trimmed().toUInt(&okIx); + QString ex = lst[2].trimmed(); + quint16 rd = lst[3].trimmed().toUInt(&okRd); + + if ( ! okId || ! okIx || ! okRd ) + continue; + TLocation loc; loc.group = vGroup ; loc.alarmID = vAlarmID ;