[vlc-commits] Qt4: fix matching key config items

Rémi Denis-Courmont git at videolan.org
Sun Feb 13 13:11:29 CET 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Feb 13 14:10:48 2011 +0200| [b9b3d4e096ce31760a793fdfba7d6e5af3f4e080] | committer: Rémi Denis-Courmont

Qt4: fix matching key config items

mux-ts-use-key-frames is not a key!

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

 .../gui/qt4/components/complete_preferences.cpp    |   10 +++++-----
 modules/gui/qt4/components/preferences_widgets.cpp |   10 +++++-----
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/modules/gui/qt4/components/complete_preferences.cpp b/modules/gui/qt4/components/complete_preferences.cpp
index 1892f8e..747fd10 100644
--- a/modules/gui/qt4/components/complete_preferences.cpp
+++ b/modules/gui/qt4/components/complete_preferences.cpp
@@ -457,12 +457,12 @@ AdvPrefsPanel::AdvPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             boxlayout = new QGridLayout();
         }
         /* Only one hotkey control */
-        if( has_hotkey && p_item->i_type & CONFIG_ITEM && p_item->psz_name &&
-                                         strstr( p_item->psz_name, "key-" ) )
-            continue;
-        if( p_item->i_type & CONFIG_ITEM && p_item->psz_name &&
-                                            strstr( p_item->psz_name, "key-" ) )
+        if( (p_item->i_type & CONFIG_ITEM) == CONFIG_ITEM_KEY )
+        {
+            if( has_hotkey )
+                continue;
             has_hotkey = true;
+        }
 
         ConfigControl *control;
         if( ! box )
diff --git a/modules/gui/qt4/components/preferences_widgets.cpp b/modules/gui/qt4/components/preferences_widgets.cpp
index fee069c..457c6e8 100644
--- a/modules/gui/qt4/components/preferences_widgets.cpp
+++ b/modules/gui/qt4/components/preferences_widgets.cpp
@@ -1295,11 +1295,11 @@ void KeySelectorControl::finish()
     {
         module_config_t *p_item = p_config + i;
 
-        /* If we are a key option not empty */
-        if( p_item->i_type & CONFIG_ITEM && p_item->psz_name
-            && strstr( p_item->psz_name , "key-" )
-            && !strstr( p_item->psz_name , "global-key" )
-            && !EMPTY_STR( p_item->psz_text ) )
+        /* If we are a (non-global) key option not empty */
+        if( (p_item->i_type & CONFIG_ITEM == CONFIG_ITEM_KEY) &&
+            p_item->psz_name != NULL &&
+            strncmp( p_item->psz_name , "global-", 7 ) &&
+            !EMPTY_STR( p_item->psz_text ) )
         {
             /*
                Each tree item has:



More information about the vlc-commits mailing list