[vlc-commits] Qt4: cache var_InheritBool on Win32

Jean-Baptiste Kempf git at videolan.org
Sun Mar 20 15:18:01 CET 2011


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Mar 20 15:16:41 2011 +0100| [c7438b1e484cbcbc10862f768bdc255768b2d7a4] | committer: Jean-Baptiste Kempf

Qt4: cache var_InheritBool on Win32

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

 modules/gui/qt4/main_interface.cpp       |    5 +++++
 modules/gui/qt4/main_interface_win32.cpp |    3 +--
 modules/gui/qt4/qt4.hpp                  |    3 +++
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 52015b3..fc3544d 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -122,6 +122,11 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
     settings = getSettings();
     settings->beginGroup( "MainWindow" );
 
+#ifdef WIN32
+    /* Volume keys */
+    p_intf->p_sys->disable_volume_keys = var_InheritBool( p_intf, "qt-disable-volume-keys" );
+#endif
+
     /* */
     b_plDocked = getSettings()->value( "pl-dock-status", true ).toBool();
 
diff --git a/modules/gui/qt4/main_interface_win32.cpp b/modules/gui/qt4/main_interface_win32.cpp
index 9fc67a9..be670ce 100644
--- a/modules/gui/qt4/main_interface_win32.cpp
+++ b/modules/gui/qt4/main_interface_win32.cpp
@@ -183,8 +183,7 @@ bool MainInterface::winEvent ( MSG * msg, long * result )
         case WM_APPCOMMAND:
             cmd = GET_APPCOMMAND_LPARAM(msg->lParam);
 
-            bool disable_volume_keys = var_InheritBool( p_intf, "qt-disable-volume-keys" );
-            if( disable_volume_keys &&
+            if( p_intf->p_sys->disable_volume_keys &&
                     (   cmd == APPCOMMAND_VOLUME_DOWN   ||
                         cmd == APPCOMMAND_VOLUME_UP     ||
                         cmd == APPCOMMAND_VOLUME_MUTE ) )
diff --git a/modules/gui/qt4/qt4.hpp b/modules/gui/qt4/qt4.hpp
index 918986e..366115d 100644
--- a/modules/gui/qt4/qt4.hpp
+++ b/modules/gui/qt4/qt4.hpp
@@ -74,6 +74,9 @@ struct intf_sys_t
 
     QString filepath;        /* Last path used in dialogs */
 
+#ifdef WIN32
+    bool disable_volume_keys;
+#endif
 };
 
 #define THEPL pl_Get(p_intf)



More information about the vlc-commits mailing list