]> git.sesse.net Git - vlc/commitdiff
Leave recent items filter empty.
authorAntoine Cellerier <dionoea@videolan.org>
Sun, 4 Jan 2009 16:31:20 +0000 (17:31 +0100)
committerAntoine Cellerier <dionoea@videolan.org>
Sun, 4 Jan 2009 16:31:53 +0000 (17:31 +0100)
modules/gui/qt4/qt4.cpp
modules/gui/qt4/recents.cpp

index 88a47c8944759775b81ae5a8193a6209b6b2b530..615bfaca8079eb862d0a531d7c8eda5629471474 100644 (file)
@@ -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,
index 4fbae09e980811b3cddf329db6c96fba39bfafe4..c3014424fbe080eb34d42cd111ff6e74136fccf8 100644 (file)
@@ -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) );
     }
 }