vlc | branch: master | Francois Cartegnie <fcvlc...@free.fr> | Wed Dec 26 
23:31:05 2012 +0100| [a05072b5fb23a6afa7825c8d5a41f87686a45fb4] | committer: 
Francois Cartegnie

Qt: prefsItem: namespace TYPE_*

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

 .../gui/qt4/components/complete_preferences.cpp    |   34 +++++++++++---------
 .../gui/qt4/components/complete_preferences.hpp    |   17 +++++-----
 2 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/modules/gui/qt4/components/complete_preferences.cpp 
b/modules/gui/qt4/components/complete_preferences.cpp
index b5fb83b..06cd89b 100644
--- a/modules/gui/qt4/components/complete_preferences.cpp
+++ b/modules/gui/qt4/components/complete_preferences.cpp
@@ -108,7 +108,7 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget 
*_parent ) :
                 data->help = qtr( psz_help );
             else
                 data->help.clear();
-            data->i_type = TYPE_CATEGORY;
+            data->i_type = PrefsItemData::TYPE_CATEGORY;
             data->i_object_id = p_item->value.i;
 
             /* This is a category, put a nice icon */
@@ -151,7 +151,7 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget 
*_parent ) :
                   p_item->value.i == SUBCAT_AUDIO_GENERAL ) )
             {
                 /* Data still contains the correct thing */
-                data->i_type = TYPE_CATSUBCAT;
+                data->i_type = PrefsItemData::TYPE_CATSUBCAT;
                 data->i_subcat_id = p_item->value.i;
                 data->name = qtr( config_CategoryNameGet( p_item->value.i ) );
                 psz_help = config_CategoryHelpGet( p_item->value.i );
@@ -174,7 +174,7 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget 
*_parent ) :
                 data_sub->help = qtr( psz_help );
             else
                 data_sub->help.clear();
-            data_sub->i_type = TYPE_SUBCATEGORY;
+            data_sub->i_type = PrefsItemData::TYPE_SUBCATEGORY;
             data_sub->i_object_id = p_item->value.i;
 
             /* Create a new TreeWidget */
@@ -269,7 +269,7 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget 
*_parent ) :
         if( !b_found ) continue;
 
         PrefsItemData *module_data = new PrefsItemData();
-        module_data->i_type = TYPE_MODULE;
+        module_data->i_type = PrefsItemData::TYPE_MODULE;
         module_data->psz_name = strdup( module_get_object( p_module ) );
         module_data->name = qtr( module_get_name( p_module, false ) );
         module_data->help.clear();
@@ -581,9 +581,9 @@ AdvPrefsPanel::AdvPrefsPanel( intf_thread_t *_p_intf, 
QWidget *_parent,
 {
     /* Find our module */
     module_t *p_module = NULL;
-    if( data->i_type == TYPE_CATEGORY )
+    if( data->i_type == PrefsItemData::TYPE_CATEGORY )
         return;
-    else if( data->i_type == TYPE_MODULE )
+    else if( data->i_type == PrefsItemData::TYPE_MODULE )
         p_module = module_find( data->psz_name );
     else
     {
@@ -596,15 +596,16 @@ AdvPrefsPanel::AdvPrefsPanel( intf_thread_t *_p_intf, 
QWidget *_parent,
                     *p_item = p_config,
                     *p_end = p_config + confsize;
 
-    if( data->i_type == TYPE_SUBCATEGORY || data->i_type ==  TYPE_CATSUBCAT )
+    if( data->i_type == PrefsItemData::TYPE_SUBCATEGORY ||
+        data->i_type == PrefsItemData::TYPE_CATSUBCAT )
     {
         while (p_item < p_end)
         {
             if(  p_item->i_type == CONFIG_SUBCATEGORY &&
-                            ( ( data->i_type == TYPE_SUBCATEGORY &&
-                              p_item->value.i == data->i_object_id ) ||
-                            ( data->i_type == TYPE_CATSUBCAT &&
-                              p_item->value.i == data->i_subcat_id ) ) )
+                 ( ( data->i_type == PrefsItemData::TYPE_SUBCATEGORY &&
+                     p_item->value.i == data->i_object_id ) ||
+                   ( data->i_type == PrefsItemData::TYPE_CATSUBCAT &&
+                     p_item->value.i == data->i_subcat_id ) ) )
                 break;
             p_item++;
         }
@@ -618,7 +619,8 @@ AdvPrefsPanel::AdvPrefsPanel( intf_thread_t *_p_intf, 
QWidget *_parent,
 
     help = QString( data->help );
 
-    if( data->i_type == TYPE_SUBCATEGORY || data->i_type ==  TYPE_CATSUBCAT )
+    if( data->i_type == PrefsItemData::TYPE_SUBCATEGORY ||
+        data->i_type == PrefsItemData::TYPE_CATSUBCAT )
     {
         head = QString( data->name );
         p_item++; // Why that ?
@@ -658,9 +660,9 @@ AdvPrefsPanel::AdvPrefsPanel( intf_thread_t *_p_intf, 
QWidget *_parent,
 
     if( p_item ) do
     {
-        if( ( ( data->i_type == TYPE_SUBCATEGORY &&
+        if( ( ( data->i_type == PrefsItemData::TYPE_SUBCATEGORY &&
                 p_item->value.i != data->i_object_id ) ||
-              ( data->i_type == TYPE_CATSUBCAT  &&
+              ( data->i_type == PrefsItemData::TYPE_CATSUBCAT  &&
                 p_item->value.i != data->i_subcat_id ) ) &&
             ( p_item->i_type == CONFIG_CATEGORY ||
               p_item->i_type == CONFIG_SUBCATEGORY ) )
@@ -702,8 +704,8 @@ AdvPrefsPanel::AdvPrefsPanel( intf_thread_t *_p_intf, 
QWidget *_parent,
         else i_line++;
         controls.append( control );
     }
-    while( !( ( data->i_type == TYPE_SUBCATEGORY ||
-               data->i_type == TYPE_CATSUBCAT ) &&
+    while( !( ( data->i_type == PrefsItemData::TYPE_SUBCATEGORY ||
+               data->i_type == PrefsItemData::TYPE_CATSUBCAT ) &&
              ( p_item->i_type == CONFIG_CATEGORY ||
                p_item->i_type == CONFIG_SUBCATEGORY ) )
         && ( ++p_item < p_end ) );
diff --git a/modules/gui/qt4/components/complete_preferences.hpp 
b/modules/gui/qt4/components/complete_preferences.hpp
index 1d9ae84..df39749 100644
--- a/modules/gui/qt4/components/complete_preferences.hpp
+++ b/modules/gui/qt4/components/complete_preferences.hpp
@@ -34,14 +34,6 @@
 #include <QTreeWidget>
 #include <QSet>
 
-enum
-{
-    TYPE_CATEGORY,
-    TYPE_CATSUBCAT,
-    TYPE_SUBCATEGORY,
-    TYPE_MODULE
-};
-
 class AdvPrefsPanel;
 class QLabel;
 class QVBoxLayout;
@@ -56,7 +48,14 @@ public:
     AdvPrefsPanel *panel;
     int i_object_id;
     int i_subcat_id;
-    int i_type;
+    enum prefsType
+    {
+        TYPE_CATEGORY,
+        TYPE_CATSUBCAT,
+        TYPE_SUBCATEGORY,
+        TYPE_MODULE
+    };
+    prefsType i_type;
     char *psz_name;
     bool b_loaded;
     QString name;

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits

Reply via email to