Commit 92ecad19 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

Move QMimeData registration back to where it belongs

Fixes regression introduced in 7a6b1a03

BUG: 418109
FIXED-IN: 5.18.5

Differential Revision: https://phabricator.kde.org/D28485
parent 7e9e1ff2
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <QTextDocument> #include <QTextDocument>
#include <QTextCursor> #include <QTextCursor>
#include <QMimeData>
using namespace Milou; using namespace Milou;
...@@ -32,11 +31,7 @@ PreviewPlugin::PreviewPlugin(QObject* parent) ...@@ -32,11 +31,7 @@ PreviewPlugin::PreviewPlugin(QObject* parent)
: QObject(parent) : QObject(parent)
, m_context(nullptr) , m_context(nullptr)
{ {
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
qmlRegisterAnonymousType<QMimeData>("org.kde.milou", 1);
#else
qmlRegisterType<QMimeData>();
#endif
} }
PreviewPlugin::~PreviewPlugin() PreviewPlugin::~PreviewPlugin()
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "mousehelper.h" #include "mousehelper.h"
#include <QQmlEngine> #include <QQmlEngine>
#include <QMimeData>
void QmlPlugins::initializeEngine(QQmlEngine *, const char *) void QmlPlugins::initializeEngine(QQmlEngine *, const char *)
{ {
...@@ -44,5 +45,10 @@ void QmlPlugins::registerTypes(const char *uri) ...@@ -44,5 +45,10 @@ void QmlPlugins::registerTypes(const char *uri)
[](QQmlEngine*, QJSEngine*) -> QObject* { [](QQmlEngine*, QJSEngine*) -> QObject* {
return new Milou::MouseHelper(); return new Milou::MouseHelper();
}); });
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
qmlRegisterAnonymousType<QMimeData>(uri, 0);
#else
qmlRegisterType<QMimeData>();
#endif
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment