Changeset View
Changeset View
Standalone View
Standalone View
src/kirigamiplugin.cpp
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Line(s) | 53 | if (!style.isEmpty() && QFile::exists(resolveFilePath(QStringLiteral("/styles/") + style))) { | |||
---|---|---|---|---|---|
54 | m_stylesFallbackChain.prepend(style); | 54 | m_stylesFallbackChain.prepend(style); | ||
55 | } | 55 | } | ||
56 | //At this point the fallback chain will be selected->Desktop->Fallback | 56 | //At this point the fallback chain will be selected->Desktop->Fallback | ||
57 | 57 | | |||
58 | 58 | | |||
59 | //TODO: in this plugin it will end up something similar to | 59 | //TODO: in this plugin it will end up something similar to | ||
60 | //PlasmaCore's ColorScope? | 60 | //PlasmaCore's ColorScope? | ||
61 | 61 | | |||
62 | qmlRegisterUncreatableType<ApplicationHeaderStyle>(uri, 1, 0, "ApplicationHeaderStyle", "Cannot create objects of type ApplicationHeaderStyle"); | 62 | qmlRegisterUncreatableType<ApplicationHeaderStyle>(uri, 2, 0, "ApplicationHeaderStyle", "Cannot create objects of type ApplicationHeaderStyle"); | ||
63 | 63 | | |||
64 | qmlRegisterSingletonType(componentPath(QStringLiteral("Theme.qml")), uri, 1, 0, "Theme"); | 64 | qmlRegisterSingletonType(componentPath(QStringLiteral("Theme.qml")), uri, 2, 0, "Theme"); | ||
65 | qmlRegisterSingletonType(componentPath(QStringLiteral("Units.qml")), uri, 1, 0, "Units"); | 65 | qmlRegisterSingletonType(componentPath(QStringLiteral("Units.qml")), uri, 2, 0, "Units"); | ||
66 | 66 | | |||
67 | qmlRegisterType(componentPath(QStringLiteral("Action.qml")), uri, 1, 0, "Action"); | 67 | qmlRegisterType(componentPath(QStringLiteral("Action.qml")), uri, 2, 0, "Action"); | ||
68 | qmlRegisterType(componentPath(QStringLiteral("AbstractApplicationHeader.qml")), uri, 1, 0, "AbstractApplicationHeader"); | 68 | qmlRegisterType(componentPath(QStringLiteral("AbstractApplicationHeader.qml")), uri, 2, 0, "AbstractApplicationHeader"); | ||
69 | qmlRegisterType(componentPath(QStringLiteral("AbstractApplicationWindow.qml")), uri, 1, 0, "AbstractApplicationWindow"); | 69 | qmlRegisterType(componentPath(QStringLiteral("AbstractApplicationWindow.qml")), uri, 2, 0, "AbstractApplicationWindow"); | ||
70 | qmlRegisterType(componentPath(QStringLiteral("AbstractListItem.qml")), uri, 1, 0, "AbstractListItem"); | 70 | qmlRegisterType(componentPath(QStringLiteral("AbstractListItem.qml")), uri, 2, 0, "AbstractListItem"); | ||
71 | qmlRegisterType(componentPath(QStringLiteral("ApplicationHeader.qml")), uri, 1, 0, "ApplicationHeader"); | 71 | qmlRegisterType(componentPath(QStringLiteral("ApplicationHeader.qml")), uri, 2, 0, "ApplicationHeader"); | ||
72 | qmlRegisterType(componentPath(QStringLiteral("ToolBarApplicationHeader.qml")), uri, 1, 0, "ToolBarApplicationHeader"); | 72 | qmlRegisterType(componentPath(QStringLiteral("ToolBarApplicationHeader.qml")), uri, 2, 0, "ToolBarApplicationHeader"); | ||
73 | qmlRegisterType(componentPath(QStringLiteral("ApplicationWindow.qml")), uri, 1, 0, "ApplicationWindow"); | 73 | qmlRegisterType(componentPath(QStringLiteral("ApplicationWindow.qml")), uri, 2, 0, "ApplicationWindow"); | ||
74 | qmlRegisterType(componentPath(QStringLiteral("BasicListItem.qml")), uri, 1, 0, "BasicListItem"); | 74 | qmlRegisterType(componentPath(QStringLiteral("BasicListItem.qml")), uri, 2, 0, "BasicListItem"); | ||
75 | qmlRegisterType(componentPath(QStringLiteral("OverlayDrawer.qml")), uri, 1, 0, "OverlayDrawer"); | 75 | qmlRegisterType(componentPath(QStringLiteral("OverlayDrawer.qml")), uri, 2, 0, "OverlayDrawer"); | ||
76 | qmlRegisterType(componentPath(QStringLiteral("ContextDrawer.qml")), uri, 1, 0, "ContextDrawer"); | 76 | qmlRegisterType(componentPath(QStringLiteral("ContextDrawer.qml")), uri, 2, 0, "ContextDrawer"); | ||
77 | qmlRegisterType(componentPath(QStringLiteral("GlobalDrawer.qml")), uri, 1, 0, "GlobalDrawer"); | 77 | qmlRegisterType(componentPath(QStringLiteral("GlobalDrawer.qml")), uri, 2, 0, "GlobalDrawer"); | ||
78 | qmlRegisterType(componentPath(QStringLiteral("Heading.qml")), uri, 1, 0, "Heading"); | 78 | qmlRegisterType(componentPath(QStringLiteral("Heading.qml")), uri, 2, 0, "Heading"); | ||
79 | qmlRegisterType(componentPath(QStringLiteral("Separator.qml")), uri, 1, 0, "Separator"); | 79 | qmlRegisterType(componentPath(QStringLiteral("Separator.qml")), uri, 2, 0, "Separator"); | ||
80 | 80 | | |||
81 | //The icon is "special: we have to use a wrapper class to QIcon on desktops | 81 | //The icon is "special: we have to use a wrapper class to QIcon on desktops | ||
82 | #if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS) | 82 | #if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS) | ||
83 | if (!m_stylesFallbackChain.isEmpty() && m_stylesFallbackChain.first() == QStringLiteral("Desktop")) { | 83 | if (!m_stylesFallbackChain.isEmpty() && m_stylesFallbackChain.first() == QStringLiteral("Desktop")) { | ||
84 | qmlRegisterType<DesktopIcon>(uri, 1, 0, "Icon"); | 84 | qmlRegisterType<DesktopIcon>(uri, 2, 0, "Icon"); | ||
85 | } else { | 85 | } else { | ||
86 | qmlRegisterType(componentPath(QStringLiteral("Icon.qml")), uri, 1, 0, "Icon"); | 86 | qmlRegisterType(componentPath(QStringLiteral("Icon.qml")), uri, 2, 0, "Icon"); | ||
87 | } | 87 | } | ||
88 | #else | 88 | #else | ||
89 | qmlRegisterType(componentPath(QStringLiteral("Icon.qml")), uri, 1, 0, "Icon"); | 89 | qmlRegisterType(componentPath(QStringLiteral("Icon.qml")), uri, 2, 0, "Icon"); | ||
90 | #endif | 90 | #endif | ||
91 | 91 | | |||
92 | qmlRegisterType(componentPath(QStringLiteral("Label.qml")), uri, 1, 0, "Label"); | 92 | qmlRegisterType(componentPath(QStringLiteral("Label.qml")), uri, 2, 0, "Label"); | ||
93 | qmlRegisterType(componentPath(QStringLiteral("OverlaySheet.qml")), uri, 1, 0, "OverlaySheet"); | 93 | qmlRegisterType(componentPath(QStringLiteral("OverlaySheet.qml")), uri, 2, 0, "OverlaySheet"); | ||
94 | qmlRegisterType(componentPath(QStringLiteral("Page.qml")), uri, 1, 0, "Page"); | 94 | qmlRegisterType(componentPath(QStringLiteral("Page.qml")), uri, 2, 0, "Page"); | ||
95 | qmlRegisterType(componentPath(QStringLiteral("ScrollablePage.qml")), uri, 1, 0, "ScrollablePage"); | 95 | qmlRegisterType(componentPath(QStringLiteral("ScrollablePage.qml")), uri, 2, 0, "ScrollablePage"); | ||
96 | qmlRegisterType(componentPath(QStringLiteral("SplitDrawer.qml")), uri, 1, 0, "SplitDrawer"); | 96 | qmlRegisterType(componentPath(QStringLiteral("SplitDrawer.qml")), uri, 2, 0, "SplitDrawer"); | ||
97 | qmlRegisterType(componentPath(QStringLiteral("SwipeListItem.qml")), uri, 1, 0, "SwipeListItem"); | 97 | qmlRegisterType(componentPath(QStringLiteral("SwipeListItem.qml")), uri, 2, 0, "SwipeListItem"); | ||
98 | } | 98 | } | ||
99 | 99 | | |||
100 | #include "moc_kirigamiplugin.cpp" | 100 | #include "moc_kirigamiplugin.cpp" | ||
101 | 101 | |