-
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
Replace QRegExp with QRegularExpression #585
Conversation
Concept ACK. As a preparation to Qt 6, I think this PR will benefit by incorporating of bitcoin/bitcoin@f6adcad and bitcoin/bitcoin@b649103 in any reasonable way. |
|
fb834e2
to
54980a7
Compare
Does it make sense to extract the "Extract first suffix from filter pattern..." functionality into a testable utility function? |
Here is a branch with tests for the And test fails for the 54980a7 commit. |
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. |
1506913 qt, test: Add tests for `tableView` in `AddressBookPage` dialog (Hennadii Stepanov) edae3ab qt: No need to force Qt::QueuedConnection for NotifyAddressBookChanged (Hennadii Stepanov) Pull request description: This PR is a prerequisite for more thorough testing of filtering in the `AddressBookPage` class in context of #578 and #585. Required for #592. ACKs for top commit: promag: Code review ACK 1506913. Tree-SHA512: 86986d47606cbd54d813436c7afb21894e2200b6d3042a7aa0b5e84821c765bd68b14ad38a445069891ab33f2d7bcd4933b8373e14e9afb0c91f1a6ddf4da740
…ssBookPage` dialog 1506913 qt, test: Add tests for `tableView` in `AddressBookPage` dialog (Hennadii Stepanov) edae3ab qt: No need to force Qt::QueuedConnection for NotifyAddressBookChanged (Hennadii Stepanov) Pull request description: This PR is a prerequisite for more thorough testing of filtering in the `AddressBookPage` class in context of bitcoin-core/gui#578 and bitcoin-core/gui#585. Required for bitcoin-core/gui#592. ACKs for top commit: promag: Code review ACK 1506913. Tree-SHA512: 86986d47606cbd54d813436c7afb21894e2200b6d3042a7aa0b5e84821c765bd68b14ad38a445069891ab33f2d7bcd4933b8373e14e9afb0c91f1a6ddf4da740
src/qt/utilitydialog.cpp
Outdated
@@ -44,8 +44,7 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) : | |||
/// HTML-format the license message from the core | |||
QString licenseInfoHTML = QString::fromStdString(LicenseInfo()); | |||
// Make URLs clickable | |||
QRegExp uri("<(.*)>", Qt::CaseSensitive, QRegExp::RegExp2); | |||
uri.setMinimal(true); // use non-greedy matching | |||
QRegularExpression uri("<(.*)>", QRegularExpression::InvertedGreedinessOption); // use non-greedy matching |
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.
A comment seems unneeded here because QRegularExpression::InvertedGreedinessOption
is pretty self-explained.
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.
Addressed in db71143
@@ -46,12 +47,19 @@ class AddressBookSortFilterProxyModel final : public QSortFilterProxyModel | |||
|
|||
auto address = model->index(row, AddressTableModel::Address, parent); | |||
|
|||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) |
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.
slight preference for flipping this around where we're checking if less than qt6, i think this makes the code cleaner and inline with how we've done some other qt6 preparation changes, but not a blocker
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.
Current implementation allows to test without Qt 6.
…`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/bitcoin#24798) to Qt 6. Related: - #578 - #585 No behavior change. To ensure this, tests have been added. ACKs for top commit: hebasto: > tACK [e280087](e280087) on Ubuntu 21.10 Qt 5.15.2 promag: Tested ACK e280087 with Qt6 on macOS 12 M1. w0xlt: tACK e280087 on Ubuntu 21.10 Qt 5.15.2 jarolrod: Tested ACK e280087 on M1 mac, x86 mac, x86 Linux with Qt5 and separately with Qt6 Tree-SHA512: 664baacc1504deb2f7fa651ea4a44f3942f5c9058befe4d2ce292beed032d4b1697710cfd10c0909602d8a4a6eeb680414e4a1f56d2038478c1ae2f34965d74f
🐙 This pull request conflicts with the target branch and needs rebase. Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft". |
I won't be able to work on this PR in the following days/weeks. Feel free to push into my branch (maintainers are allowed) or take over the PR completely if needed. |
Picked up in #606 |
…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
Fixes #578
Only made sure the code builds, not sure how to test.