diff options
-rw-r--r-- | kxkb/kxkb.cpp | 29 | ||||
-rw-r--r-- | kxkb/kxkb.h | 4 |
2 files changed, 7 insertions, 26 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())); } } diff --git a/kxkb/kxkb.h b/kxkb/kxkb.h index 5708efd48..fe07f049e 100644 --- a/kxkb/kxkb.h +++ b/kxkb/kxkb.h @@ -79,9 +79,7 @@ protected slots: void showLayoutNotification(); void showErrorNotification(TQString layout); - void hardwareAdded(TDEGenericDevice *dev); - void hardwareRemoved(TDEGenericDevice *dev); - void hardwareUpdated(TDEGenericDevice *dev); + void hardwareChanged(TDEGenericDevice *dev); void applySettings(); |