]> git.sesse.net Git - vlc/commitdiff
Qt: fix a crash when you don't want to have the recent items. And don't even show...
authorJean-Baptiste Kempf <jb@videolan.org>
Mon, 16 Mar 2009 22:32:20 +0000 (23:32 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 16 Mar 2009 22:32:20 +0000 (23:32 +0100)
modules/gui/qt4/menus.cpp
modules/gui/qt4/recents.cpp

index 946be41eff20dd1ab773f74ebb7f326512330056..8863a4d68719d841ebeda810e9c623a05a9d6e3d 100644 (file)
@@ -315,9 +315,12 @@ QMenu *QVLCMenu::FileMenu( intf_thread_t *p_intf, QWidget *parent )
     addDPStaticEntry( menu, qtr( "Open &Location from clipboard" ),
                       NULL, SLOT( openUrlDialog() ), "Ctrl+V" );
 
-    recentsMenu = new QMenu( qtr( "&Recent Media" ), menu );
-    updateRecents( p_intf );
-    menu->addMenu( recentsMenu );
+    if( config_GetInt( p_intf, "qt-recentplay" ) )
+    {
+        recentsMenu = new QMenu( qtr( "&Recent Media" ), menu );
+        updateRecents( p_intf );
+        menu->addMenu( recentsMenu );
+    }
     menu->addMenu( SDMenu( p_intf, menu ) );
     menu->addSeparator();
 
index 9445cda0aa9170a270aedd9317f5ed1ebff640cf..7cdf80ec9b5ff7ffa588a274d70d28634f4d9562 100644 (file)
@@ -53,7 +53,7 @@ RecentsMRL::RecentsMRL( intf_thread_t *_p_intf ) : p_intf( _p_intf )
     free( psz_tmp );
 
     load();
-    if ( !isActive ) clear();
+    if( !isActive ) clear();
 }
 
 RecentsMRL::~RecentsMRL()
@@ -89,7 +89,7 @@ void RecentsMRL::clear()
     if ( stack->isEmpty() )
         return;
     stack->clear();
-    QVLCMenu::updateRecents( p_intf );
+    if( !isActive ) QVLCMenu::updateRecents( p_intf );
     save();
 }