Picking up #606 (labeled “Up for grabs”) and applying #606#pullrequestreview-984607067 and #606 (comment).
Replaces occurrences of QRegExp
usage with QRegularExpression
as part of the roadmap for Qt6 integration.
QRegExp
with QRegularExpression
#620
Picking up #606 (labeled “Up for grabs”) and applying #606#pullrequestreview-984607067 and #606 (comment).
Replaces occurrences of QRegExp
usage with QRegularExpression
as part of the roadmap for Qt6 integration.
What is your opinion about #606 (comment)?
That looks good to me. I’ll take a look at it. Would you suggest a class/file to allocate the utility function?
What is your opinion about #606 (comment)?
That looks good to me. I’ll take a look at it. Would you suggest a class/file to allocate the utility function?
namespace GUIUtil
in qt/guiutil.{h,cpp}
?
134+
135+ filter = QString("PNG Image (*.png)");
136+ QCOMPARE(GUIUtil::extractFirstSuffixFromFilter(filter), "png");
137+
138+ filter = QString("Wallet Data (*.dat)");
139+ QCOMPARE(GUIUtil::extractFirstSuffixFromFilter(filter), "dat");
135+ filter = QString("PNG Image (*.png)");
136+ QCOMPARE(GUIUtil::extractFirstSuffixFromFilter(filter), "png");
137+
138+ filter = QString("Wallet Data (*.dat)");
139+ QCOMPARE(GUIUtil::extractFirstSuffixFromFilter(filter), "dat");
140+
21@@ -22,7 +22,7 @@
22 #include <QCloseEvent>
23 #include <QLabel>
24 #include <QMainWindow>
25-#include <QRegExp>
26+#include <QRegularExpression>
#include <QString>
as well (due to using QStringLiteral
)?
Approach ACK c0c8b33748637372ee5b267f6bbcce33a5380f4d.
Suggesting to split the first commit into separated ones:
extractFirstSuffixFromFilter()
function (I’d prefer to use UpperCamelCase
name convention for this new standalone function)QRegExp
with QRegularExpression
Also please apply clang-format-diff.py
for each your commit.
Extract the 'Extract first suffix from filter pattern...'
functionality into a testable utility function
Co-authored-by: Pavol Rusnak <pavol@rusnak.io>
Co-authored-by: Jarol Rodriguez <jarolrod@tutanota.com>
122@@ -123,6 +123,13 @@ namespace GUIUtil
123 */
124 QString getDefaultDataDirectory();
125
126+
127+ /** Extract first suffix from filter pattern "Description (*.foo)" or "Description (*.foo *.bar ...).
128+
129+ @param[in] filter Filter specification such as "Comma Separated Files (*.csv)"
130+ */
Labels
Refactoring
Qt 6