[vlc-commits] playlist: move pop-up menu variable

Rémi Denis-Courmont git at videolan.org
Thu May 31 20:45:44 CEST 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu May 31 21:07:18 2018 +0300| [bd00749be96efab78123d6ec039fbde811a598f2] | committer: Rémi Denis-Courmont

playlist: move pop-up menu variable

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

 modules/control/hotkeys.c          | 6 +++---
 modules/gui/qt/main_interface.cpp  | 4 ++--
 modules/gui/skins2/src/dialogs.cpp | 4 ++--
 src/libvlc.c                       | 3 ---
 src/playlist/engine.c              | 3 +++
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
index f00308b51a..dae489fee4 100644
--- a/modules/control/hotkeys.c
+++ b/modules/control/hotkeys.c
@@ -170,7 +170,7 @@ static int ButtonEvent( vlc_object_t *p_this, char const *psz_var,
 
     if ((newval.i_int & (1 << MOUSE_BUTTON_LEFT))
      && !(oldval.i_int & (1 << MOUSE_BUTTON_LEFT)))
-        var_SetBool(p_intf->obj.libvlc, "intf-popupmenu", false);
+        var_SetBool(pl_Get(p_intf), "intf-popupmenu", false);
 
     if ((newval.i_int & (1 << MOUSE_BUTTON_CENTER))
      && !(oldval.i_int & (1 << MOUSE_BUTTON_CENTER)))
@@ -183,7 +183,7 @@ static int ButtonEvent( vlc_object_t *p_this, char const *psz_var,
     if ((oldval.i_int & (1 << MOUSE_BUTTON_RIGHT))
      && !(newval.i_int & (1 << MOUSE_BUTTON_RIGHT)))
 #endif
-        var_SetBool(p_intf->obj.libvlc, "intf-popupmenu", true);
+        var_SetBool(pl_Get(p_intf), "intf-popupmenu", true);
 
     return VLC_SUCCESS;
 }
@@ -387,7 +387,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
             var_TriggerCallback( p_playlist, "intf-boss" );
             break;
         case ACTIONID_INTF_POPUP_MENU:
-            var_TriggerCallback( p_intf->obj.libvlc, "intf-popupmenu" );
+            var_TriggerCallback( p_playlist, "intf-popupmenu" );
             break;
 
         /* Playlist actions (including audio) */
diff --git a/modules/gui/qt/main_interface.cpp b/modules/gui/qt/main_interface.cpp
index c49333391f..4b07c33bf9 100644
--- a/modules/gui/qt/main_interface.cpp
+++ b/modules/gui/qt/main_interface.cpp
@@ -245,7 +245,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
     var_AddCallback( pl_Get(p_intf), "intf-show", IntfRaiseMainCB, p_intf );
 
     /* Register callback for the intf-popupmenu variable */
-    var_AddCallback( p_intf->obj.libvlc, "intf-popupmenu", PopupMenuCB, p_intf );
+    var_AddCallback( pl_Get(p_intf), "intf-popupmenu", PopupMenuCB, p_intf );
 
 
     /* Final Sizing, restoration and placement of the interface */
@@ -304,7 +304,7 @@ MainInterface::~MainInterface()
     var_DelCallback( pl_Get(p_intf), "intf-boss", IntfBossCB, p_intf );
     var_DelCallback( pl_Get(p_intf), "intf-show", IntfRaiseMainCB, p_intf );
     var_DelCallback( pl_Get(p_intf), "intf-toggle-fscontrol", IntfShowCB, p_intf );
-    var_DelCallback( p_intf->obj.libvlc, "intf-popupmenu", PopupMenuCB, p_intf );
+    var_DelCallback( pl_Get(p_intf), "intf-popupmenu", PopupMenuCB, p_intf );
 
     p_intf->p_sys->p_mi = NULL;
 }
diff --git a/modules/gui/skins2/src/dialogs.cpp b/modules/gui/skins2/src/dialogs.cpp
index 465e3102dc..f344f097d3 100644
--- a/modules/gui/skins2/src/dialogs.cpp
+++ b/modules/gui/skins2/src/dialogs.cpp
@@ -127,7 +127,7 @@ Dialogs::~Dialogs()
         vlc_object_release( m_pProvider );
 
         /* Unregister callbacks */
-        var_DelCallback( getIntf()->obj.libvlc, "intf-popupmenu",
+        var_DelCallback( pl_Get(getIntf()), "intf-popupmenu",
                          PopupMenuCB, this );
     }
 }
@@ -177,7 +177,7 @@ bool Dialogs::init()
     }
 
     /* Register callback for the intf-popupmenu variable */
-    var_AddCallback( getIntf()->obj.libvlc, "intf-popupmenu",
+    var_AddCallback( pl_Get(getIntf()), "intf-popupmenu",
                      PopupMenuCB, this );
 
     return true;
diff --git a/src/libvlc.c b/src/libvlc.c
index deb0ae3586..f6bb02b6e1 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -235,9 +235,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
     if( !priv->parser )
         goto error;
 
-    /* Create a variable for showing the right click menu */
-    var_Create( p_libvlc, "intf-popupmenu", VLC_VAR_BOOL );
-
     /* variables for signalling creation of new files */
     var_Create( p_libvlc, "snapshot-file", VLC_VAR_STRING );
     var_Create( p_libvlc, "record-file", VLC_VAR_STRING );
diff --git a/src/playlist/engine.c b/src/playlist/engine.c
index dcbea205a2..0a161a38c7 100644
--- a/src/playlist/engine.c
+++ b/src/playlist/engine.c
@@ -472,6 +472,9 @@ static void VariablesInit( playlist_t *p_playlist )
 
     /* Callbacks between interfaces */
 
+    /* Create a variable for showing the right click menu */
+    var_Create( p_playlist, "intf-popupmenu", VLC_VAR_BOOL );
+
     /* Create a variable for showing the fullscreen interface */
     var_Create( p_playlist, "intf-toggle-fscontrol", VLC_VAR_VOID );
 



More information about the vlc-commits mailing list