Commit 214fca41 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - MediaInfoPanel, fix a segfault and don't clear() everytime you update...

Qt4 - MediaInfoPanel, fix a segfault and don't clear() everytime you update and there is no input. :D
parent 099d9779
...@@ -288,7 +288,8 @@ void MetaPanel::saveMeta() ...@@ -288,7 +288,8 @@ void MetaPanel::saveMeta()
PL_UNLOCK; PL_UNLOCK;
pl_Release( p_playlist ); 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; b_inEditMode = false;
} }
...@@ -300,6 +301,7 @@ bool MetaPanel::isInEditMode() ...@@ -300,6 +301,7 @@ bool MetaPanel::isInEditMode()
void MetaPanel::enterEditMode() void MetaPanel::enterEditMode()
{ {
msg_Dbg( p_intf, "Entering Edit MetaData Mode" );
setEditMode( true ); setEditMode( true );
} }
...@@ -314,7 +316,6 @@ void MetaPanel::setEditMode( bool b_editing ) ...@@ -314,7 +316,6 @@ void MetaPanel::setEditMode( bool b_editing )
*/ */
void MetaPanel::clear() void MetaPanel::clear()
{ {
uri_text->clear();
title_text->clear(); title_text->clear();
artist_text->clear(); artist_text->clear();
genre_text->clear(); genre_text->clear();
......
...@@ -64,7 +64,6 @@ private: ...@@ -64,7 +64,6 @@ private:
intf_thread_t *p_intf; intf_thread_t *p_intf;
bool b_inEditMode; bool b_inEditMode;
QLineEdit *uri_text;
QLineEdit *title_text; QLineEdit *title_text;
QLineEdit *artist_text; QLineEdit *artist_text;
QLineEdit *genre_text; QLineEdit *genre_text;
......
...@@ -45,6 +45,7 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf, ...@@ -45,6 +45,7 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf,
i_runs = 0; i_runs = 0;
p_item = _p_item; p_item = _p_item;
b_need_update = true; b_need_update = true;
b_cleaned = true;
setWindowTitle( qtr( "Media information" ) ); setWindowTitle( qtr( "Media information" ) );
resize( 600 , 480 ); resize( 600 , 480 );
...@@ -141,8 +142,12 @@ void MediaInfoDialog::updateOnTimeOut() ...@@ -141,8 +142,12 @@ void MediaInfoDialog::updateOnTimeOut()
/* Get Input and clear if non-existant */ /* Get Input and clear if non-existant */
input_thread_t *p_input = THEMIM->getInput(); input_thread_t *p_input = THEMIM->getInput();
if( !p_input || p_input->b_dead ) if( !p_input || p_input->b_dead )
{
if( !b_cleaned )
{ {
clear(); clear();
b_cleaned = true;
}
return; return;
} }
...@@ -151,6 +156,7 @@ void MediaInfoDialog::updateOnTimeOut() ...@@ -151,6 +156,7 @@ void MediaInfoDialog::updateOnTimeOut()
update( input_GetItem(p_input), b_need_update, b_need_update ); update( input_GetItem(p_input), b_need_update, b_need_update );
b_need_update = false; b_need_update = false;
b_cleaned = false;
vlc_object_release( p_input ); vlc_object_release( p_input );
} }
...@@ -176,6 +182,7 @@ void MediaInfoDialog::clear() ...@@ -176,6 +182,7 @@ void MediaInfoDialog::clear()
MP->clear(); MP->clear();
EMP->clear(); EMP->clear();
if( stats ) ISP->clear(); if( stats ) ISP->clear();
b_cleaned = true;
} }
void MediaInfoDialog::close() void MediaInfoDialog::close()
......
...@@ -71,6 +71,7 @@ private: ...@@ -71,6 +71,7 @@ private:
int i_runs; int i_runs;
bool mainInput; bool mainInput;
bool stats; bool stats;
bool b_cleaned;
QTabWidget *IT; QTabWidget *IT;
InputStatsPanel *ISP; InputStatsPanel *ISP;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment