Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KAlarm
Commits
32773a54
Commit
32773a54
authored
Aug 02, 2022
by
David Jarvie
Browse files
QRegExp -> QRegularExpression
parent
63963320
Pipeline
#211617
passed with stage
in 2 minutes and 9 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/kalarmcalendar/alarmtext.cpp
View file @
32773a54
...
...
@@ -15,7 +15,7 @@
#include
<QStringList>
#include
<QDateTime>
#include
<QLocale>
#include
<QReg
Exp
>
#include
<QReg
ularExpression
>
namespace
{
...
...
@@ -302,23 +302,29 @@ KAEvent::EmailId AlarmText::emailId() const
*/
QString
AlarmText
::
summary
(
const
KAEvent
&
event
,
int
maxLines
,
bool
*
truncated
)
{
static
const
QReg
Exp
localfil
e
(
QStringLiteral
(
"^file:/+"
));
static
const
QReg
ularExpression
r
e
(
QStringLiteral
(
"^file:/+"
));
QString
text
;
switch
(
event
.
actionSubType
())
{
case
KAEvent
::
AUDIO
:
{
text
=
event
.
audioFile
();
if
(
localfile
.
indexIn
(
text
)
>=
0
)
text
=
text
.
mid
(
localfile
.
matchedLength
()
-
1
);
const
QRegularExpressionMatch
match
=
re
.
match
(
text
);
if
(
match
.
hasMatch
())
text
=
text
.
mid
(
match
.
capturedEnd
(
0
)
-
1
);
break
;
}
case
KAEvent
::
EMAIL
:
text
=
event
.
emailSubject
();
break
;
case
KAEvent
::
COMMAND
:
{
text
=
event
.
cleanText
();
if
(
localfile
.
indexIn
(
text
)
>=
0
)
text
=
text
.
mid
(
localfile
.
matchedLength
()
-
1
);
const
QRegularExpressionMatch
match
=
re
.
match
(
text
);
if
(
match
.
hasMatch
())
text
=
text
.
mid
(
match
.
capturedEnd
(
0
)
-
1
);
break
;
}
case
KAEvent
::
FILE
:
text
=
event
.
cleanText
();
break
;
...
...
src/lib/file.cpp
View file @
32773a54
...
...
@@ -133,7 +133,7 @@ bool showFileErrMessage(const QString& filename, FileErr err, FileErr blankError
*/
QString
pathOrUrl
(
const
QString
&
url
)
{
const
QRegularExpression
re
(
QStringLiteral
(
"^file:/+"
));
static
const
QRegularExpression
re
(
QStringLiteral
(
"^file:/+"
));
const
QRegularExpressionMatch
match
=
re
.
match
(
url
);
return
match
.
hasMatch
()
?
url
.
mid
(
match
.
capturedEnd
(
0
)
-
1
)
:
url
;
}
...
...
src/resources/resourcemodel.cpp
View file @
32773a54
...
...
@@ -677,7 +677,7 @@ bool ResourceView::viewportEvent(QEvent* e)
int
i
=
toolTip
.
indexOf
(
QLatin1Char
(
'@'
));
if
(
i
>
0
)
{
const
int
j
=
toolTip
.
indexOf
(
QReg
Exp
(
QLatin1String
(
"<(nl|br)"
),
Q
t
::
CaseInsensitive
),
i
+
1
);
const
int
j
=
toolTip
.
indexOf
(
QReg
ularExpression
(
QLatin1String
(
"<(nl|br)"
),
Q
RegularExpression
::
CaseInsensitive
Option
),
i
+
1
);
const
int
k
=
toolTip
.
indexOf
(
QLatin1Char
(
'@'
),
j
);
const
QString
name
=
toolTip
.
mid
(
i
+
1
,
j
-
i
-
1
);
value
=
model
()
->
data
(
index
,
Qt
::
FontRole
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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