diff --git a/kcms/touchpad/src/CMakeLists.txt b/kcms/touchpad/src/CMakeLists.txt --- a/kcms/touchpad/src/CMakeLists.txt +++ b/kcms/touchpad/src/CMakeLists.txt @@ -6,7 +6,6 @@ ) SET(SRCS - plugins.cpp touchpadbackend.cpp logging.cpp ) @@ -59,6 +58,9 @@ ${SRCS} ${backend_SRCS} ) +kcoreaddons_desktop_to_json(kded_touchpad kded/kded_touchpad.desktop) +set_target_properties(kded_touchpad PROPERTIES OUTPUT_NAME touchpad) + target_link_libraries(kded_touchpad ${backend_LIBS} KF5::KCMUtils @@ -90,21 +92,16 @@ install(FILES kded/touchpaddaemon.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR} ) -install(FILES kded/kded_touchpad.desktop - DESTINATION ${KDE_INSTALL_KSERVICES5DIR}/kded - RENAME touchpad.desktop +install(TARGETS kded_touchpad + DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/kded ) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.touchpad.xml DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR} ) install(FILES kded/kcm_touchpad.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFY5RCDIR} ) -install(TARGETS kded_touchpad - DESTINATION ${KDE_INSTALL_PLUGINDIR} -) - install(FILES kcm/xlib/touchpad.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR} ) diff --git a/kcms/touchpad/src/kcm/xlib/touchpadconfigxlib.cpp b/kcms/touchpad/src/kcm/xlib/touchpadconfigxlib.cpp --- a/kcms/touchpad/src/kcm/xlib/touchpadconfigxlib.cpp +++ b/kcms/touchpad/src/kcm/xlib/touchpadconfigxlib.cpp @@ -34,7 +34,6 @@ #include "customslider.h" #include "sliderpair.h" #include "touchpadbackend.h" -#include "plugins.h" #include "testarea.h" #include "touchpadinterface.h" #include "customconfigdialogmanager.h" diff --git a/kcms/touchpad/src/kded/kded.cpp b/kcms/touchpad/src/kded/kded.cpp --- a/kcms/touchpad/src/kded/kded.cpp +++ b/kcms/touchpad/src/kded/kded.cpp @@ -24,10 +24,14 @@ #include #include #include +#include -#include "plugins.h" #include "kdedactions.h" +K_PLUGIN_FACTORY_WITH_JSON(TouchpadDisablerFactory, + "kded_touchpad.json", + registerPlugin();) + bool TouchpadDisabler::workingTouchpadFound() const { return m_workingTouchpadFound; @@ -71,6 +75,7 @@ connect(&m_keyboardActivityTimeout, SIGNAL(timeout()), SLOT(timerElapsed())); + updateCurrentState(); m_userRequestedState = m_touchpadEnabled; reloadSettings(); @@ -301,3 +306,5 @@ QDBusConnection::sessionBus().asyncCall(msg); } + +#include "kded.moc" diff --git a/kcms/touchpad/src/kded/kdedactions.cpp b/kcms/touchpad/src/kded/kdedactions.cpp --- a/kcms/touchpad/src/kded/kdedactions.cpp +++ b/kcms/touchpad/src/kded/kdedactions.cpp @@ -23,8 +23,6 @@ #include #include -#include "plugins.h" - TouchpadGlobalActions::TouchpadGlobalActions(bool isConfiguration, QObject *parent) : KActionCollection(parent) { diff --git a/kcms/touchpad/src/plugins.h b/kcms/touchpad/src/plugins.h deleted file mode 100644 --- a/kcms/touchpad/src/plugins.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2013 Alexander Mezin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef PLUGINS_H -#define PLUGINS_H - -#include - -K_PLUGIN_FACTORY_DECLARATION(TouchpadPluginFactory) - -#endif // PLUGINS_H diff --git a/kcms/touchpad/src/plugins.cpp b/kcms/touchpad/src/plugins.cpp deleted file mode 100644 --- a/kcms/touchpad/src/plugins.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2013 Alexander Mezin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -//#include "plugins.h" - -#include -#include - -#include "kcm/touchpadconfigcontainer.h" -#include "kded/kded.h" - - -K_PLUGIN_FACTORY(TouchpadPluginFactory, - registerPlugin(); - registerPlugin("kcm");) -#include -//K_EXPORT_PLUGIN(TouchpadPluginFactory(buildAboutData()))