diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-12-05 21:37:55 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-12-06 19:36:24 +0900 |
commit | c0effe456c6b43661f43d251c7923ebf3b953cba (patch) | |
tree | 7e82c84de8eb20dabe50a98855b3c89883fca6c9 /src | |
parent | 7bd4251db36952dce6c17d477f4671199d5c9971 (diff) | |
download | kstreamripper-c0effe456c6b43661f43d251c7923ebf3b953cba.tar.gz kstreamripper-c0effe456c6b43661f43d251c7923ebf3b953cba.zip |
Avoid repeated connection of the same signal when ripping the same item multiple times
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'src')
-rw-r--r-- | src/kstreamripper.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/kstreamripper.cpp b/src/kstreamripper.cpp index 7a5d7cb..2abd249 100644 --- a/src/kstreamripper.cpp +++ b/src/kstreamripper.cpp @@ -82,10 +82,12 @@ KStreamRipper::KStreamRipper( TQWidget* parent, const char* name ) for( ; iter1 != nameList.end() && iter2 != urlList.end() && iter3 != descList.end(); ++iter1, ++iter2, ++iter3 ) { - ProcessListViewItem * proc = new ProcessListViewItem( m_streamsListView, *iter1, "", ""); - proc->setRenameEnabled(0, true); - proc->getProcessController()->setUrl( *iter2 ); - proc->getProcessController()->setDescription( *iter3 ); + ProcessListViewItem * procItem = new ProcessListViewItem( m_streamsListView, *iter1, "", ""); + procItem->setRenameEnabled(0, true); + ProcessController *pc = procItem->getProcessController(); + pc->setUrl( *iter2 ); + pc->setDescription( *iter3 ); + connect(pc, TQT_SIGNAL(stopRipSignal(ProcessController*)), this, TQT_SLOT(ripStopped(ProcessController*))); } //CONNECTS @@ -227,7 +229,6 @@ void KStreamRipper::ripButtonClicked() ProcItem->getProcessController()->startRip(m_destEdit->text(), m_timeEdit->text()); m_ripButton->setEnabled( false ); m_stopRipButton->setEnabled( true ); - connect(ProcItem->getProcessController(), TQT_SIGNAL(stopRipSignal(ProcessController*)), this, TQT_SLOT(ripStopped(ProcessController*))); } else { KMessageBox::error(this, "The streamripper executable wasn't found. Make sure " "it's in your path.", "streamripper not found"); @@ -324,9 +325,11 @@ void KStreamRipper::urlChanged() void KStreamRipper::addStreamFinished( AddNewStreamImpl *e ) { - ProcessListViewItem * proc = new ProcessListViewItem( m_streamsListView, e->d_nameEdit->text(), "", ""); - proc->getProcessController()->setUrl( e->d_urlEdit->text() ); - proc->getProcessController()->setDescription( e->d_descEdit->text() ); + ProcessListViewItem *procItem = new ProcessListViewItem( m_streamsListView, e->d_nameEdit->text(), "", ""); + ProcessController *pc = procItem->getProcessController(); + pc->setUrl( e->d_urlEdit->text() ); + pc->setDescription( e->d_descEdit->text() ); + connect(pc, TQT_SIGNAL(stopRipSignal(ProcessController*)), this, TQT_SLOT(ripStopped(ProcessController*))); } #include "kstreamripper.moc" |