projects/guix·blob javascript-team · refs

54 lines · 1.6 KiB

1https://patch-diff.githubusercontent.com/raw/steveire/grantlee/pull/91
2also in Debian
3https://sources.debian.org/data/main/g/grantlee5/5.3.1-3/debian/patches/register-comparator.diff
4
5From e6a2c1f4f29623f0ced1a946f5ff0c3831ab213b Mon Sep 17 00:00:00 2001
6From: Pino Toscano <[email protected]>
7Date: Sat, 12 Aug 2023 12:06:15 +0200
8Subject: [PATCH] Register MetaEnumVariable for comparison
9
10This is needed to ensure that MetaEnumVariable can be properly handled
11for comparisons, e.g. as done via QVariant::compare().
12
13Followup of commit 3b1931e30a23286a64f713a815f701d194a3c759
14
15Fixes #89
16---
17 templates/lib/engine.cpp | 10 ++++++++++
18 1 file changed, 10 insertions(+)
19
20diff --git a/templates/lib/engine.cpp b/templates/lib/engine.cpp
21index c6a6987b..fc6b7797 100644
22--- a/templates/lib/engine.cpp
23+++ b/templates/lib/engine.cpp
24@@ -24,6 +24,9 @@
25 #include "exception.h"
26 #include "grantlee_config_p.h"
27 #include "grantlee_version.h"
28+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
29+#include "metaenumvariable_p.h"
30+#endif
31 #ifdef QT_QML_LIB
32 #include "scriptabletags.h"
33 #endif
34@@ -32,6 +35,9 @@
35
36 #include <QtCore/QCoreApplication>
37 #include <QtCore/QDir>
38+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
39+#include <QtCore/QMetaType>
40+#endif
41 #include <QtCore/QPluginLoader>
42 #include <QtCore/QTextStream>
43
44@@ -48,6 +54,10 @@ Engine::Engine(QObject *parent)
45
46 d_ptr->m_pluginDirs = QCoreApplication::libraryPaths();
47 d_ptr->m_pluginDirs << QString::fromLocal8Bit(GRANTLEE_PLUGIN_PATH);
48+
49+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
50+ QMetaType::registerComparators<MetaEnumVariable>();
51+#endif
52 }
53
54 Engine::~Engine()