]> git.sesse.net Git - vlc/commitdiff
Qt4 - MediaInfoPanel, fix a segfault and don't clear() everytime you update and there...
authorJean-Baptiste Kempf <jb@videolan.org>
Sat, 8 Dec 2007 04:21:02 +0000 (04:21 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Sat, 8 Dec 2007 04:21:02 +0000 (04:21 +0000)
modules/gui/qt4/components/info_panels.cpp
modules/gui/qt4/components/info_panels.hpp
modules/gui/qt4/dialogs/mediainfo.cpp
modules/gui/qt4/dialogs/mediainfo.hpp

index 0f243c74a4e2e44faba28036403c4acb8d90882d..88bc41948938576446fdab5b930696cae6fea876 100644 (file)
@@ -288,7 +288,8 @@ void MetaPanel::saveMeta()
     PL_UNLOCK;
     pl_Release( p_playlist );
 
-    /* Reset the status of the mode. No need to emit any signal */
+    /* Reset the status of the mode. No need to emit any signal because parent
+       is the only caller */
     b_inEditMode = false;
 }
 
@@ -300,6 +301,7 @@ bool MetaPanel::isInEditMode()
 
 void MetaPanel::enterEditMode()
 {
+    msg_Dbg( p_intf, "Entering Edit MetaData Mode" );
     setEditMode( true );
 }
 
@@ -314,7 +316,6 @@ void MetaPanel::setEditMode( bool b_editing )
  */
 void MetaPanel::clear()
 {
-    uri_text->clear();
     title_text->clear();
     artist_text->clear();
     genre_text->clear();
index a4d85281d2941e21c85e53917430ce23d9b26d2c..2c6c14e1362c666d7883e9e823c6b2b5926d86bb 100644 (file)
@@ -64,7 +64,6 @@ private:
     intf_thread_t *p_intf;
     bool b_inEditMode;
 
-    QLineEdit *uri_text;
     QLineEdit *title_text;
     QLineEdit *artist_text;
     QLineEdit *genre_text;
index 6d9affc338edf6348dadebbc0e4883a3986e4bd7..946577715b4d289d5c1f32c1d0e2def8da042e52 100644 (file)
@@ -45,6 +45,7 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf,
     i_runs = 0;
     p_item = _p_item;
     b_need_update = true;
+    b_cleaned = true;
 
     setWindowTitle( qtr( "Media information" ) );
     resize( 600 , 480 );
@@ -142,7 +143,11 @@ void MediaInfoDialog::updateOnTimeOut()
     input_thread_t *p_input = THEMIM->getInput();
     if( !p_input || p_input->b_dead )
     {
-        clear();
+        if( !b_cleaned )
+        {
+            clear();
+            b_cleaned = true;
+        }
         return;
     }
 
@@ -151,6 +156,7 @@ void MediaInfoDialog::updateOnTimeOut()
 
     update( input_GetItem(p_input), b_need_update, b_need_update );
     b_need_update = false;
+    b_cleaned = false;
 
     vlc_object_release( p_input );
 }
@@ -176,6 +182,7 @@ void MediaInfoDialog::clear()
     MP->clear();
     EMP->clear();
     if( stats ) ISP->clear();
+    b_cleaned = true;
 }
 
 void MediaInfoDialog::close()
index acf2e455617b12cc1fcc94eb48fd389f27bd2e14..91e380ffb61a7a36f61ffd8db1217e3f14387eee 100644 (file)
@@ -71,6 +71,7 @@ private:
     int i_runs;
     bool mainInput;
     bool stats;
+    bool b_cleaned;
 
     QTabWidget *IT;
     InputStatsPanel *ISP;