telutils/dialpad/src/dialpadbluetootheventfilter.cpp
changeset 33 8d5d7fcf9b59
parent 32 1f002146abb4
child 51 12bc758d6a02
--- a/telutils/dialpad/src/dialpadbluetootheventfilter.cpp	Tue Jul 06 14:53:02 2010 +0300
+++ b/telutils/dialpad/src/dialpadbluetootheventfilter.cpp	Wed Jul 21 18:26:52 2010 +0300
@@ -44,18 +44,17 @@
 bool DialpadBluetoothEventFilter::eventFilter(QObject *watched, QEvent *event)
 {
     Q_UNUSED(watched)
-    QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
-    const int keyCode = keyEvent->key();
-    const int eventType = event->type();
-
-    if (eventType == QEvent::KeyPress && keyCode == Qt::Key_Asterisk) {
-        if (!(mDialpad->editor().text().length() >= 1)) {
+            
+    if (event->type() == QEvent::KeyPress) {
+        QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
+        if (keyEvent->key() == Qt::Key_Asterisk && 
+            !(mDialpad->editor().text().length() >= 1)) {
             //Check that there is only one item in dialpad, if there is more than one
             //do not handle long key press.
             mLongPressTimer->stop();
             mLongPressTimer->start(DialpadLongKeyPressTimeOut);
         }
-    } else if (eventType == QEvent::KeyRelease) {
+    } else if (event->type() == QEvent::KeyRelease) {
             mLongPressTimer->stop();
     }