author | drw <drw> | 2005-03-22 22:57:07 (UTC) |
---|---|---|
committer | drw <drw> | 2005-03-22 22:57:07 (UTC) |
commit | 3011e3f1741057b9163c3658a8847c528da5da05 (patch) (unidiff) | |
tree | d4ddecfd5073465973cbeb92a3301a3247df5594 | |
parent | 63d19f6ef6eeeb362323e3301daab03df1588faa (diff) | |
download | opie-3011e3f1741057b9163c3658a8847c528da5da05.zip opie-3011e3f1741057b9163c3658a8847c528da5da05.tar.gz opie-3011e3f1741057b9163c3658a8847c528da5da05.tar.bz2 |
Disconnect signals after command executes to prevent bug where messages show up multiple times in install dialog
-rw-r--r-- | noncore/settings/packagemanager/oipkg.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/noncore/settings/packagemanager/oipkg.cpp b/noncore/settings/packagemanager/oipkg.cpp index 417ee95..127204d 100644 --- a/noncore/settings/packagemanager/oipkg.cpp +++ b/noncore/settings/packagemanager/oipkg.cpp | |||
@@ -434,83 +434,90 @@ bool OIpkg::executeCommand( OPackage::Command command, const QStringList ¶me | |||
434 | // Connect output signal to widget | 434 | // Connect output signal to widget |
435 | 435 | ||
436 | if ( !rawOutput ) | 436 | if ( !rawOutput ) |
437 | { | 437 | { |
438 | // TODO - connect to local slot and parse output before emitting signalIpkgMessage | 438 | // TODO - connect to local slot and parse output before emitting signalIpkgMessage |
439 | } | 439 | } |
440 | 440 | ||
441 | switch( command ) | 441 | switch( command ) |
442 | { | 442 | { |
443 | case OPackage::Update : { | 443 | case OPackage::Update : { |
444 | connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); | 444 | connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); |
445 | ipkg_lists_update( &m_ipkgArgs ); | 445 | ipkg_lists_update( &m_ipkgArgs ); |
446 | disconnect( this, SIGNAL(signalIpkgMessage(const QString &)), 0, 0 ); | ||
446 | }; | 447 | }; |
447 | break; | 448 | break; |
448 | case OPackage::Upgrade : { | 449 | case OPackage::Upgrade : { |
449 | connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); | 450 | connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); |
450 | ipkg_packages_upgrade( &m_ipkgArgs ); | 451 | ipkg_packages_upgrade( &m_ipkgArgs ); |
451 | 452 | ||
452 | // Re-link non-root destinations to make sure everything is in sync | 453 | // Re-link non-root destinations to make sure everything is in sync |
453 | OConfItemList *destList = destinations(); | 454 | OConfItemList *destList = destinations(); |
454 | OConfItemListIterator it( *destList ); | 455 | OConfItemListIterator it( *destList ); |
455 | for ( ; it.current(); ++it ) | 456 | for ( ; it.current(); ++it ) |
456 | { | 457 | { |
457 | OConfItem *dest = it.current(); | 458 | OConfItem *dest = it.current(); |
458 | if ( dest->name() != "root" ) | 459 | if ( dest->name() != "root" ) |
459 | linkPackageDir( dest->name() ); | 460 | linkPackageDir( dest->name() ); |
460 | } | 461 | } |
461 | delete destList; | 462 | delete destList; |
463 | disconnect( this, SIGNAL(signalIpkgMessage(const QString &)), 0, 0 ); | ||
462 | }; | 464 | }; |
463 | break; | 465 | break; |
464 | case OPackage::Install : { | 466 | case OPackage::Install : { |
465 | connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); | 467 | connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); |
466 | for ( QStringList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it ) | 468 | for ( QStringList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it ) |
467 | { | 469 | { |
468 | ipkg_packages_install( &m_ipkgArgs, (*it) ); | 470 | ipkg_packages_install( &m_ipkgArgs, (*it) ); |
469 | } | 471 | } |
470 | if ( destination != "root" ) | 472 | if ( destination != "root" ) |
471 | linkPackageDir( destination ); | 473 | linkPackageDir( destination ); |
474 | disconnect( this, SIGNAL(signalIpkgMessage(const QString &)), 0, 0 ); | ||
472 | }; | 475 | }; |
473 | break; | 476 | break; |
474 | case OPackage::Remove : { | 477 | case OPackage::Remove : { |
475 | connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); | 478 | connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); |
476 | 479 | ||
477 | // Get list of destinations for unlinking of packages not installed to root | 480 | // Get list of destinations for unlinking of packages not installed to root |
478 | OConfItemList *destList = destinations(); | 481 | OConfItemList *destList = destinations(); |
479 | 482 | ||
480 | for ( QStringList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it ) | 483 | for ( QStringList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it ) |
481 | { | 484 | { |
482 | unlinkPackage( (*it), destList ); | 485 | unlinkPackage( (*it), destList ); |
483 | ipkg_packages_remove( &m_ipkgArgs, (*it), true ); | 486 | ipkg_packages_remove( &m_ipkgArgs, (*it), true ); |
484 | } | 487 | } |
485 | 488 | ||
486 | delete destList; | 489 | delete destList; |
490 | disconnect( this, SIGNAL(signalIpkgMessage(const QString &)), 0, 0 ); | ||
487 | }; | 491 | }; |
488 | break; | 492 | break; |
489 | case OPackage::Download : { | 493 | case OPackage::Download : { |
490 | connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); | 494 | connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); |
491 | for ( QStringList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it ) | 495 | for ( QStringList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it ) |
492 | { | 496 | { |
493 | ipkg_packages_download( &m_ipkgArgs, (*it) ); | 497 | ipkg_packages_download( &m_ipkgArgs, (*it) ); |
494 | } | 498 | } |
499 | disconnect( this, SIGNAL(signalIpkgMessage(const QString &)), 0, 0 ); | ||
495 | }; | 500 | }; |
496 | break; | 501 | break; |
497 | case OPackage::Info : { | 502 | case OPackage::Info : { |
498 | connect( this, SIGNAL(signalIpkgStatus(const QString &)), receiver, slotOutput ); | 503 | connect( this, SIGNAL(signalIpkgStatus(const QString &)), receiver, slotOutput ); |
499 | ipkg_packages_info( &m_ipkgArgs, (*parameters.begin()), &fIpkgStatus, 0l ); | 504 | ipkg_packages_info( &m_ipkgArgs, (*parameters.begin()), &fIpkgStatus, 0l ); |
505 | disconnect( this, SIGNAL(signalIpkgStatus(const QString &)), 0, 0 ); | ||
500 | }; | 506 | }; |
501 | break; | 507 | break; |
502 | case OPackage::Files : { | 508 | case OPackage::Files : { |
503 | connect( this, SIGNAL(signalIpkgList(const QString &)), receiver, slotOutput ); | 509 | connect( this, SIGNAL(signalIpkgList(const QString &)), receiver, slotOutput ); |
504 | ipkg_package_files( &m_ipkgArgs, (*parameters.begin()), &fIpkgFiles, 0l ); | 510 | ipkg_package_files( &m_ipkgArgs, (*parameters.begin()), &fIpkgFiles, 0l ); |
511 | disconnect( this, SIGNAL(signalIpkgList(const QString &)), 0, 0 ); | ||
505 | }; | 512 | }; |
506 | break; | 513 | break; |
507 | default : break; | 514 | default : break; |
508 | }; | 515 | }; |
509 | 516 | ||
510 | return true; | 517 | return true; |
511 | } | 518 | } |
512 | 519 | ||
513 | void OIpkg::ipkgMessage( char *msg ) | 520 | void OIpkg::ipkgMessage( char *msg ) |
514 | { | 521 | { |
515 | emit signalIpkgMessage( msg ); | 522 | emit signalIpkgMessage( msg ); |
516 | } | 523 | } |