]> git.lyx.org Git - features.git/commitdiff
GuiSelectionManager: fix getSelectedIndex for availableLV
authorJuergen Spitzmueller <spitz@lyx.org>
Wed, 20 Nov 2019 13:07:05 +0000 (14:07 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Wed, 20 Nov 2019 13:07:05 +0000 (14:07 +0100)
src/frontends/qt/GuiSelectionManager.cpp

index d77acbadc6b773e74ed04a2edb7ca661146174a2..df43d0c5ff58949107c04ea242ca0b3f3f52c4d9 100644 (file)
@@ -117,7 +117,7 @@ void GuiSelectionManager::updateButtons()
 
 QModelIndex GuiSelectionManager::getSelectedIndex(int const c) const
 {
-       QModelIndexList avail = availableLV->selectionModel()->selectedRows(c);
+       QModelIndexList avail = availableLV->selectionModel()->selectedIndexes();
        QModelIndexList sel   = selectedLV->selectionModel()->selectedRows(c);
        bool const have_avl = !avail.isEmpty();
        bool const have_sel = !sel.isEmpty();
@@ -126,11 +126,11 @@ QModelIndex GuiSelectionManager::getSelectedIndex(int const c) const
                if (have_sel)
                        return sel.front();
                if (have_avl)
-                       return avail.front();
+                       return avail.first();
        }
        else { // available has focus
                if (have_avl)
-                       return avail.front();
+                       return avail.first();
                if (have_sel)
                        return sel.front();
        }