-rw-r--r-- | noncore/settings/packagemanager/ChangeLog | 5 | ||||
-rw-r--r-- | noncore/settings/packagemanager/oipkg.cpp | 4 | ||||
-rw-r--r-- | noncore/settings/packagemanager/opackagemanager.cpp | 7 |
3 files changed, 11 insertions, 5 deletions
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,8 +1,13 @@ +2005-02-16 Dan Williams <drw@handhelds.org> + + * 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 <drw@handhelds.org> * 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 <drw@handhelds.org> 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 @@ -358,16 +358,20 @@ OPackageList *OIpkg::installedPackages( const QString &destName, const QString & line = t.readLine(); } else line = t.readLine(); } 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; } OConfItem *OIpkg::findConfItem( OConfItem::Type type, const QString &name ) { // Find configuration item in list OConfItemListIterator configIt( *m_confInfo ); OConfItem *config = 0l; 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 @@ -78,20 +78,19 @@ void OPackageManager::loadAvailablePackages() OPackageList *packageList = m_ipkg.availablePackages( server->name() ); if ( packageList ) { for ( OPackageListIterator packageIt( *packageList ); packageIt.current(); ++packageIt ) { 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()]; if ( compareVersions( package->version(), currPackage->version() ) == 1 ) m_packages.replace( package->name(), package ); } // Add category to list if it doesn't already exist @@ -134,17 +133,16 @@ void OPackageManager::loadInstalledPackages() // Update status QString status = tr( "Reading installed packages:\n\t" ); status.append( destination->name() ); emit statusText( status ); ++destCount; emit statusBar( destCount ); qApp->processEvents(); - printf( "DESGTINATION %s\n", destination->name().latin1()); OPackageList *packageList = m_ipkg.installedPackages( destination->name(), destination->value() ); if ( packageList ) { for ( OPackageListIterator packageIt( *packageList ); packageIt.current(); ++packageIt ) { OPackage *package = packageIt.current(); OPackage *currPackage = m_packages[package->name()]; @@ -154,17 +152,16 @@ void OPackageManager::loadInstalledPackages() currPackage->setVersionInstalled( package->versionInstalled() ); currPackage->setDestination( package->destination() ); delete package; } 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 if ( m_categories.grep( package->category() ).isEmpty() ) { m_categories << package->category(); categoryAdded = true; } |