]> git.sesse.net Git - vlc/commitdiff
Improve stability of the preferences dialog. Patch by Andre Weber
authorChristophe Mutricy <xtophe@videolan.org>
Thu, 29 Nov 2007 22:22:40 +0000 (22:22 +0000)
committerChristophe Mutricy <xtophe@videolan.org>
Thu, 29 Nov 2007 22:22:40 +0000 (22:22 +0000)
THANKS
modules/gui/qt4/dialogs/preferences.cpp

diff --git a/THANKS b/THANKS
index b4e2674defc1a19bbf0dd6b88343648143f73d69..1569a6826878d8d7fb82fb7df288aa8f9b18eadd 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -19,6 +19,7 @@ Alex Izvorski <aizvorski at gmail dot com> - some more x264 options
 Andrea Guzzo <xant at xant dot net> - dc1394 firewire support
 AndrĂ© de Barros Martins Ribeiro <andrerib at ajato.com.br> - Brazilian portuguese localization
 Andre Pang <adre.pang at csiro dot au> - Annodex support
+Andre Weber <WeberAndre at gmx d0t de> - Qt4 patches
 Andres Krapf <dae at via.ecp.fr> - FreeBSD port and tests, KDE interface
 Andrey Brilevskiy <director at macwest.ru> - Russian translation
 Andy Lindsay <andy_vl at ananam.com> - fixes in the TS demux
index 9f92b8dfcab54d3697092bb5cc19d52d32915768..61f9d3b3f5559d2257e32346b0830795869e52b4 100644 (file)
@@ -211,10 +211,12 @@ void PrefsDialog::changeAdvPanel( QTreeWidgetItem *item )
         if( advanced_panel->isVisible() ) advanced_panel->hide();
 
     if( !data->panel )
+    {
         data->panel = new AdvPrefsPanel( p_intf, main_panel , data );
+        main_panel_l->addWidget( data->panel );
+    }
 
     advanced_panel = data->panel;
-    main_panel_l->addWidget( advanced_panel );
     advanced_panel->show();
 }
 
@@ -277,14 +279,21 @@ void PrefsDialog::save()
        and we don't want that.*/
     if( small->isChecked() && advanced_panel )
     {
-        delete advanced_panel;
+        /* Deleting only the active panel from the advanced config doesn't work
+           because the data records of PrefsItemData  contains still a
+           reference to it only cleanAll() is sure to remove all Panels! */
+        advanced_tree->cleanAll();
         advanced_panel = NULL;
     }
     if( all->isChecked() && current_simple_panel  )
     {
         for( int i = 0 ; i< SPrefsMax; i++ )
         {
-            if( simple_panels[i] ) delete simple_panels[i];
+            if( simple_panels[i] )
+            {
+               delete simple_panels[i];
+               simple_panels[i] = NULL;
+            }
         }
         current_simple_panel  = NULL;
     }