]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiSelectionManager.cpp
Initialize class members to please coverity
[lyx.git] / src / frontends / qt4 / GuiSelectionManager.cpp
index 90f90731c56bfb050b885beb0fffc19bf1935dfb..5523495d4f05931444318ebc3ff4222722f2023f 100644 (file)
@@ -15,6 +15,7 @@
 #include <config.h>
 
 #include "GuiSelectionManager.h"
+#include "qt_helpers.h"
 
 #include "support/debug.h"
 
@@ -392,7 +393,7 @@ bool GuiSelectionManager::eventFilter(QObject * obj, QEvent * event)
                                if (addPB->isEnabled()) {
                                        if (!keyModifiers) {
                                                addPB_clicked();
-                                       } else if (keyModifiers == Qt::ControlModifier || 
+                                       } else if (keyModifiers == Qt::ControlModifier ||
                                                  keyModifiers == Qt::KeypadModifier  ||
                                                  keyModifiers == (Qt::ControlModifier | Qt::KeypadModifier)) {
                                                addPB_clicked();
@@ -402,14 +403,18 @@ bool GuiSelectionManager::eventFilter(QObject * obj, QEvent * event)
                                event->accept();
                                return true;
                        }
+                       else if (keyPressed == Qt::Key_Right) {
+                               focusAndHighlight(selectedLV);
+                               event->accept();
+                               return true;
+                       }
                } else if (etype == QEvent::FocusIn) {
                        if (selectedHasFocus_) {
                                selectedHasFocus_ = false;
                                updateHook();
                        }
-                       event->accept();
-                       return true;
-               } 
+                       return false;
+               }
        } else if (obj == selectedLV) {
                if (etype == QEvent::KeyPress) {
                        QKeyEvent * keyEvent = static_cast<QKeyEvent *>(event);
@@ -426,7 +431,7 @@ bool GuiSelectionManager::eventFilter(QObject * obj, QEvent * event)
                                        updateHook();
                                } else
                                        return QObject::eventFilter(obj, event);
-                       } 
+                       }
                        // Ctrl-Up activates upPB
                        else if (keyPressed == Qt::Key_Up) {
                                if (keyModifiers == Qt::ControlModifier) {
@@ -435,7 +440,7 @@ bool GuiSelectionManager::eventFilter(QObject * obj, QEvent * event)
                                        event->accept();
                                        return true;
                                }
-                       } 
+                       }
                        // Ctrl-Down activates downPB
                        else if (keyPressed == Qt::Key_Down) {
                                if (keyModifiers == Qt::ControlModifier) {
@@ -445,13 +450,17 @@ bool GuiSelectionManager::eventFilter(QObject * obj, QEvent * event)
                                        return true;
                                }
                        }
+                       else if (keyPressed == Qt::Key_Left) {
+                               focusAndHighlight(availableLV);
+                               event->accept();
+                               return true;
+                       }
                } else if (etype == QEvent::FocusIn) {
                        if (!selectedHasFocus_) {
                                selectedHasFocus_ = true;
                                updateHook();
                        }
-                       event->accept();
-                       return true;
+                       return false;
                }
        }
        return QObject::eventFilter(obj, event);