D26156: [KDocTools] Port QRegExp to QRegularExpression

Aleix Pol Gonzalez noreply at phabricator.kde.org
Mon Dec 23 02:18:33 GMT 2019


apol added a comment.


  LGTM otherwise

INLINE COMMENTS

> docbookl10nhelper.cpp:158
>       **/
> -    QRegExp rxEntity, rxEntity2, rxDocType, rxDocType2;
> -    rxDocType.setPattern(QStringLiteral("^\\s*<!DOCTYPE\\s+l:i18n\\s+SYSTEM\\s+\"l10n\\.dtd\"\\s+\\[\\s*$"));
> -    rxDocType2.setPattern(QStringLiteral("^\\s*<!DOCTYPE\\s+l:i18n\\s+SYSTEM\\s+\"l10n\\.dtd\"\\s*>$"));
> -    rxEntity.setPattern(QStringLiteral("^\\s*<!ENTITY\\s+([^\\s]+)\\s+SYSTEM\\s+\"([^\\s]+)\">\\s*$"));
> -    rxEntity2.setPattern(QStringLiteral("^\\s*<l:l10n language=\"([^\\s]+)\"\\s+href=\"([^\\s]+)\"/>\\s*$"));
> +    QRegularExpression rxDocType(QStringLiteral("^\\s*<!DOCTYPE\\s+l:i18n\\s+SYSTEM\\s+\"l10n\\.dtd\"\\s+\\[\\s*$"));
> +    QRegularExpression rxDocType2(QStringLiteral("^\\s*<!DOCTYPE\\s+l:i18n\\s+SYSTEM\\s+\"l10n\\.dtd\"\\s*>$"));

const all of these?

> docbookl10nhelper.cpp:184
>              QString langCode, langFile;
> -            if (rxEntity.indexIn(line) != -1 && !foundRxEntity2) {
> +            QRegularExpressionMatch match;
> +            match = rxEntity.match(line);

Just do `QRegularExpressionMatch match = rxEntity.match(line);`

REPOSITORY
  R238 KDocTools

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

To: ahmadsamir, #documentation, ltoscano
Cc: apol, kde-doc-english, kde-frameworks-devel, LeGast00n, gennad, fbampaloukas, GB_2, michaelh, ngraham, bruns, skadinna
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-doc-english/attachments/20191223/611dce47/attachment.html>


More information about the kde-doc-english mailing list