author | drw <drw> | 2005-03-22 22:57:07 (UTC) |
---|---|---|
committer | drw <drw> | 2005-03-22 22:57:07 (UTC) |
commit | 3011e3f1741057b9163c3658a8847c528da5da05 (patch) (side-by-side diff) | |
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 @@ -422,107 +422,114 @@ bool OIpkg::executeCommand( OPackage::Command command, const QStringList ¶me if ( m_ipkgArgs.dest ) free( m_ipkgArgs.dest ); if ( !destination.isNull() ) { int len = destination.length() + 1; m_ipkgArgs.dest = (char *)malloc( len ); strncpy( m_ipkgArgs.dest, destination, destination.length() ); m_ipkgArgs.dest[ len - 1 ] = '\0'; } else m_ipkgArgs.dest = 0l; // Connect output signal to widget if ( !rawOutput ) { // TODO - connect to local slot and parse output before emitting signalIpkgMessage } switch( command ) { case OPackage::Update : { connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); ipkg_lists_update( &m_ipkgArgs ); + disconnect( this, SIGNAL(signalIpkgMessage(const QString &)), 0, 0 ); }; break; case OPackage::Upgrade : { connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); ipkg_packages_upgrade( &m_ipkgArgs ); // Re-link non-root destinations to make sure everything is in sync OConfItemList *destList = destinations(); OConfItemListIterator it( *destList ); for ( ; it.current(); ++it ) { OConfItem *dest = it.current(); if ( dest->name() != "root" ) linkPackageDir( dest->name() ); } delete destList; + disconnect( this, SIGNAL(signalIpkgMessage(const QString &)), 0, 0 ); }; break; case OPackage::Install : { connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); for ( QStringList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it ) { ipkg_packages_install( &m_ipkgArgs, (*it) ); } if ( destination != "root" ) linkPackageDir( destination ); + disconnect( this, SIGNAL(signalIpkgMessage(const QString &)), 0, 0 ); }; break; case OPackage::Remove : { connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); // Get list of destinations for unlinking of packages not installed to root OConfItemList *destList = destinations(); for ( QStringList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it ) { unlinkPackage( (*it), destList ); ipkg_packages_remove( &m_ipkgArgs, (*it), true ); } delete destList; + disconnect( this, SIGNAL(signalIpkgMessage(const QString &)), 0, 0 ); }; break; case OPackage::Download : { connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); for ( QStringList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it ) { ipkg_packages_download( &m_ipkgArgs, (*it) ); } + disconnect( this, SIGNAL(signalIpkgMessage(const QString &)), 0, 0 ); }; break; case OPackage::Info : { connect( this, SIGNAL(signalIpkgStatus(const QString &)), receiver, slotOutput ); ipkg_packages_info( &m_ipkgArgs, (*parameters.begin()), &fIpkgStatus, 0l ); + disconnect( this, SIGNAL(signalIpkgStatus(const QString &)), 0, 0 ); }; break; case OPackage::Files : { connect( this, SIGNAL(signalIpkgList(const QString &)), receiver, slotOutput ); ipkg_package_files( &m_ipkgArgs, (*parameters.begin()), &fIpkgFiles, 0l ); + disconnect( this, SIGNAL(signalIpkgList(const QString &)), 0, 0 ); }; break; default : break; }; return true; } void OIpkg::ipkgMessage( char *msg ) { emit signalIpkgMessage( msg ); } void OIpkg::ipkgStatus( char *status ) { emit signalIpkgStatus( status ); } void OIpkg::ipkgList( char *filelist ) { emit signalIpkgList( filelist ); } void OIpkg::loadConfiguration() |