[vlc-devel] commit: Leave recent items filter empty. (Antoine Cellerier )

git version control git at videolan.org
Sun Jan 4 17:31:26 CET 2009


vlc | branch: master | Antoine Cellerier <dionoea at videolan.org> | Sun Jan  4 17:31:20 2009 +0100| [9f7c2895dc8f4251709259044e7f467ddb96b788] | committer: Antoine Cellerier 

Leave recent items filter empty.

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

 modules/gui/qt4/qt4.cpp     |    2 +-
 modules/gui/qt4/recents.cpp |    9 ++++++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp
index 88a47c8..615bfac 100644
--- a/modules/gui/qt4/qt4.cpp
+++ b/modules/gui/qt4/qt4.cpp
@@ -195,7 +195,7 @@ vlc_module_begin ()
 
     add_bool( "qt-recentplay", true, NULL, RECENTPLAY_TEXT,
               RECENTPLAY_TEXT, false );
-    add_string( "qt-recentplay-filter", "xxx|porn", NULL,
+    add_string( "qt-recentplay-filter", "", NULL,
                 RECENTPLAY_FILTER_TEXT, RECENTPLAY_FILTER_LONGTEXT, false );
 
     add_bool( "qt-adv-options", false, NULL, ADVANCED_OPTIONS_TEXT,
diff --git a/modules/gui/qt4/recents.cpp b/modules/gui/qt4/recents.cpp
index 4fbae09..c301442 100644
--- a/modules/gui/qt4/recents.cpp
+++ b/modules/gui/qt4/recents.cpp
@@ -46,7 +46,10 @@ RecentsMRL::RecentsMRL( intf_thread_t *_p_intf ) : p_intf( _p_intf )
 
     isActive = config_GetInt( p_intf, "qt-recentplay" );
     char* psz_tmp = config_GetPsz( p_intf, "qt-recentplay-filter" );
-    filter = new QRegExp( psz_tmp, Qt::CaseInsensitive );
+    if( psz_tmp && *psz_tmp )
+        filter = new QRegExp( psz_tmp, Qt::CaseInsensitive );
+    else
+        filter = NULL;
     free( psz_tmp );
 
     load();
@@ -61,7 +64,7 @@ RecentsMRL::~RecentsMRL()
 
 void RecentsMRL::addRecent( const QString &mrl )
 {
-    if ( !isActive || filter->indexIn( mrl ) >= 0 )
+    if ( !isActive || ( filter && filter->indexIn( mrl ) >= 0 ) )
         return;
 
     msg_Dbg( p_intf, "Adding a new MRL to recent ones: %s", qtu( mrl ) );
@@ -101,7 +104,7 @@ void RecentsMRL::load()
 
     for( int i = 0; i < list.size(); ++i )
     {
-        if (filter->indexIn( list.at(i) ) == -1)
+        if ( !filter && filter->indexIn( list.at(i) ) == -1 )
             stack->append( list.at(i) );
     }
 }




More information about the vlc-devel mailing list