Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cs
gui
alarm-ng
Commits
105c38d7
Commit
105c38d7
authored
Jul 09, 2021
by
Giacomo Strangolino
Browse files
fixed regexp for tg domain match
parent
7fc5d1a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/AlarmTreeWidget.cpp
View file @
105c38d7
...
...
@@ -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
);
...
...
src/mysqlmodel.cpp
View file @
105c38d7
...
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment