[vlc-commits] Qt: apply search on latest Inserted Item
Jean-Baptiste Kempf
git at videolan.org
Thu Nov 17 01:44:56 CET 2011
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Nov 17 01:30:32 2011 +0100| [349f96db5e52da900edabf1c43ae9fec7846393a] | committer: Jean-Baptiste Kempf
Qt: apply search on latest Inserted Item
Closes #4998
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=349f96db5e52da900edabf1c43ae9fec7846393a
---
.../gui/qt4/components/playlist/playlist_model.cpp | 5 +++++
.../gui/qt4/components/playlist/playlist_model.hpp | 3 +++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp b/modules/gui/qt4/components/playlist/playlist_model.cpp
index 0297b64..8b3e089 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.cpp
@@ -74,6 +74,7 @@ PLModel::PLModel( playlist_t *_p_playlist, /* THEPL */
sortingMenu = NULL;
rootItem = NULL; /* PLItem rootItem, will be set in rebuild( ) */
+ latestSearch = QString();
/* Icons initialization */
#define ADD_ICON(type, x) icons[ITEM_TYPE_##type] = QIcon( x )
@@ -653,6 +654,8 @@ void PLModel::processItemAppend( int i_item, int i_parent )
if( newItem->inputItem() == THEMIM->currentInputItem() )
emit currentIndexChanged( index( newItem, 0 ) );
+
+ search( latestSearch, index( rootItem, 0), false /*FIXME*/ );
}
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 )
void PLModel::search( const QString& search_text, const QModelIndex & idx, bool b_recursive )
{
+ latestSearch = search_text;
+
/** \todo Fire the search with a small delay ? */
PL_LOCK;
{
diff --git a/modules/gui/qt4/components/playlist/playlist_model.hpp b/modules/gui/qt4/components/playlist/playlist_model.hpp
index 4caab5d..6c66c7e 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.hpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.hpp
@@ -174,6 +174,9 @@ private:
/* Zoom factor for font-size */
int i_zoom;
+ /* */
+ QString latestSearch;
+
private slots:
void popupPlay();
void popupDel();
More information about the vlc-commits
mailing list