Commit d6c71453 authored by Ilkka Ollakka's avatar Ilkka Ollakka

qt4: keep selected popup item visible when sorting

Still could be better to leave selected item as selected after sorting.
parent 0c33ffc1
......@@ -864,6 +864,15 @@ void PLModel::sort( int i_root_id, int column, Qt::SortOrder order )
endInsertRows( );
}
PL_UNLOCK;
/* if we have popup item, try to make sure that you keep that item visible */
if( i_popup_item > -1 )
{
PLItem *popupitem = findById( rootItem, i_popup_item );
if( popupitem ) emit currentChanged( index( popupitem, 0 ) );
/* reset i_popup_item as we don't show it as selected anymore anyway */
i_popup_item = -1;
}
else if( currentIndex().isValid() ) emit currentChanged( currentIndex() );
}
void PLModel::search( const QString& search_text, const QModelIndex & idx, bool b_recursive )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment