[vlc-commits] gui/qt: menus: always enable bookmarks menu

Filip Roséen git at videolan.org
Thu May 18 21:08:50 CEST 2017


vlc | branch: master | Filip Roséen <filip at atch.se> | Thu May 18 12:29:48 2017 +0200| [11301553b9f11916ba71aedca2b70c0dd401b842] | committer: Jean-Baptiste Kempf

gui/qt: menus: always enable bookmarks menu

Due to the changes introduced by 36e12797b4a, the bookmark menu would
not be enabled if there were no choices currently associated with the
input. As a user should be able to manage the bookmarks, even if no
such is present at the current time, we forcefully add
VLC_VAR_HASCHOICE to the i_type.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/gui/qt/menus.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt/menus.cpp b/modules/gui/qt/menus.cpp
index 4fb4d64e76..d5a7706d52 100644
--- a/modules/gui/qt/menus.cpp
+++ b/modules/gui/qt/menus.cpp
@@ -1254,10 +1254,13 @@ void VLCMenuBar::UpdateItem( intf_thread_t *p_intf, QMenu *menu,
     }
 
     /* Check the type of the object variable */
-    /* This HACK is needed so we have a radio button for audio and video tracks
-       instread of a checkbox */
+    /* This HACK is needed so that we have:
+     *  - a radio button for audio/video tracks instread of a checkbox, and;
+     *  - an always enabled bookmark menu (even if there are no bookmarks)
+     **/
     if( !strcmp( psz_var, "audio-es" )
-     || !strcmp( psz_var, "video-es" ) )
+     || !strcmp( psz_var, "video-es" )
+     || !strcmp( psz_var, "bookmark" ) )
         i_type = VLC_VAR_INTEGER | VLC_VAR_HASCHOICE;
     else
         i_type = var_Type( p_object, psz_var );



More information about the vlc-commits mailing list