From: Jean-Baptiste Kempf Date: Mon, 16 Mar 2009 22:32:20 +0000 (+0100) Subject: Qt: fix a crash when you don't want to have the recent items. And don't even show... X-Git-Tag: 1.0.0-pre1~52 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=b1338135703fa29e95257a65c21a90be9e60eef1;p=vlc Qt: fix a crash when you don't want to have the recent items. And don't even show the menu. --- diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp index 946be41eff..8863a4d687 100644 --- a/modules/gui/qt4/menus.cpp +++ b/modules/gui/qt4/menus.cpp @@ -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(); diff --git a/modules/gui/qt4/recents.cpp b/modules/gui/qt4/recents.cpp index 9445cda0aa..7cdf80ec9b 100644 --- a/modules/gui/qt4/recents.cpp +++ b/modules/gui/qt4/recents.cpp @@ -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(); }