File 0001-Fix-not-having-provided-method-QRegularExpression-an.patch of Package mingw32-drkonqi5

From bf12cf5da2600d3e6b99a4b4f8931192307e7167 Mon Sep 17 00:00:00 2001
From: Ralf Habacker <ralf.habacker@freenet.de>
Date: Tue, 8 Sep 2020 12:29:51 +0200
Subject: [PATCH] Fix not having provided method
 QRegularExpression::anchoredPattern() in Qt 5.11

---
 src/parser/backtraceparser.cpp        | 13 ++++++++++++-
 src/parser/backtraceparserkdbgwin.cpp | 14 +++++++++++++-
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/src/parser/backtraceparser.cpp b/src/parser/backtraceparser.cpp
index e41fe187..fa461839 100644
--- a/src/parser/backtraceparser.cpp
+++ b/src/parser/backtraceparser.cpp
@@ -136,6 +136,17 @@ BacktraceParserPrivate *BacktraceParser::constructPrivate() const
     return new BacktraceParserPrivate;
 }
 
+#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
+static QString anchoredPattern(const QString &expression)
+{
+    return QString()
+           + QLatin1String("\\A(?:")
+           + expression
+           + QLatin1String(")\\z");
+}
+#else
+#define anchoredPattern QRegularExpression::anchoredPattern
+#endif
 
 /* This function returns true if the given stack frame line is the base of the backtrace
    and thus the parser should not rate any frames below that one. */
@@ -160,7 +171,7 @@ static bool lineIsStackBase(const BacktraceLine & line)
     //"QApplicationPrivate::notify_helper", "QApplication::notify" and similar, which
     //are used to send any kind of event to the Qt application. All stack frames below this,
     //with or without debug symbols, are useless to KDE developers, so we ignore them.
-    const QRegularExpression re(QRegularExpression::anchoredPattern(
+    const QRegularExpression re(anchoredPattern(
                                     QStringLiteral("(Q|K)(Core)?Application(Private)?::notify.*")));
     if (re.match(line.functionName()).hasMatch()) {
         return true;
diff --git a/src/parser/backtraceparserkdbgwin.cpp b/src/parser/backtraceparserkdbgwin.cpp
index ab6e713f..5b9eb7fa 100644
--- a/src/parser/backtraceparserkdbgwin.cpp
+++ b/src/parser/backtraceparserkdbgwin.cpp
@@ -21,6 +21,18 @@
 
 #include <QRegularExpression>
 
+#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
+static QString anchoredPattern(const QString &expression)
+{
+    return QString()
+           + QLatin1String("\\A(?:")
+           + expression
+           + QLatin1String(")\\z");
+}
+#else
+#define anchoredPattern QRegularExpression::anchoredPattern
+#endif
+
 //BEGIN BacktraceLineKdbgwin
 
 class BacktraceLineKdbgwin : public BacktraceLine
@@ -56,7 +68,7 @@ void BacktraceLineKdbgwin::parse()
         return;
     }
 
-    static const QRegularExpression re(QRegularExpression::anchoredPattern(QStringLiteral(
+    static const QRegularExpression re(anchoredPattern(QStringLiteral(
                                         "([^!]+)!" //match the module name, followed by !
                                         "([^\\(]+)\\(\\) " //match the function name, followed by ()
                                         "\\[([^@]+)@ [\\-\\d]+\\] " // [filename @ line]
-- 
2.26.2

openSUSE Build Service is sponsored by