[vlc-commits] commit: Qt: search differently when you are in SD (Jean-Baptiste Kempf )

git at videolan.org git at videolan.org
Sun Oct 24 03:26:07 CEST 2010


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Oct 24 03:24:31 2010 +0200| [b131df4e1d11b0bd8df9d51040825cb9fd033345] | committer: Jean-Baptiste Kempf 

Qt: search differently when you are in SD

So that you don't kill the lua.sd search() functions

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b131df4e1d11b0bd8df9d51040825cb9fd033345
---

 .../gui/qt4/components/playlist/standardpanel.cpp  |   16 +++++++++++++---
 .../gui/qt4/components/playlist/standardpanel.hpp  |    1 +
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/standardpanel.cpp b/modules/gui/qt4/components/playlist/standardpanel.cpp
index 58a7be7..88a6573 100644
--- a/modules/gui/qt4/components/playlist/standardpanel.cpp
+++ b/modules/gui/qt4/components/playlist/standardpanel.cpp
@@ -90,8 +90,10 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
     searchEdit->setMaximumWidth( 250 );
     searchEdit->setMinimumWidth( 80 );
     layout->addWidget( searchEdit, 0, 2 );
-    CONNECT( searchEdit, textChanged( const QString& ),
+    CONNECT( searchEdit, textEdited( const QString& ),
              this, search( const QString& ) );
+    CONNECT( searchEdit, editingFinished(),
+             this, searchDelayed() );
     layout->setColumnStretch( 2, 3 );
 
     /* Button to switch views */
@@ -219,10 +221,18 @@ void StandardPLPanel::search( const QString& searchText )
                        flat ? currentView->rootIndex() : QModelIndex(),
                        !flat );
     }
-    else
+}
+
+void StandardPLPanel::searchDelayed()
+{
+    int type;
+    QString name;
+    p_selector->getCurrentSelectedItem( &type, &name );
+
+    if( type == SD_TYPE )
     {
         if( !name.isEmpty() )
-            playlist_QueryServicesDiscovery( THEPL, qtu(name), qtu(searchText) );
+            playlist_QueryServicesDiscovery( THEPL, qtu(name), qtu(searchEdit->text() ) );
     }
 }
 
diff --git a/modules/gui/qt4/components/playlist/standardpanel.hpp b/modules/gui/qt4/components/playlist/standardpanel.hpp
index 82b743e..e0fa814 100644
--- a/modules/gui/qt4/components/playlist/standardpanel.hpp
+++ b/modules/gui/qt4/components/playlist/standardpanel.hpp
@@ -111,6 +111,7 @@ private slots:
     void handleRootChange();
     void gotoPlayingItem();
     void search( const QString& searchText );
+    void searchDelayed();
     void popupSelectColumn( QPoint );
     void popupPlView( const QPoint & );
     void toggleColumnShown( int );



More information about the vlc-commits mailing list