Commit 7273e7e9 authored by Volker Krause's avatar Volker Krause
Browse files

Port to QRegularExpression

parent 1100ef43
Pipeline #162742 passed with stage
in 4 minutes and 51 seconds
......@@ -635,7 +635,7 @@ void KCMKeyboardWidget::updateXkbShortcutButton(const QString &groupName, QPushB
{
QStringList grpOptions;
if (uiWidget->kcfg_resetOldXkbOptions->isChecked()) {
QRegExp regexp = QRegExp("^" + groupName + Rules::XKB_OPTION_GROUP_SEPARATOR);
QRegularExpression regexp("^" + groupName + Rules::XKB_OPTION_GROUP_SEPARATOR);
XkbOptionsTreeModel *model = dynamic_cast<XkbOptionsTreeModel *>(uiWidget->xkbOptionsTreeView->model());
grpOptions = model->xkbOptions().filter(regexp);
}
......
......@@ -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(QRegExp(xkbGroup->name + ".*"));
int idx = m_xkbOptions.indexOf(QRegularExpression(xkbGroup->name + ".*"));
if (idx >= 0) {
for (int i = 0; i < xkbGroup->optionInfos.count(); i++)
if (xkbGroup->optionInfos[i]->name == m_xkbOptions.at(idx)) {
......
......@@ -11,7 +11,7 @@
#include <KLocalizedString>
#include <QDir>
#include <QRegExp>
#include <QRegularExpression>
#include <QTextDocument> // for Qt::escape
#include <QXmlAttributes>
......@@ -191,7 +191,7 @@ Rules *Rules::readRules(ExtrasFlag extrasFlag)
return nullptr;
}
if (extrasFlag == Rules::READ_EXTRAS) {
QRegExp regex(QStringLiteral("\\.xml$"));
QRegularExpression 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
......
......@@ -21,7 +21,6 @@
#include <KPluginFactory>
#include <KProcess>
#include <QDBusInterface>
#include <QRegExp>
#include <kworkspace.h>
#include "kcmsmserver.h"
......
......@@ -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;
QRegExp camelCase(QStringLiteral("([A-Z])")); // Create the split regexp
QRegularExpression 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
......
Supports Markdown
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