Commit 47d7daf6 authored by Volker Krause's avatar Volker Krause
Browse files

Prepare for the calendar plugin loader to move to KCalendarCore

This will potentially happen in a KF release after the 22.08 feature
freeze and thus might clash with us using the same names/namespaces here.
parent ea17e09d
......@@ -7,7 +7,7 @@ import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15 as QQC2
import org.kde.kirigami 2.17 as Kirigami
import org.kde.kcalendarcore 1.0 as KCalendarCore
import internal.org.kde.kcalendarcore 1.0 as KCalendarCore
import org.kde.itinerary 1.0
import "." as App
......
......@@ -9,7 +9,7 @@ import QtQuick.Layouts 1.1
import QtQuick.Controls 2.1 as QQC2
import org.kde.kirigami 2.17 as Kirigami
import org.kde.kitemmodels 1.0
import org.kde.kcalendarcore 1.0 as KCalendarCore
import internal.org.kde.kcalendarcore 1.0 as KCalendarCore
import org.kde.kitinerary 1.0
import org.kde.itinerary 1.0
import "." as App
......
......@@ -10,7 +10,7 @@ import QtQuick.Controls 2.1 as QQC2
import Qt.labs.qmlmodels 1.0 as Models
import Qt.labs.platform 1.1 as Platform
import org.kde.kirigami 2.17 as Kirigami
import org.kde.kcalendarcore 1.0 as KCalendarCore
import internal.org.kde.kcalendarcore 1.0 as KCalendarCore
import org.kde.itinerary 1.0
import "." as App
......
......@@ -109,10 +109,10 @@ void registerKContactsTypes()
void registerKCalendarCoreTypes()
{
// ### this should move into a QML plugin of KCalendarCore
qmlRegisterUncreatableMetaObject(KCalendarCore::staticMetaObject, "org.kde.kcalendarcore", 1, 0, "KCalendarCore", {});
qmlRegisterType<KCalendarCore::CalendarListModel>("org.kde.kcalendarcore", 1, 0, "CalendarListModel");
qmlRegisterSingletonType("org.kde.kcalendarcore", 1, 0, "CalendarPluginLoader", [](QQmlEngine *, QJSEngine *jsEngine) -> QJSValue {
return jsEngine->toScriptValue(KCalendarCore::CalendarPluginLoader());
qmlRegisterUncreatableMetaObject(KCalendarCore::staticMetaObject, "internal.org.kde.kcalendarcore", 1, 0, "KCalendarCore", {});
qmlRegisterType<KCalendarCoreExtras::CalendarListModel>("internal.org.kde.kcalendarcore", 1, 0, "CalendarListModel");
qmlRegisterSingletonType("internal.org.kde.kcalendarcore", 1, 0, "CalendarPluginLoader", [](QQmlEngine *, QJSEngine *jsEngine) -> QJSValue {
return jsEngine->toScriptValue(KCalendarCoreExtras::CalendarPluginLoader());
});
}
......
......@@ -9,8 +9,9 @@
#include <KCalendarCore/CalendarPlugin>
using namespace KCalendarCore;
using namespace KCalendarCoreExtras;
namespace KCalendarCore {
namespace KCalendarCoreExtras {
class CalendarListModelPrivate
{
public:
......
......@@ -12,7 +12,7 @@
#include <memory>
namespace KCalendarCore {
namespace KCalendarCoreExtras {
class CalendarListModelPrivate;
......
......@@ -10,6 +10,7 @@
#include <QPluginLoader>
using namespace KCalendarCore;
using namespace KCalendarCoreExtras;
struct PluginLoader {
PluginLoader();
......
......@@ -10,7 +10,7 @@
#include <KCalendarCore/CalendarPlugin>
namespace KCalendarCore {
namespace KCalendarCoreExtras {
/** Access to KCalendarCore::CalendarPlugin instances. */
class KCALENDARCOREEXTRAS_EXPORT CalendarPluginLoader
......
Supports Markdown
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