Commit 105c38d7 authored by Giacomo Strangolino's avatar Giacomo Strangolino
Browse files

fixed regexp for tg domain match

parent 7fc5d1a8
......@@ -231,7 +231,7 @@ void AlarmTreeWidget::m_insert_item(const QString& src, const QStringList &list,
item->setData(AlarmTreeWidgetItem::DateTime, Qt::UserRole, list.at(AlarmTreeWidgetItem::DateTime).toUInt());
item->setData(AlarmTreeWidgetItem::Status, Qt::UserRole, m_status_to_int(list.at(AlarmTreeWidgetItem::Status)));
QString s = src.section('/', 0, src.count('/') - 1);
QRegularExpression re("[tango://]*(.*):\\d+/(.*)");
QRegularExpression re("(?:tango://)*(.*):\\d+/(.*)");
QRegularExpressionMatch ma = re.match(s);
if(ma.capturedTexts().size() > 2) {
QString s = ma.capturedTexts().at(1);
......
......@@ -22,8 +22,9 @@
****************************************************************************/
#include <QtGui>
#include <cumacros.h>
#include "mysqlmodel.h"
#include <QtDebug>
MySqlModel::MySqlModel(QObject *parent) : QSqlQueryModel(parent)
{
......@@ -39,7 +40,7 @@ QVariant MySqlModel::data(const QModelIndex &index, int role) const
}
else if(index.column() == 1) {
// remove long fully qualified name
QRegularExpression re("[tango://]*(.*):\\d+/(.*)");
QRegularExpression re("(?:tango://)*(.*):\\d+/(.*)");
QString s = value.toString();
QRegularExpressionMatch ma = re.match(s);
if(ma.capturedTexts().size() > 2) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment