]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiSelectionManager.cpp
On Linux show in crash message box the backtrace
[lyx.git] / src / frontends / qt4 / GuiSelectionManager.cpp
index a25b154ccfae37fc82724d50fd4d17e997d1ba15..d3d2b01f410f9204cfb9054e33808411b88f973a 100644 (file)
@@ -49,15 +49,10 @@ GuiSelectionManager::GuiSelectionManager(
        QPushButton * down,
        QAbstractListModel * amod,
        QAbstractListModel * smod)
+  : availableLV(avail), selectedLV(sel), addPB(add), deletePB(del),
+               upPB(up), downPB(down), availableModel(amod), selectedModel(smod),
+    selectedHasFocus_(false)
 {
-       availableLV = avail;
-       selectedLV = sel;
-       addPB = add;
-       deletePB = del;
-       upPB = up;
-       downPB = down;
-       availableModel = amod;
-       selectedModel = smod;
        
        selectedLV->setModel(smod);
        availableLV->setModel(amod);
@@ -87,7 +82,6 @@ GuiSelectionManager::GuiSelectionManager(
        
        availableLV->installEventFilter(this);
        selectedLV->installEventFilter(this);
-       selectedHasFocus_ = false;
 }
 
 
@@ -361,12 +355,12 @@ bool GuiSelectionManager::eventFilter(QObject * obj, QEvent * event)
                        // This is designed to work both with the main enter key
                        // and the one on the numeric keypad.
                        if (keyPressed == Qt::Key_Enter || keyPressed == Qt::Key_Return) {
-                               if (!keyModifiers)
-                                       addPB_clicked();
-                               else if (keyModifiers == Qt::ControlModifier ||
-                                               keyModifiers == Qt::KeypadModifier  ||
-                                               keyModifiers == (Qt::ControlModifier | Qt::KeypadModifier)) {
-                                       if (addPB->isEnabled()) {
+                               if (addPB->isEnabled()) {
+                                       if (!keyModifiers) {
+                                               addPB_clicked();
+                                       } else if (keyModifiers == Qt::ControlModifier || 
+                                                 keyModifiers == Qt::KeypadModifier  ||
+                                                 keyModifiers == (Qt::ControlModifier | Qt::KeypadModifier)) {
                                                addPB_clicked();
                                                okHook(); //signal
                                        }