]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/preferences_widgets.cpp
Fix a crash in Preferences.
[vlc] / modules / gui / qt4 / components / preferences_widgets.cpp
index 67f1cf8b7b5369c28d146e1f8b05f668cd6e359b..76db95125c8ee7fbed97452e902322ff3fe8b713 100644 (file)
@@ -97,6 +97,9 @@ ConfigControl *ConfigControl::createControl( vlc_object_t *p_this,
     case CONFIG_ITEM_MODULE_LIST_CAT:
         p_control = new ModuleListConfigControl( p_this, p_item, parent, true,
                                              l, line );
+        /* Special Hack for a bug in video-filter */
+        if( qobject_cast<ModuleListConfigControl *>( p_control )->groupBox == NULL )
+            return NULL;
         break;
     case CONFIG_ITEM_STRING:
         if( !p_item->i_list )
@@ -607,6 +610,7 @@ ModuleListConfigControl::ModuleListConfigControl( vlc_object_t *_p_this,
     VStringConfigControl( _p_this, _p_item, _parent )
 {
     groupBox = NULL;
+    /* Special Hack */
     if( !p_item->psz_text ) return;
 
     groupBox = new QGroupBox ( qtr(p_item->psz_text) );
@@ -644,7 +648,7 @@ ModuleListConfigControl::~ModuleListConfigControl()
     {
         delete *it;
     }
-    if( groupBox ) delete groupBox;
+    delete groupBox;
 }
 
 #define CHECKBOX_LISTS \
@@ -701,13 +705,14 @@ void ModuleListConfigControl::finish( bool bycat )
     }
     vlc_list_release( p_list );
     text->setToolTip( formatTooltip(qtr(p_item->psz_longtext)) );
-    if( groupBox )
-        groupBox->setToolTip( formatTooltip(qtr(p_item->psz_longtext)) );
+    assert( groupBox );
+    groupBox->setToolTip( formatTooltip(qtr(p_item->psz_longtext)) );
 }
 #undef CHECKBOX_LISTS
 
 QString ModuleListConfigControl::getValue()
 {
+    assert( text );
     return text->text();
 }