read the kind of components from plasmarc

This commit is contained in:
Marco Martin 2011-11-07 18:46:21 +01:00
parent 06bbb405c5
commit 28f573d18f
2 changed files with 10 additions and 19 deletions

View File

@ -27,22 +27,8 @@ install(DIRECTORY qml/ DESTINATION ${IMPORTS_INSTALL_DIR}/org/kde/plasma/compone
ADD_DEFINITIONS(-DTOUCH)
#The platform specific stuff, overwrites a copy of the desktop one
set(plasmacomponentstouch_SRCS
plasmacomponentsplugin.cpp
qrangemodel.cpp
enums.cpp
qmenu.cpp
qmenuitem.cpp
kdialogproxy.cpp
)
add_library(plasmacomponentstouchplugin SHARED ${plasmacomponentstouch_SRCS})
target_link_libraries(plasmacomponentstouchplugin ${QT_QTCORE_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY} ${QT_QTGUI_LIBRARY} ${KDE4_KDEUI_LIBRARY})
install(TARGETS plasmacomponentstouchplugin DESTINATION ${PLUGIN_INSTALL_DIR}/platformimports/touch/org/kde/plasma/components)
install(TARGETS plasmacomponentsplugin DESTINATION ${PLUGIN_INSTALL_DIR}/platformimports/touch/org/kde/plasma/components)
install(DIRECTORY qml/ DESTINATION ${PLUGIN_INSTALL_DIR}/platformimports/touch/org/kde/plasma/components)
install(DIRECTORY platformcomponents/touch/ DESTINATION ${PLUGIN_INSTALL_DIR}/platformimports/touch/org/kde/plasma/components)

View File

@ -24,6 +24,8 @@
#include "qrangemodel.h"
#include <KSharedConfig>
#include "enums.h"
#include "qmenu.h"
#include "qmenuitem.h"
@ -33,14 +35,17 @@ void PlasmaComponentsPlugin::registerTypes(const char *uri)
{
Q_ASSERT(uri == QLatin1String("org.kde.plasma.components"));
KConfigGroup cg(KSharedConfig::openConfig("plasmarc"), "Plasma-components-platform");
const QString componentsPlatform = cg.readEntry("name", "desktop");
qmlRegisterType<QMenuProxy>(uri, 0, 1, "Menu");
qmlRegisterType<QMenuProxy>(uri, 0, 1, "ContextMenu");
qmlRegisterType<QMenuItem>(uri, 0, 1, "MenuItem");
#ifndef TOUCH
qmlRegisterType<KDialogProxy>(uri, 0, 1, "QueryDialog");
#endif
if (componentsPlatform == "desktop") {
qmlRegisterType<KDialogProxy>(uri, 0, 1, "QueryDialog");
}
qmlRegisterType<Plasma::QRangeModel>(uri, 0, 1, "RangeModel");