[vlc-devel] commit: Qt: fix a crash when you don't want to have the recent items. And don't even show the menu. (Jean-Baptiste Kempf )
git version control
git at videolan.org
Mon Mar 16 23:32:47 CET 2009
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Mar 16 23:32:20 2009 +0100| [b1338135703fa29e95257a65c21a90be9e60eef1] | committer: Jean-Baptiste Kempf
Qt: fix a crash when you don't want to have the recent items. And don't even show the menu.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b1338135703fa29e95257a65c21a90be9e60eef1
---
modules/gui/qt4/menus.cpp | 9 ++++++---
modules/gui/qt4/recents.cpp | 4 ++--
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
index 946be41..8863a4d 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 9445cda..7cdf80e 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();
}
More information about the vlc-devel
mailing list