Commit 349f96db authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: apply search on latest Inserted Item

Closes #4998
parent 98b99166
...@@ -74,6 +74,7 @@ PLModel::PLModel( playlist_t *_p_playlist, /* THEPL */ ...@@ -74,6 +74,7 @@ PLModel::PLModel( playlist_t *_p_playlist, /* THEPL */
sortingMenu = NULL; sortingMenu = NULL;
rootItem = NULL; /* PLItem rootItem, will be set in rebuild( ) */ rootItem = NULL; /* PLItem rootItem, will be set in rebuild( ) */
latestSearch = QString();
/* Icons initialization */ /* Icons initialization */
#define ADD_ICON(type, x) icons[ITEM_TYPE_##type] = QIcon( x ) #define ADD_ICON(type, x) icons[ITEM_TYPE_##type] = QIcon( x )
...@@ -653,6 +654,8 @@ void PLModel::processItemAppend( int i_item, int i_parent ) ...@@ -653,6 +654,8 @@ void PLModel::processItemAppend( int i_item, int i_parent )
if( newItem->inputItem() == THEMIM->currentInputItem() ) if( newItem->inputItem() == THEMIM->currentInputItem() )
emit currentIndexChanged( index( newItem, 0 ) ); emit currentIndexChanged( index( newItem, 0 ) );
search( latestSearch, index( rootItem, 0), false /*FIXME*/ );
} }
void PLModel::rebuild( playlist_item_t *p_root ) void PLModel::rebuild( playlist_item_t *p_root )
...@@ -855,6 +858,8 @@ void PLModel::sort( const int i_root_id, const int column, Qt::SortOrder order ) ...@@ -855,6 +858,8 @@ void PLModel::sort( const int i_root_id, const int column, Qt::SortOrder order )
void PLModel::search( const QString& search_text, const QModelIndex & idx, bool b_recursive ) void PLModel::search( const QString& search_text, const QModelIndex & idx, bool b_recursive )
{ {
latestSearch = search_text;
/** \todo Fire the search with a small delay ? */ /** \todo Fire the search with a small delay ? */
PL_LOCK; PL_LOCK;
{ {
......
...@@ -174,6 +174,9 @@ private: ...@@ -174,6 +174,9 @@ private:
/* Zoom factor for font-size */ /* Zoom factor for font-size */
int i_zoom; int i_zoom;
/* */
QString latestSearch;
private slots: private slots:
void popupPlay(); void popupPlay();
void popupDel(); void popupDel();
......
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