Port QRegExp to QRegularExpression
ClosedPublic

Authored by ahmadsamir on Dec 20 2019, 8:57 AM.

Details

Summary

Require Qt 5.12 for QRegularExpression::anchoredPattern()

Test Plan

make && ctest

Diff Detail

Repository
R283 KAuth
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ahmadsamir created this revision.Dec 20 2019, 8:57 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptDec 20 2019, 8:57 AM
ahmadsamir requested review of this revision.Dec 20 2019, 8:57 AM
mlaurent requested changes to this revision.Dec 20 2019, 9:49 AM
mlaurent added inline comments.
CMakeLists.txt
14 ↗(On Diff #71872)

kauth is a framework package. You can't increase qt version directly.

This revision now requires changes to proceed.Dec 20 2019, 9:49 AM
ahmadsamir marked an inline comment as done.Dec 20 2019, 12:32 PM
ahmadsamir added inline comments.
CMakeLists.txt
14 ↗(On Diff #71872)

I didn't know that, sorry.

Luckily fixing it is easy in this particular case, I'll anchor the regexp pattern with \A and \z.

ahmadsamir marked an inline comment as done.

Don't touch Qt required version directly for frameworks.

Use \A and \z anchors instead of the convenience function QRegularExpression::anchoredPattern()

ahmadsamir updated this revision to Diff 71948.Dec 21 2019, 2:20 PM

KF5 now requires Qt 5.12

ahmadsamir updated this revision to Diff 72039.Dec 23 2019, 8:15 AM

QRegularExpression is an object like any other, make it const as need be.

dfaure accepted this revision.Jan 1 2020, 10:10 AM
This revision was not accepted when it landed; it landed in state Needs Review.Jan 1 2020, 1:17 PM
This revision was automatically updated to reflect the committed changes.

This appears to have broken policy file generation. The polkit files I now get have

<description xml:lang="Name[de]">Neues Plymouth-Design installieren</description>

Note the "Name" in the xml:lang

This appears to have broken policy file generation. The polkit files I now get have

<description xml:lang="Name[de]">Neues Plymouth-Design installieren</description>

Note the "Name" in the xml:lang

Right. Should be fixed by D27288. I counted wrongly, QRegExp::capturedTexts(1) is QRegularExpressionMatch::captured(1) not captured(0)...