diff options
Diffstat (limited to 'kxkb/kxkb.cpp')
-rw-r--r-- | kxkb/kxkb.cpp | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/kxkb/kxkb.cpp b/kxkb/kxkb.cpp index 320b55f40..01df09add 100644 --- a/kxkb/kxkb.cpp +++ b/kxkb/kxkb.cpp @@ -31,6 +31,7 @@ DESCRIPTION #include <tqfile.h> #include <tqstringlist.h> #include <tqimage.h> +#include <tqtimer.h> #include <tdeaboutdata.h> #include <tdecmdlineargs.h> @@ -87,9 +88,9 @@ KXKBApp::KXKBApp(bool allowStyles, bool GUIenabled) addKipcEventMask( KIPC::SettingsChanged ); TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices(); - connect(hwdevices, TQ_SIGNAL(hardwareAdded(TDEGenericDevice*)), this, TQ_SLOT(hardwareAdded(TDEGenericDevice*))); - connect(hwdevices, TQ_SIGNAL(hardwareRemoved(TDEGenericDevice*)), this, TQ_SLOT(hardwareRemoved(TDEGenericDevice*))); - connect(hwdevices, TQ_SIGNAL(hardwareUpdated(TDEGenericDevice*)), this, TQ_SLOT(hardwareUpdated(TDEGenericDevice*))); + connect(hwdevices, TQ_SIGNAL(hardwareAdded(TDEGenericDevice*)), this, TQ_SLOT(hardwareChanged(TDEGenericDevice*))); + connect(hwdevices, TQ_SIGNAL(hardwareRemoved(TDEGenericDevice*)), this, TQ_SLOT(hardwareChanged(TDEGenericDevice*))); + connect(hwdevices, TQ_SIGNAL(hardwareUpdated(TDEGenericDevice*)), this, TQ_SLOT(hardwareChanged(TDEGenericDevice*))); } KXKBApp::~KXKBApp() @@ -190,29 +191,11 @@ void KXKBApp::initTray() m_tray->show(); } -void KXKBApp::hardwareAdded(TDEGenericDevice *dev) +void KXKBApp::hardwareChanged(TDEGenericDevice *dev) { if (dev->type() == TDEGenericDeviceType::Keyboard) { - kdDebug() << "keyboard attached: " << dev->friendlyName() << endl; - applySettings(); - } -} -void KXKBApp::hardwareRemoved(TDEGenericDevice *dev) -{ - if (dev->type() == TDEGenericDeviceType::Keyboard) - { - kdDebug() << "keyboard removed: " << dev->friendlyName() << endl; - applySettings(); - } -} - -void KXKBApp::hardwareUpdated(TDEGenericDevice *dev) -{ - if (dev->type() == TDEGenericDeviceType::Keyboard) - { - kdDebug() << "keyboard updated: " << dev->friendlyName() << endl; - applySettings(); + TQTimer::singleShot(500, this, TQ_SLOT(applySettings())); } } |