| 1 | https://patch-diff.githubusercontent.com/raw/steveire/grantlee/pull/91
|
| 2 | also in Debian
|
| 3 | https://sources.debian.org/data/main/g/grantlee5/5.3.1-3/debian/patches/register-comparator.diff
|
| 4 |
|
| 5 | From e6a2c1f4f29623f0ced1a946f5ff0c3831ab213b Mon Sep 17 00:00:00 2001
|
| 6 | From: Pino Toscano <[email protected]>
|
| 7 | Date: Sat, 12 Aug 2023 12:06:15 +0200
|
| 8 | Subject: [PATCH] Register MetaEnumVariable for comparison
|
| 9 |
|
| 10 | This is needed to ensure that MetaEnumVariable can be properly handled
|
| 11 | for comparisons, e.g. as done via QVariant::compare().
|
| 12 |
|
| 13 | Followup of commit 3b1931e30a23286a64f713a815f701d194a3c759
|
| 14 |
|
| 15 | Fixes #89
|
| 16 | ---
|
| 17 | templates/lib/engine.cpp | 10 ++++++++++
|
| 18 | 1 file changed, 10 insertions(+)
|
| 19 |
|
| 20 | diff --git a/templates/lib/engine.cpp b/templates/lib/engine.cpp
|
| 21 | index c6a6987b..fc6b7797 100644
|
| 22 | |
| 23 | |
| 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()
|