Skip to content

Commit ec28f64

Browse files
committed
Fix selection when changing between both doc lists.
1 parent 9a416f6 commit ec28f64

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/alldocsview.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,23 @@ QWidget* AllDocsView::initializeTreeWidget()
156156
void AllDocsView::setView( ViewType type )
157157
{
158158
// change the document listing widget
159+
QModelIndex current;
159160
if( type == FlatList) {
160161
_stack->setCurrentIndex(0);
162+
current = _tableView->currentIndex();
161163
} else {
162164
_stack->setCurrentIndex(1);
165+
current = _dateView->currentIndex();
163166
}
164167
// clear the details view
165168
mAllViewDetails->slotClearView();
166169

167-
mCurrentlySelected = QModelIndex();
170+
if( current.isValid() > 0 ) {
171+
slotCurrentChanged(current, QModelIndex());
172+
} else {
173+
// workaround, not cool.
174+
mCurrentlySelected = QModelIndex();
175+
}
168176
}
169177

170178
void AllDocsView::slotBuildView()

0 commit comments

Comments
 (0)