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