diff --git a/declarativeimports/plasmacomponents/CMakeLists.txt b/declarativeimports/plasmacomponents/CMakeLists.txt index 882bb3907..c7e2b6f92 100644 --- a/declarativeimports/plasmacomponents/CMakeLists.txt +++ b/declarativeimports/plasmacomponents/CMakeLists.txt @@ -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) diff --git a/declarativeimports/plasmacomponents/plasmacomponentsplugin.cpp b/declarativeimports/plasmacomponents/plasmacomponentsplugin.cpp index 3e1d1fab6..5dc904ab9 100644 --- a/declarativeimports/plasmacomponents/plasmacomponentsplugin.cpp +++ b/declarativeimports/plasmacomponents/plasmacomponentsplugin.cpp @@ -24,6 +24,8 @@ #include "qrangemodel.h" +#include + #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(uri, 0, 1, "Menu"); qmlRegisterType(uri, 0, 1, "ContextMenu"); qmlRegisterType(uri, 0, 1, "MenuItem"); -#ifndef TOUCH - qmlRegisterType(uri, 0, 1, "QueryDialog"); -#endif + + if (componentsPlatform == "desktop") { + qmlRegisterType(uri, 0, 1, "QueryDialog"); + } qmlRegisterType(uri, 0, 1, "RangeModel");