summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2023-12-05 21:37:55 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2023-12-06 19:37:19 +0900
commitb624496ed378eeec84f4f69a3ee371283837352e (patch)
tree8aee6efdd268945f4e0d712b66e52ecc4abe498c
parentb3d9058d96f5f2939360fde1b6c28062f4db827b (diff)
downloadkstreamripper-b624496ed378eeec84f4f69a3ee371283837352e.tar.gz
kstreamripper-b624496ed378eeec84f4f69a3ee371283837352e.zip
Avoid repeated connection of the same signal when ripping the same item multiple times
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit c0effe456c6b43661f43d251c7923ebf3b953cba)
-rw-r--r--src/kstreamripper.cpp19
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"