-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting ready to Qt 6 (8/n). Use QRegularExpression
in AddressBookSortFilterProxyModel
class
#593
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK.
src/qt/addressbookpage.cpp
Outdated
|
||
return true; | ||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) | ||
const auto pattern = filterRegularExpression().pattern(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering https://github.com/bitcoin-core/gui/pull/592/files#r878677419, I think the only required change is:
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
const auto pattern = filterRegularExpression()
#else
const auto pattern = filterRegExp();
#endif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Updated.
Co-authored-by: João Barbosa <joao.paulo.barbosa@gmail.com>
I think we can now close #592? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review ACK e280087.
Could also have a test case-insensitivity search.
Could be a good first issue for following up :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK e280087 on Ubuntu 21.10 Qt 5.15.2
Interesting note about QRegularExpression
class:
https://doc.qt.io/qt-5/qregularexpression.html#notes-for-qregexp-users
Thank you for your review and testing! FWIW, to test with Qt 6, the branch from bitcoin/bitcoin#24798 could be used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested ACK e280087 with Qt6 on macOS 12 M1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested ACK e280087 on M1 mac, x86 mac, x86 Linux with Qt5 and separately with Qt6
The added tests in 5c5d8f2 are useful for verifying there's nothing being messed up by the changes. I also manually tested the address book for:
- The ability to still search effectively after the change
- That additions to the address book appear in the same order before and after the change
…rExpression` in `AddressBookSortFilterProxyModel` class e280087 qt: Use `QRegularExpression` in `AddressBookSortFilterProxyModel` class (Hennadii Stepanov) 5c5d8f2 qt, test: Add tests for searching in `AddressBookPage` dialog (Hennadii Stepanov) Pull request description: This is a step in [migration](bitcoin#24798) to Qt 6. Related: - bitcoin-core/gui#578 - bitcoin-core/gui#585 No behavior change. To ensure this, tests have been added. ACKs for top commit: hebasto: > tACK [e280087](bitcoin-core/gui@e280087) on Ubuntu 21.10 Qt 5.15.2 promag: Tested ACK e280087 with Qt6 on macOS 12 M1. w0xlt: tACK bitcoin-core/gui@e280087 on Ubuntu 21.10 Qt 5.15.2 jarolrod: Tested ACK bitcoin-core/gui@e280087 on M1 mac, x86 mac, x86 Linux with Qt5 and separately with Qt6 Tree-SHA512: 664baacc1504deb2f7fa651ea4a44f3942f5c9058befe4d2ce292beed032d4b1697710cfd10c0909602d8a4a6eeb680414e4a1f56d2038478c1ae2f34965d74f
This is a step in migration to Qt 6.
Related:
QRegExp
withQRegularExpression
#578No behavior change. To ensure this, tests have been added.