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
Plasma
Plasma Desktop
Commits
7273e7e9
Commit
7273e7e9
authored
Mar 29, 2022
by
Volker Krause
Browse files
Port to QRegularExpression
parent
1100ef43
Pipeline
#162742
passed with stage
in 4 minutes and 51 seconds
Changes
5
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
kcms/keyboard/kcm_keyboard_widget.cpp
View file @
7273e7e9
...
...
@@ -635,7 +635,7 @@ void KCMKeyboardWidget::updateXkbShortcutButton(const QString &groupName, QPushB
{
QStringList
grpOptions
;
if
(
uiWidget
->
kcfg_resetOldXkbOptions
->
isChecked
())
{
QReg
Exp
regexp
=
QRegE
xp
(
"^"
+
groupName
+
Rules
::
XKB_OPTION_GROUP_SEPARATOR
);
QReg
ularExpression
rege
xp
(
"^"
+
groupName
+
Rules
::
XKB_OPTION_GROUP_SEPARATOR
);
XkbOptionsTreeModel
*
model
=
dynamic_cast
<
XkbOptionsTreeModel
*>
(
uiWidget
->
xkbOptionsTreeView
->
model
());
grpOptions
=
model
->
xkbOptions
().
filter
(
regexp
);
}
...
...
kcms/keyboard/kcm_view_models.cpp
View file @
7273e7e9
...
...
@@ -436,7 +436,7 @@ bool XkbOptionsTreeModel::setData(const QModelIndex &index, const QVariant &valu
if
(
value
.
toInt
()
==
Qt
::
Checked
)
{
if
(
xkbGroup
->
exclusive
)
{
// clear if exclusive (TODO: radiobutton)
int
idx
=
m_xkbOptions
.
indexOf
(
QReg
Exp
(
xkbGroup
->
name
+
".*"
));
int
idx
=
m_xkbOptions
.
indexOf
(
QReg
ularExpression
(
xkbGroup
->
name
+
".*"
));
if
(
idx
>=
0
)
{
for
(
int
i
=
0
;
i
<
xkbGroup
->
optionInfos
.
count
();
i
++
)
if
(
xkbGroup
->
optionInfos
[
i
]
->
name
==
m_xkbOptions
.
at
(
idx
))
{
...
...
kcms/keyboard/xkb_rules.cpp
View file @
7273e7e9
...
...
@@ -11,7 +11,7 @@
#include
<KLocalizedString>
#include
<QDir>
#include
<QReg
Exp
>
#include
<QReg
ularExpression
>
#include
<QTextDocument>
// for Qt::escape
#include
<QXmlAttributes>
...
...
@@ -191,7 +191,7 @@ Rules *Rules::readRules(ExtrasFlag extrasFlag)
return
nullptr
;
}
if
(
extrasFlag
==
Rules
::
READ_EXTRAS
)
{
QReg
Exp
regex
(
QStringLiteral
(
"
\\
.xml$"
));
QReg
ularExpression
regex
(
QStringLiteral
(
"
\\
.xml$"
));
Rules
*
rulesExtra
=
new
Rules
();
QString
extraRulesFile
=
rulesFile
.
replace
(
regex
,
QStringLiteral
(
".extras.xml"
));
if
(
readRules
(
rulesExtra
,
extraRulesFile
,
true
))
{
// not fatal if it fails
...
...
kcms/ksmserver/kcmsmserver.cpp
View file @
7273e7e9
...
...
@@ -21,7 +21,6 @@
#include
<KPluginFactory>
#include
<KProcess>
#include
<QDBusInterface>
#include
<QRegExp>
#include
<kworkspace.h>
#include
"kcmsmserver.h"
...
...
kcms/solid_actions/SolidActionData.cpp
View file @
7273e7e9
...
...
@@ -9,6 +9,7 @@
#include
<QDirIterator>
#include
<QList>
#include
<QMetaProperty>
#include
<QRegularExpression>
#include
<KConfigGroup>
#include
<KDesktopFile>
...
...
@@ -132,7 +133,7 @@ int SolidActionData::interfacePosition(Solid::DeviceInterface::Type devInterface
QString
SolidActionData
::
generateUserString
(
QString
className
)
{
QString
finalString
;
QReg
Exp
camelCase
(
QStringLiteral
(
"([A-Z])"
));
// Create the split regexp
QReg
ularExpression
camelCase
(
QStringLiteral
(
"([A-Z])"
));
// Create the split regexp
finalString
=
className
.
remove
(
0
,
className
.
lastIndexOf
(
':'
)
+
1
);
// Remove any Class information
finalString
.
replace
(
camelCase
,
QStringLiteral
(
"
\\
1"
));
// Use Camel Casing to add spaces
...
...
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