[vlc-commits] qt4: factorize variable loading in DoAction

Rafaël Carré git at videolan.org
Fri Jan 25 03:35:05 CET 2013


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Fri Jan 25 03:27:51 2013 +0100| [ad11acb715d9c2cab42772db56d6fba6683e4f74] | committer: Rafaël Carré

qt4: factorize variable loading in DoAction

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ad11acb715d9c2cab42772db56d6fba6683e4f74
---

 modules/gui/qt4/menus.cpp |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
index 45a1d90..47c159b 100644
--- a/modules/gui/qt4/menus.cpp
+++ b/modules/gui/qt4/menus.cpp
@@ -1512,13 +1512,15 @@ void VLCMenuBar::DoAction( QObject *data )
     MenuItemData *itemData = qobject_cast<MenuItemData *>( data );
     vlc_object_t *p_object = itemData->p_obj;
     if( p_object == NULL ) return;
+    const char *var = itemData->psz_var;
+    vlc_value_t val = itemData->val;
 
     /* Preserve settings across vouts via the playlist object: */
-    if( !strcmp( itemData->psz_var, "fullscreen" )
-     || !strcmp( itemData->psz_var, "video-on-top" ) )
-        var_Set( pl_Get( p_object ), itemData->psz_var, itemData->val );
+    if( !strcmp( var, "fullscreen" )
+     || !strcmp( var, "video-on-top" ) )
+        var_Set( pl_Get( p_object ), var, val );
 
-    var_Set( p_object, itemData->psz_var, itemData->val );
+    var_Set( p_object, var, val );
 }
 
 void VLCMenuBar::updateRecents( intf_thread_t *p_intf )



More information about the vlc-commits mailing list