[neon/qt6/qt6-base/Neon/unstable] debian/patches: patch from https://codereview.qt-project.org/c/qt/qtbase/+/485616

Jonathan Esk-Riddell null at kde.org
Wed Jul 12 10:10:45 BST 2023


Git commit 465b83d8c783f47b2dd8252804cae2dcfc03e45a by Jonathan Esk-Riddell.
Committed on 12/07/2023 at 09:10.
Pushed by jriddell into branch 'Neon/unstable'.

patch from https://codereview.qt-project.org/c/qt/qtbase/+/485616

M  +92   -10   debian/patches/kwallet_fix_temp.patch

https://invent.kde.org/neon/qt6/qt6-base/-/commit/465b83d8c783f47b2dd8252804cae2dcfc03e45a

diff --git a/debian/patches/kwallet_fix_temp.patch b/debian/patches/kwallet_fix_temp.patch
index 0f6d6f8..13af21c 100644
--- a/debian/patches/kwallet_fix_temp.patch
+++ b/debian/patches/kwallet_fix_temp.patch
@@ -1,5 +1,3 @@
-From https://codereview.qt-project.org/qt/qtbase
- * branch                  refs/changes/16/485616/3 -> FETCH_HEAD
 From 838f66be51103b8567ee22b71bd8e6102297b681 Mon Sep 17 00:00:00 2001
 From: Fabian Kosmale <fabian.kosmale at qt.io>
 Date: Mon, 13 Mar 2023 17:59:35 +0100
@@ -18,16 +16,12 @@ Reviewed-by: Thiago Macieira <thiago.macieira at intel.com>
 (cherry picked from commit 44b5ad01f0da55a351e0855e1173acfbef77221d)
 Reviewed-by: Ulf Hermann <ulf.hermann at qt.io>
 ---
- src/tools/moc/moc.cpp            | 21 +++++++++++++++++----
- src/tools/moc/moc.h              |  1 +
- tests/auto/tools/moc/tst_moc.cpp | 28 ++++++++++++++++++++++++++++
- 3 files changed, 46 insertions(+), 4 deletions(-)
 
 diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
-index d4973b87ac..09bc1e26a1 100644
+index d4973b8..09bc1e2 100644
 --- a/src/tools/moc/moc.cpp
 +++ b/src/tools/moc/moc.cpp
-@@ -409,8 +409,7 @@ bool Moc::parseFunction(FunctionDef *def, bool inMacro)
+@@ -409,8 +409,7 @@
      def->isVirtual = false;
      def->isStatic = false;
      //skip modifiers and attributes
@@ -37,7 +31,7 @@ index d4973b87ac..09bc1e26a1 100644
          || skipCxxAttributes() || testFunctionAttribute(def) || testFunctionRevision(def)) {}
      bool templateFunction = (lookup() == TEMPLATE);
      def->type = parseType();
-@@ -426,6 +425,10 @@ bool Moc::parseFunction(FunctionDef *def, bool inMacro)
+@@ -426,6 +425,10 @@
          scopedFunctionName = def->type.isScoped;
          def->type = Type("int");
      } else {
@@ -48,7 +42,7 @@ index d4973b87ac..09bc1e26a1 100644
          Type tempType = parseType();;
          while (!tempType.name.isEmpty() && lookup() != LPAREN) {
              if (testFunctionAttribute(def->type.firstToken, def))
-@@ -509,14 +512,20 @@ bool Moc::parseFunction(FunctionDef *def, bool inMacro)
+@@ -509,14 +512,20 @@
      return true;
  }
  
@@ -59,3 +53,91 @@ index d4973b87ac..09bc1e26a1 100644
 +            (test(VIRTUAL) && (def->isVirtual = true));
 +}
 +
+ // like parseFunction, but never aborts with an error
+ bool Moc::parseMaybeFunction(const ClassDef *cdef, FunctionDef *def)
+ {
+     def->isVirtual = false;
+     def->isStatic = false;
+     //skip modifiers and attributes
+-    while (test(EXPLICIT) || test(INLINE) || (test(STATIC) && (def->isStatic = true) == true) ||
+-        (test(VIRTUAL) && (def->isVirtual = true) == true) //mark as virtual
++    while (testForFunctionModifiers(def)
+         || skipCxxAttributes() || testFunctionAttribute(def) || testFunctionRevision(def)) {}
+     bool tilde = test(TILDE);
+     def->type = parseType();
+@@ -534,6 +543,10 @@
+             def->type = Type("int");
+         }
+     } else {
++        // ### TODO: The condition before testForFunctionModifiers shoulnd't be necessary,
++        // but otherwise we end up with misparses
++        if (def->isSlot || def->isSignal || def->isInvokable)
++            while (testForFunctionModifiers(def)) {}
+         Type tempType = parseType();;
+         while (!tempType.name.isEmpty() && lookup() != LPAREN) {
+             if (testFunctionAttribute(def->type.firstToken, def))
+diff --git a/src/tools/moc/moc.h b/src/tools/moc/moc.h
+index 5124283..67777c7 100644
+--- a/src/tools/moc/moc.h
++++ b/src/tools/moc/moc.h
+@@ -280,6 +280,7 @@
+ 
+     void checkSuperClasses(ClassDef *def);
+     void checkProperties(ClassDef* cdef);
++    bool testForFunctionModifiers(FunctionDef *def);
+ };
+ 
+ inline QByteArray noRef(const QByteArray &type)
+diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
+index 26522e9..a509c0d 100644
+--- a/tests/auto/tools/moc/tst_moc.cpp
++++ b/tests/auto/tools/moc/tst_moc.cpp
+@@ -83,6 +83,19 @@
+ 
+ #define TESTEXPORTMACRO Q_DECL_EXPORT
+ 
++#if !defined(Q_MOC_RUN) && !defined(Q_NOREPLY)
++# define Q_NOREPLY
++#endif
++
++struct TagTest : QObject {
++    Q_OBJECT
++
++    Q_INVOKABLE Q_NOREPLY inline int test() {return 0;}
++public slots:
++    Q_NOREPLY virtual inline void pamOpen(int){}
++};
++
++
+ namespace TestNonQNamespace {
+ 
+ struct TestGadget {
+@@ -787,6 +800,7 @@
+     void privateQPropertyShim();
+     void readWriteThroughBindable();
+     void invokableCtors();
++    void virtualInlineTaggedSlot();
+ 
+ signals:
+     void sigWithUnsignedArg(unsigned foo);
+@@ -4575,6 +4589,20 @@
+     QCOMPARE(result2.m_thing, 17);
+ }
+ 
++void tst_Moc::virtualInlineTaggedSlot()
++{
++    auto mo = TagTest::staticMetaObject;
++    auto idx = mo.indexOfMethod("pamOpen(int)");
++    auto method = mo.method(idx);
++    QVERIFY(method.isValid()); // fails!
++    QCOMPARE(method.tag(), "Q_NOREPLY");
++    idx = mo.indexOfMethod("test()");
++    method = mo.method(idx);
++    QVERIFY(method.isValid());
++    QCOMPARE(method.tag(), "Q_NOREPLY");
++    QCOMPARE(method.returnMetaType(), QMetaType::fromType<int>());
++}
++
+ QTEST_MAIN(tst_Moc)
+ 
+ // the generated code must compile with QT_NO_KEYWORDS


More information about the Neon-commits mailing list