mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
This should give us the selected index, not the current index.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33850 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
adf858ebcc
commit
04da0f68fb
@ -94,22 +94,22 @@ void GuiSelectionManager::update()
|
||||
|
||||
QModelIndex GuiSelectionManager::getSelectedIndex() const
|
||||
{
|
||||
bool const have_avl =
|
||||
!availableLV->selectionModel()->selectedIndexes().isEmpty();
|
||||
bool const have_sel =
|
||||
!selectedLV->selectionModel()->selectedIndexes().isEmpty();
|
||||
QModelIndexList avail = availableLV->selectionModel()->selectedIndexes();
|
||||
QModelIndexList sel = selectedLV->selectionModel()->selectedIndexes();
|
||||
bool const have_avl = !avail.isEmpty();
|
||||
bool const have_sel = !sel.isEmpty();
|
||||
|
||||
if (selectedFocused()) {
|
||||
if (have_sel)
|
||||
return selectedLV->currentIndex();
|
||||
return sel.front();
|
||||
if (have_avl)
|
||||
return availableLV->currentIndex();
|
||||
return avail.front();
|
||||
}
|
||||
else { // available has focus
|
||||
if (have_avl)
|
||||
return availableLV->currentIndex();
|
||||
return avail.front();
|
||||
if (have_sel)
|
||||
return selectedLV->currentIndex();
|
||||
return sel.front();
|
||||
}
|
||||
return QModelIndex();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user