Commit d0307eff authored by Jonathan Marten's avatar Jonathan Marten

Touchpad KDED module: Convert to JSON metadata

The desktop file kded_touchpad.desktop sets X-KDE-DBus-ModuleName=touchpad,
which is presumably intended to register the KDED module under that
name on DBus.  However, this key appears to be being ignored, and the
module is registered under the default path "/modules/kded_touchpad".
This incorrect path means that touchpad control via the Plasma applet
does not work, and 'kcmshell5 kcmkded' does not show the touchpad module
status correctly.

Differential Revision: https://phabricator.kde.org/D13360
parent f9a8b977
......@@ -6,7 +6,6 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/version.h.cmake"
)
SET(SRCS
plugins.cpp
touchpadbackend.cpp
logging.cpp
)
......@@ -59,6 +58,9 @@ add_library(kded_touchpad MODULE
${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,9 +92,8 @@ install(FILES kcm/kcm_touchpad.desktop
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}
......@@ -101,10 +102,6 @@ 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}
)
......@@ -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"
......
......@@ -24,10 +24,14 @@
#include <QDBusConnectionInterface>
#include <KNotification>
#include <KLocalizedString>
#include <KPluginFactory>
#include "plugins.h"
#include "kdedactions.h"
K_PLUGIN_FACTORY_WITH_JSON(TouchpadDisablerFactory,
"kded_touchpad.json",
registerPlugin<TouchpadDisabler>();)
bool TouchpadDisabler::workingTouchpadFound() const
{
return m_workingTouchpadFound;
......@@ -71,6 +75,7 @@ TouchpadDisabler::TouchpadDisabler(QObject *parent, const QVariantList &)
connect(&m_keyboardActivityTimeout, SIGNAL(timeout()),
SLOT(timerElapsed()));
updateCurrentState();
m_userRequestedState = m_touchpadEnabled;
reloadSettings();
......@@ -301,3 +306,5 @@ void TouchpadDisabler::showOsd()
QDBusConnection::sessionBus().asyncCall(msg);
}
#include "kded.moc"
......@@ -23,8 +23,6 @@
#include <KLocalizedString>
#include <KGlobalAccel>
#include "plugins.h"
TouchpadGlobalActions::TouchpadGlobalActions(bool isConfiguration, QObject *parent)
: KActionCollection(parent)
{
......
/*
* Copyright (C) 2013 Alexander Mezin <mezin.alexander@gmail.com>
*
* 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 <KPluginFactory>
#include <KLocalizedString>
#include "kcm/touchpadconfigcontainer.h"
#include "kded/kded.h"
K_PLUGIN_FACTORY(TouchpadPluginFactory,
registerPlugin<TouchpadDisabler>();
registerPlugin<TouchpadConfigContainer>("kcm");)
#include <plugins.moc>
//K_EXPORT_PLUGIN(TouchpadPluginFactory(buildAboutData()))
/*
* Copyright (C) 2013 Alexander Mezin <mezin.alexander@gmail.com>
*
* 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 <KPluginFactory>
K_PLUGIN_FACTORY_DECLARATION(TouchpadPluginFactory)
#endif // PLUGINS_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment