From 4556ab6dffdaf9108899a7a1f74d83f54ac4e91a Mon Sep 17 00:00:00 2001 From: drw Date: Wed, 16 Feb 2005 17:22:19 +0000 Subject: Fixed stupid bug where last package in status file was not shown as installed when it should be, and removed some printfs --- diff --git a/noncore/settings/packagemanager/ChangeLog b/noncore/settings/packagemanager/ChangeLog index 608cd98..38756b1 100644 --- a/noncore/settings/packagemanager/ChangeLog +++ b/noncore/settings/packagemanager/ChangeLog @@ -1,10 +1,15 @@ +2005-02-16 Dan Williams + + * Fixed stupid bug where last package in status file was not shown as installed when it should be + * Removed printf's + 2005-01-02 Dan Williams * Released version 0.6.1 * Implemented native package linking code to remove need for ipkg-link * Implement package in OIpkg (removed from InstallDlg) as this is ipkg specific * Many small code tweaks - + 2004-12-21 Dan Williams * Released version 0.6.0 diff --git a/noncore/settings/packagemanager/oipkg.cpp b/noncore/settings/packagemanager/oipkg.cpp index f2d7e39..e7e292e 100644 --- a/noncore/settings/packagemanager/oipkg.cpp +++ b/noncore/settings/packagemanager/oipkg.cpp @@ -363,6 +363,10 @@ OPackageList *OIpkg::installedPackages( const QString &destName, const QString & f.close(); + // Make sure to add to list last entry + if ( !name.isNull() && status.contains( " installed" ) ) + pl->append( new OPackage( name, QString::null, version, QString::null, destName ) ); + return pl; } @@ -453,7 +457,7 @@ bool OIpkg::executeCommand( OPackage::Command command, const QStringList ¶me // 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 ); @@ -645,7 +649,7 @@ void OIpkg::linkPackageDir( const QString &dest ) if ( !dest.isNull() ) { OConfItem *destConfItem = findConfItem( OConfItem::Destination, dest ); - + emit signalIpkgMessage( tr( "Linking packages installed in: %1" ).arg( dest ) ); // Set package destination directory @@ -689,7 +693,7 @@ void OIpkg::linkPackageDir( const QString &dest ) QFileInfo fileInfo( linkFile ); if ( fileInfo.isSymLink() && !fileInfo.readLink().isEmpty() ) linkFile = fileInfo.readLink(); - + // See if directory exists in 'root', if not, create fileInfo.setFile( linkDest ); QString linkDestDirName = fileInfo.dirPath( true ); @@ -733,7 +737,7 @@ void OIpkg::unlinkPackage( const QString &package, OConfItemList *destList ) .arg( IPKG_INFO_PATH ) .arg( package ); //emit signalIpkgMessage( QString( "Looking for '%1'" ).arg ( destInfoFileName ) ); - + // If found and destination is not 'root', remove symbolic links if ( QFile::exists( destInfoFileName ) && dest->name() != "root" ) { diff --git a/noncore/settings/packagemanager/opackagemanager.cpp b/noncore/settings/packagemanager/opackagemanager.cpp index ac16954..c9fdec1 100644 --- a/noncore/settings/packagemanager/opackagemanager.cpp +++ b/noncore/settings/packagemanager/opackagemanager.cpp @@ -83,10 +83,9 @@ void OPackageManager::loadAvailablePackages() OPackage *package = packageIt.current(); // Load package info - if ( !m_packages.find( package->name() ) ) { - printf( "ADD AVAILABLE '%s'\n", package->name().latin1()); + if ( !m_packages.find( package->name() ) ) m_packages.insert( package->name(), package ); - } else + else { // If new package is newer version, replace existing package OPackage *currPackage = m_packages[package->name()]; @@ -139,7 +138,6 @@ void OPackageManager::loadInstalledPackages() emit statusBar( destCount ); qApp->processEvents(); - printf( "DESGTINATION %s\n", destination->name().latin1()); OPackageList *packageList = m_ipkg.installedPackages( destination->name(), destination->value() ); if ( packageList ) @@ -159,7 +157,6 @@ void OPackageManager::loadInstalledPackages() else { // Package isn't in a current feed, add to list - printf( "ADD INSTALLED '%s'\n", package->name().latin1()); m_packages.insert( package->name(), package ); // Add category to list if it doesn't already exist -- cgit v0.9.0.2