Changeset View
Changeset View
Standalone View
Standalone View
src/kirigamiplugin.cpp
Show All 17 Lines | |||||
18 | * Free Software Foundation, Inc., | 18 | * Free Software Foundation, Inc., | ||
19 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 19 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | #include "kirigamiplugin.h" | 22 | #include "kirigamiplugin.h" | ||
23 | #include "enums.h" | 23 | #include "enums.h" | ||
24 | #include "desktopicon.h" | 24 | #include "desktopicon.h" | ||
25 | #include "settings.h" | 25 | #include "settings.h" | ||
26 | #include "formlayoutattached.h" | ||||
27 | #include "mnemonicattached.h" | ||||
26 | 28 | | |||
27 | #include <QQmlEngine> | 29 | #include <QQmlEngine> | ||
28 | #include <QQmlContext> | 30 | #include <QQmlContext> | ||
29 | #include <QQuickItem> | 31 | #include <QQuickItem> | ||
30 | #include <QQuickStyle> | 32 | #include <QQuickStyle> | ||
31 | 33 | | |||
32 | #ifdef KIRIGAMI_BUILD_TYPE_STATIC | 34 | #ifdef KIRIGAMI_BUILD_TYPE_STATIC | ||
33 | #include "libkirigami/platformtheme.h" | 35 | #include "libkirigami/platformtheme.h" | ||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | 84 | [](QQmlEngine*, QJSEngine*) -> QObject* { | |||
83 | Settings *settings = new Settings; | 85 | Settings *settings = new Settings; | ||
84 | settings->setStyle(s_selectedStyle); | 86 | settings->setStyle(s_selectedStyle); | ||
85 | return settings; | 87 | return settings; | ||
86 | } | 88 | } | ||
87 | ); | 89 | ); | ||
88 | 90 | | |||
89 | qmlRegisterUncreatableType<ApplicationHeaderStyle>(uri, 2, 0, "ApplicationHeaderStyle", "Cannot create objects of type ApplicationHeaderStyle"); | 91 | qmlRegisterUncreatableType<ApplicationHeaderStyle>(uri, 2, 0, "ApplicationHeaderStyle", "Cannot create objects of type ApplicationHeaderStyle"); | ||
90 | 92 | | |||
93 | //old legacy retrocompatible Theme | ||||
91 | qmlRegisterSingletonType(componentUrl(QStringLiteral("Theme.qml")), uri, 2, 0, "Theme"); | 94 | qmlRegisterSingletonType(componentUrl(QStringLiteral("Theme.qml")), uri, 2, 0, "Theme"); | ||
92 | //Theme changed from a singleton to an attached property | 95 | | ||
93 | qmlRegisterUncreatableType<Kirigami::PlatformTheme>(uri, 2, 2, "Theme", "Cannot create objects of type Theme, use it as an attached poperty"); | | |||
94 | qmlRegisterSingletonType(componentUrl(QStringLiteral("Units.qml")), uri, 2, 0, "Units"); | 96 | qmlRegisterSingletonType(componentUrl(QStringLiteral("Units.qml")), uri, 2, 0, "Units"); | ||
95 | 97 | | |||
96 | qmlRegisterType(componentUrl(QStringLiteral("Action.qml")), uri, 2, 0, "Action"); | 98 | qmlRegisterType(componentUrl(QStringLiteral("Action.qml")), uri, 2, 0, "Action"); | ||
97 | qmlRegisterType(componentUrl(QStringLiteral("AbstractApplicationHeader.qml")), uri, 2, 0, "AbstractApplicationHeader"); | 99 | qmlRegisterType(componentUrl(QStringLiteral("AbstractApplicationHeader.qml")), uri, 2, 0, "AbstractApplicationHeader"); | ||
98 | qmlRegisterType(componentUrl(QStringLiteral("AbstractApplicationWindow.qml")), uri, 2, 0, "AbstractApplicationWindow"); | 100 | qmlRegisterType(componentUrl(QStringLiteral("AbstractApplicationWindow.qml")), uri, 2, 0, "AbstractApplicationWindow"); | ||
99 | qmlRegisterType(componentUrl(QStringLiteral("AbstractListItem.qml")), uri, 2, 0, "AbstractListItem"); | 101 | qmlRegisterType(componentUrl(QStringLiteral("AbstractListItem.qml")), uri, 2, 0, "AbstractListItem"); | ||
100 | qmlRegisterType(componentUrl(QStringLiteral("ApplicationHeader.qml")), uri, 2, 0, "ApplicationHeader"); | 102 | qmlRegisterType(componentUrl(QStringLiteral("ApplicationHeader.qml")), uri, 2, 0, "ApplicationHeader"); | ||
101 | qmlRegisterType(componentUrl(QStringLiteral("ToolBarApplicationHeader.qml")), uri, 2, 0, "ToolBarApplicationHeader"); | 103 | qmlRegisterType(componentUrl(QStringLiteral("ToolBarApplicationHeader.qml")), uri, 2, 0, "ToolBarApplicationHeader"); | ||
Show All 28 Lines | 123 | #endif | |||
130 | qmlRegisterType(componentUrl(QStringLiteral("SwipeListItem.qml")), uri, 2, 0, "SwipeListItem"); | 132 | qmlRegisterType(componentUrl(QStringLiteral("SwipeListItem.qml")), uri, 2, 0, "SwipeListItem"); | ||
131 | 133 | | |||
132 | //2.1 | 134 | //2.1 | ||
133 | qmlRegisterType(componentUrl(QStringLiteral("AbstractItemViewHeader.qml")), uri, 2, 1, "AbstractItemViewHeader"); | 135 | qmlRegisterType(componentUrl(QStringLiteral("AbstractItemViewHeader.qml")), uri, 2, 1, "AbstractItemViewHeader"); | ||
134 | qmlRegisterType(componentUrl(QStringLiteral("ItemViewHeader.qml")), uri, 2, 1, "ItemViewHeader"); | 136 | qmlRegisterType(componentUrl(QStringLiteral("ItemViewHeader.qml")), uri, 2, 1, "ItemViewHeader"); | ||
135 | qmlRegisterType(componentUrl(QStringLiteral("AbstractApplicationItem.qml")), uri, 2, 1, "AbstractApplicationItem"); | 137 | qmlRegisterType(componentUrl(QStringLiteral("AbstractApplicationItem.qml")), uri, 2, 1, "AbstractApplicationItem"); | ||
136 | qmlRegisterType(componentUrl(QStringLiteral("ApplicationItem.qml")), uri, 2, 1, "ApplicationItem"); | 138 | qmlRegisterType(componentUrl(QStringLiteral("ApplicationItem.qml")), uri, 2, 1, "ApplicationItem"); | ||
137 | 139 | | |||
140 | //2.2 | ||||
141 | //Theme changed from a singleton to an attached property | ||||
142 | qmlRegisterUncreatableType<Kirigami::PlatformTheme>(uri, 2, 2, "Theme", "Cannot create objects of type Theme, use it as an attached poperty"); | ||||
143 | | ||||
144 | //2.3 | ||||
145 | qmlRegisterType(componentUrl(QStringLiteral("FormLayout.qml")), uri, 2, 3, "FormLayout"); | ||||
146 | qmlRegisterUncreatableType<FormLayoutAttached>(uri, 2, 3, "FormData", "Cannot create objects of type FormData, use it as an attached poperty"); | ||||
147 | qmlRegisterUncreatableType<MnemonicAttached>(uri, 2, 3, "MnemonicData", "Cannot create objects of type MnemonicData, use it as an attached poperty"); | ||||
148 | | ||||
138 | qmlProtectModule(uri, 2); | 149 | qmlProtectModule(uri, 2); | ||
139 | } | 150 | } | ||
140 | 151 | | |||
141 | #include "moc_kirigamiplugin.cpp" | 152 | #include "moc_kirigamiplugin.cpp" | ||
142 | 153 | |