[KSambaShare] Port QRegExp to QRegularExpression
ClosedPublic

Authored by ahmadsamir on Dec 30 2019, 3:48 PM.

Details

Summary

Use QRegularExpression::anchoredPattern() to port QRegExp::exactMatch().
Use a ternary to make the code compact in one place.

Test Plan

make && ctest

Diff Detail

Repository
R241 KIO
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 30 2019, 3:48 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptDec 30 2019, 3:48 PM
ahmadsamir requested review of this revision.Dec 30 2019, 3:48 PM
ahmadsamir updated this revision to Diff 72543.Jan 1 2020, 3:50 PM
ahmadsamir edited the summary of this revision. (Show Details)

Address comments (from other reviews)

dfaure accepted this revision.Jan 1 2020, 6:16 PM
dfaure added inline comments.
src/core/ksambashare.cpp
259 ↗(On Diff #72543)

badPattern was a bad name? ;-)

This revision is now accepted and ready to land.Jan 1 2020, 6:16 PM
ahmadsamir added inline comments.Jan 1 2020, 6:47 PM
src/core/ksambashare.cpp
259 ↗(On Diff #72543)

!notToMatchRx.match() -> "not notToMatchRx" double negative, slightly weird/heavy on the ear.

!badPattern.match() -> "not badPattern" -> valid share name; there's method to my madne^Wlogic, I just need to figure it out... :)

This revision was automatically updated to reflect the committed changes.
dfaure added a comment.Jan 1 2020, 7:16 PM

Now I'm completely confused. Did you just argue *against* your own change?

You seem to say the old name was better...

ahmadsamir added a comment.EditedJan 1 2020, 7:23 PM

Now I'm completely confused. Did you just argue *against* your own change?

You seem to say the old name was better...

The original code, before I put my paws on it, used "notToMarchRx", I changed it to "badPattern", then changed it back, before you reviewed the diff at all; sorry about the confusion.

dfaure added a comment.Jan 1 2020, 8:13 PM

Urgh, my apologies. I must have read a v1-v2 diff then. Oh well, no big deal either way.