diff options
author | w0xlt <94266259+w0xlt@users.noreply.github.com> | 2022-06-21 19:11:54 -0300 |
---|---|---|
committer | w0xlt <94266259+w0xlt@users.noreply.github.com> | 2022-06-21 19:19:18 -0300 |
commit | ace9af5688662a56d855bd26f36bc5c145b909e3 (patch) | |
tree | b0a93c766a5cf1558fbb73bc80448786bfd0d1f4 /src/qt/guiutil.cpp | |
parent | c378535e28e0c54353fde9c4a66cb3134a3ee742 (diff) |
qt: Replace `QRegExp` with `QRegularExpression`
Co-authored-by: Pavol Rusnak <pavol@rusnak.io>
Co-authored-by: Jarol Rodriguez <jarolrod@tutanota.com>
Diffstat (limited to 'src/qt/guiutil.cpp')
-rw-r--r-- | src/qt/guiutil.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 2059ef8583..2104d5601f 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -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; } |