Commit b1338135 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: fix a crash when you don't want to have the recent items. And don't even show the menu.

parent 04af5c7c
......@@ -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();
......
......@@ -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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment