telutils/dialpad/src/dialpadvideomailboxeventfilter.cpp
changeset 33 8d5d7fcf9b59
parent 32 1f002146abb4
child 42 35488577e233
--- a/telutils/dialpad/src/dialpadvideomailboxeventfilter.cpp	Tue Jul 06 14:53:02 2010 +0300
+++ b/telutils/dialpad/src/dialpadvideomailboxeventfilter.cpp	Wed Jul 21 18:26:52 2010 +0300
@@ -43,25 +43,23 @@
 {
     Q_UNUSED(watched)
     bool keyEventEaten(false);
-    
-    QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
-    const int keyCode = keyEvent->key();
-    const int eventType = event->type();
-
-    if (eventType == QEvent::KeyPress) {
-        if (checkIfSendEventAndConsumeEvent(keyCode, eventType)) {
+        
+    if (event->type() == QEvent::KeyPress) {
+        QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
+        if (checkIfSendEventAndConsumeEvent(keyEvent->key(), event->type())) {
             keyEventEaten = true;
-        } else if ((isLongKeyPressSupported(keyCode)) &&
+        } else if ((isLongKeyPressSupported(keyEvent->key())) &&
                 !(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) {
-        if (checkIfSendEventAndConsumeEvent(keyCode, eventType)) {
+    } else if (event->type() == QEvent::KeyRelease) {
+        QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
+        if (checkIfSendEventAndConsumeEvent(keyEvent->key(), event->type())) {
             keyEventEaten = true;
-        } else if (isLongKeyPressSupported(keyCode)){
+        } else if (isLongKeyPressSupported(keyEvent->key())){
             mLongPressTimer->stop();
         }
     }