mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05:00
qt: Replace QRegExp
with QRegularExpression
Co-authored-by: Pavol Rusnak <pavol@rusnak.io> Co-authored-by: Jarol Rodriguez <jarolrod@tutanota.com>
This commit is contained in:
parent
c378535e28
commit
ace9af5688
2 changed files with 9 additions and 7 deletions
|
@ -56,6 +56,7 @@
|
|||
#include <QMouseEvent>
|
||||
#include <QPluginLoader>
|
||||
#include <QProgressDialog>
|
||||
#include <QRegularExpression>
|
||||
#include <QScreen>
|
||||
#include <QSettings>
|
||||
#include <QShortcut>
|
||||
|
@ -294,10 +295,11 @@ QString getDefaultDataDirectory()
|
|||
|
||||
QString ExtractFirstSuffixFromFilter(const QString& filter)
|
||||
{
|
||||
QRegExp filter_re(".* \\(\\*\\.(.*)[ \\)]");
|
||||
QRegularExpression filter_re(QStringLiteral(".* \\(\\*\\.(.*)[ \\)]"), QRegularExpression::InvertedGreedinessOption);
|
||||
QString suffix;
|
||||
if (filter_re.exactMatch(filter)) {
|
||||
suffix = filter_re.cap(1);
|
||||
QRegularExpressionMatch m = filter_re.match(filter);
|
||||
if (m.hasMatch()) {
|
||||
suffix = m.captured(1);
|
||||
}
|
||||
return suffix;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,8 @@
|
|||
#include <QCloseEvent>
|
||||
#include <QLabel>
|
||||
#include <QMainWindow>
|
||||
#include <QRegExp>
|
||||
#include <QRegularExpression>
|
||||
#include <QString>
|
||||
#include <QTextCursor>
|
||||
#include <QTextTable>
|
||||
#include <QVBoxLayout>
|
||||
|
@ -44,9 +45,8 @@ 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
|
||||
licenseInfoHTML.replace(uri, "<a href=\"\\1\">\\1</a>");
|
||||
QRegularExpression uri(QStringLiteral("<(.*)>"), QRegularExpression::InvertedGreedinessOption);
|
||||
licenseInfoHTML.replace(uri, QStringLiteral("<a href=\"\\1\">\\1</a>"));
|
||||
// Replace newlines with HTML breaks
|
||||
licenseInfoHTML.replace("\n", "<br>");
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue