QRegExp is supposed to only exist in Qt6 in a Qt5Support lib, good enough for apps initially, but not for frameworks, most importantly not as part of exported API.
Description
Details
- Differential Revisions
- D28880: [KWallet] Port last usage of QRegExp to QRegularExpression
D28726: [KJS] Port QRegExp to QRegularExpression
D26453: [Purpose] Port QRegExp to QRegularExpression
D26412: [Kuit] Port QRegExp to QRegularExpression
D26285: [KuitFormatterPrivate] Start porting QRegExp to QRegularExpression
D26339: [KFileWidgets] Port QRegExp to QRegularExpression
D26236: Port QRegExp to QRegularExpression (and some QStringRef optimisation)
D26226: [KListOpenFilesJob] Use QString::splitRef()
D26106: Port QRegExp to QRegularExpression
D26099: Port QRegExp to QRegularExpression
D26210: [KCoreAddons] Port QRegExp to QRegularExpression
D26157: Port QRegExp to QRegularExpression
D26156: [KDocTools] Port QRegExp to QRegularExpression
D26119: Port QRegExp to QRegularExpression
D26145: Port QRegExp to QRegularExpression
D26123: Port QRegExp to QRegularExpression
D26118: Port QRegExp to QRegularExpression
Related Objects
- Mentioned In
- R311:5bbe2a77a7af: [KWallet] Port last usage of QRegExp to QRegularExpression
R314:da9d1e44ebf2: [KJS] Port QRegExp to QRegularExpression
R172:b1ef796e56b7: Port QRegExp to QRegularExpression
R293:eec35486c419: Port QRegExp to QRegularExpression
R495:8dc165f088f3: [Purpose] Port QRegExp to QRegularExpression
R283:b2975d8e630c: Port QRegExp to QRegularExpression
R241:ee88418ec827: Port QRegExp to QRegularExpression (and some QStringRef optimisation)
R244:9578a7d875f1: [KCoreAddons] Port QRegExp to QRegularExpression
R270:7310a343212a: Port QRegExp to QRegularExpression
R238:36fae9517502: [KDocTools] Port QRegExp to QRegularExpression
R174:66ed335757c5: Port QRegExp to QRegularExpression
R299:8376e5f664a9: Port QRegExp to QRegularExpression - Mentioned Here
- D28978: [PluginLoader] Replace one usage of QRegExp with QString::startsWith()
It's still used a lot.
It's used in non-deprecated public API in:
- ktextwidgets: kfind, kreplace
- kcoreaddons: kstringhandler
- ktexteditor: kateregexp, vimode
- kio: kcoredirlister
Frameworks that use QRegExp but are probably going to be deprecated (based on the KF6 workboard):
kemoticons
khtml
kinit
kross
kwallet
Frameworks that still use QRegExp:
kactivities-stats
kdelibs4support - does this one need to be ported or not?
knewstuff - kmoretools
ktexteditor
plasma-framework - pluginloader
And of course apps in various places, extragear, kdeedu, plasma-workspace ... etc. Are apps included in the scope of this task?
You can skip kemoticons, khtml, kinit, kross, and kdelibs4support.
I don't see any work happening on replacing kwallet so honestly at this point I don't see it going away, the board item might be wishful thinking.
The task title is "port *frameworks* away from QRegExp" so the apps are not in scope. But of course that doesn't mean it's not useful to do so :-)
Status report:
It seems that porting plasma-framework is a bit problematic see D28978, it's only one place where QRegExp is used so not a problem.
What remains:
kactivities-stats
ktexteditor
KTextEditor: porting the search interface to QRegularExression:
https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/7
some parts still in ktexteditor still use QRegExp.
OK, that's been merged o/. Some parts remain in ktexteditor, I'll hopefully get to them soon.
However, the vimode is a black box for me, I don't use it and it has many quirks; and while it has an extensive collection of unit tests, I don't want to attempt porting it unless someone who actually uses it volunteers to test (I'll make sure all vimode unit tests still pass).
kactivities-stats, is it still used/needed?
KWallet was ported.
kactivities-stats https://invent.kde.org/frameworks/kactivities-stats/-/merge_requests/9
KTextEditor only has the vimode-related code still not ported to QRE.
plasma-framework: src/declarativeimports/core/datamodel , I don't know how to port this one, keep the QRegExp stuff and add new methods for QRE, or replace QRegExp with QRE? and how to handle DataModel::setKeyRoleFilter()?
I'll look into it (at first glance I forgot to wrap some #include <QRegExp> in deprecation wrappers).
OK, only kreplacedialog.cpp is still using QRegExp in a _k_slotOk(), I must have missed it the first time around; looking at the code now, it doesn't seem to be used by anything, I commented it out completely and it still compiled just fine. I'll create an MR.
That was implied by not being included in my "what remains" posts :)
So, what remains now is the vimode parts in KTextEditors.
KTexEditor vimode was ported by @jbatrina:
https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/62
https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/67
and the remaining usage of QRegExp in KTextEditor has been ported:
https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/85
So KTextEditor is now all ported.
Remains plasma-framework:
plasma-framework: src/declarativeimports/core/datamodel , I don't know how to port this one, keep the QRegExp stuff and add new methods for QRE, or replace QRegExp with QRE? and how to handle DataModel::setKeyRoleFilter()?
I asked on Plasma on IRC (luckily the plasma team were having their weekly meeting, so I got an answer quickly :)). According to @davidedmundson the plasma-framework/src/declarativeimports/core/datamodel* will be dropped in KF6 (along with DataEngines in plasma in general), so no need to port it to QRegularExpression.