]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/complete_preferences.cpp
Preferences: fix some memleaks and fix horrible video-filter bug. :D
[vlc] / modules / gui / qt4 / components / complete_preferences.cpp
index 7a495d0efbcba67e56c689eb7f9ce65f6ea5f150..8c68d16b43e2b42e862b5b5291ba04c5ae946950 100644 (file)
@@ -65,13 +65,13 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
 
     /* Nice icons */
 #define BI( a,b) QIcon a##_icon = QIcon( QPixmap( b ))
-    BI( audio, ":/pixmaps/advprefs_audio.png" );
-    BI( video, ":/pixmaps/advprefs_video.png" );
-    BI( input, ":/pixmaps/advprefs_codec.png" );
-    BI( sout, ":/pixmaps/advprefs_sout.png" );
-    BI( advanced, ":/pixmaps/advprefs_extended.png" );
-    BI( playlist, ":/pixmaps/advprefs_playlist.png" );
-    BI( interface, ":/pixmaps/advprefs_intf.png" );
+    BI( audio, ":/advprefs_audio" );
+    BI( video, ":/advprefs_video" );
+    BI( input, ":/advprefs_codec" );
+    BI( sout, ":/advprefs_sout" );
+    BI( advanced, ":/advprefs_extended" );
+    BI( playlist, ":/advprefs_playlist" );
+    BI( interface, ":/advprefs_intf" );
 #undef BI
 
     /* Build the tree for the main module */
@@ -362,10 +362,10 @@ AdvPrefsPanel::AdvPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
     if( data->i_type == TYPE_CATEGORY )
         return;
     else if( data->i_type == TYPE_MODULE )
-        p_module = module_Find( VLC_OBJECT(p_intf), data->psz_name );
+        p_module = module_Find( p_intf, data->psz_name );
     else
     {
-        p_module = module_Find( VLC_OBJECT(p_intf), "main" );
+        p_module = module_GetMainModule( p_intf );
         assert( p_module );
     }
 
@@ -461,6 +461,7 @@ AdvPrefsPanel::AdvPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
                 i_line++;
             }
             box = new QGroupBox( qtr( p_item->psz_text ) );
+            box->hide();
             boxlayout = new QGridLayout();
         }
         /* Only one hotkey control */
@@ -494,6 +495,7 @@ AdvPrefsPanel::AdvPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
     if( box )
     {
         box->setLayout( boxlayout );
+        box->show();
         layout->addWidget( box, i_line, 0, 1, -1 );
     }
 
@@ -516,5 +518,12 @@ void AdvPrefsPanel::apply()
         c->doApply( p_intf );
     }
 }
+
 void AdvPrefsPanel::clean()
 {}
+
+AdvPrefsPanel::~AdvPrefsPanel()
+{
+    qDeleteAll( controls ); controls.clear();
+}
+