D26366: [Kuit] Port QRegExp to QRegularExpression, third pass

David Faure noreply at phabricator.kde.org
Fri Jan 3 08:33:07 GMT 2020


dfaure requested changes to this revision.
dfaure added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> kuitmarkup.cpp:90
>  
> -        // Role.
> -        roleName = context;
> +    static const QRegularExpression wsRx(QStringLiteral("^@(\\w+):?(\\w*)/?(\\w*)"));
> +    const QRegularExpressionMatch match = wsRx.match(context);

Interesting idea, this simplifies the code.

However the name "wsRx" no longer matches what this regexp does.

Also, the old trimming is missing here, isn't it?
I guess \s*:?\s* is needed, and \s*/?\s*

Can you look into adding unittests for this stuff? Although I'm not sure if that's possible.

REPOSITORY
  R249 KI18n

REVISION DETAIL
  https://phabricator.kde.org/D26366

To: ahmadsamir, #frameworks, ilic, dfaure, mlaurent, aacid
Cc: kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200103/87fb4549/attachment.html>


More information about the Kde-frameworks-devel mailing list