D26205: KWallet: Port QRegExp to QRegularExpression

Mikołaj Płomieński noreply at phabricator.kde.org
Wed Jan 15 13:55:08 GMT 2020


blaze added a comment.


  This changeset breaks the app, making it impossible to get the list of entries from outside. Tested against Falkon browser with KDE integration plugin. See my inline comments here

INLINE COMMENTS

> kwallet.cpp:179
>          if (searchItemsJob->exec()) {
> -            QRegExp re(key, Qt::CaseSensitive, QRegExp::Wildcard);
> +            const QRegularExpression re(QRegularExpression::anchoredPattern(
> +                                          QRegularExpression::wildcardToRegularExpression(key)));

anchoredPattern() is excessive here, it creates a horror like that "\\A(?:\\A(?:[^/]*)\\z)\\z" with the stuff being anchored twice.
It has to be removed with no doubt at all.

> kwallet.cpp:180
> +            const QRegularExpression re(QRegularExpression::anchoredPattern(
> +                                          QRegularExpression::wildcardToRegularExpression(key)));
>              const auto list = searchItemsJob->items();

The output of wildcardToRegularExpression() method is different from what was before and it breaks the app. It has to be replaced with something else.

> kwalletbackend.cc:533
>  
> -    QRegExp re(key, Qt::CaseSensitive, QRegExp::Wildcard);
> +    QRegularExpression re(QRegularExpression::anchoredPattern(
> +                           QRegularExpression::wildcardToRegularExpression(key)));

Same here as well.

> kwalletbackend.cc:534
> +    QRegularExpression re(QRegularExpression::anchoredPattern(
> +                           QRegularExpression::wildcardToRegularExpression(key)));
>  

and here

REPOSITORY
  R311 KWallet

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

To: ahmadsamir, #frameworks, aacid, apol
Cc: blaze, 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/20200115/a7f9b6b9/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list