Commit b131df4e authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: search differently when you are in SD

So that you don't kill the lua.sd search() functions
parent b528f595
...@@ -90,8 +90,10 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent, ...@@ -90,8 +90,10 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
searchEdit->setMaximumWidth( 250 ); searchEdit->setMaximumWidth( 250 );
searchEdit->setMinimumWidth( 80 ); searchEdit->setMinimumWidth( 80 );
layout->addWidget( searchEdit, 0, 2 ); layout->addWidget( searchEdit, 0, 2 );
CONNECT( searchEdit, textChanged( const QString& ), CONNECT( searchEdit, textEdited( const QString& ),
this, search( const QString& ) ); this, search( const QString& ) );
CONNECT( searchEdit, editingFinished(),
this, searchDelayed() );
layout->setColumnStretch( 2, 3 ); layout->setColumnStretch( 2, 3 );
/* Button to switch views */ /* Button to switch views */
...@@ -219,10 +221,18 @@ void StandardPLPanel::search( const QString& searchText ) ...@@ -219,10 +221,18 @@ void StandardPLPanel::search( const QString& searchText )
flat ? currentView->rootIndex() : QModelIndex(), flat ? currentView->rootIndex() : QModelIndex(),
!flat ); !flat );
} }
else }
void StandardPLPanel::searchDelayed()
{
int type;
QString name;
p_selector->getCurrentSelectedItem( &type, &name );
if( type == SD_TYPE )
{ {
if( !name.isEmpty() ) if( !name.isEmpty() )
playlist_QueryServicesDiscovery( THEPL, qtu(name), qtu(searchText) ); playlist_QueryServicesDiscovery( THEPL, qtu(name), qtu(searchEdit->text() ) );
} }
} }
......
...@@ -111,6 +111,7 @@ private slots: ...@@ -111,6 +111,7 @@ private slots:
void handleRootChange(); void handleRootChange();
void gotoPlayingItem(); void gotoPlayingItem();
void search( const QString& searchText ); void search( const QString& searchText );
void searchDelayed();
void popupSelectColumn( QPoint ); void popupSelectColumn( QPoint );
void popupPlView( const QPoint & ); void popupPlView( const QPoint & );
void toggleColumnShown( int ); void toggleColumnShown( int );
......
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