summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/server.cpp
authorandyq <andyq>2002-11-02 13:52:55 (UTC)
committer andyq <andyq>2002-11-02 13:52:55 (UTC)
commitcf34849ac5c3eb9d16929cc88834973910209f74 (patch) (side-by-side diff)
tree06e189f927f88baeb16c927317153e1805a5f614 /noncore/settings/aqpkg/server.cpp
parentd21d693d91af8ee8fb54478a6db67f5a0590a767 (diff)
downloadopie-cf34849ac5c3eb9d16929cc88834973910209f74.zip
opie-cf34849ac5c3eb9d16929cc88834973910209f74.tar.gz
opie-cf34849ac5c3eb9d16929cc88834973910209f74.tar.bz2
Handles upgrading of local ipk files better and the Local-IPKG view displays
the name of the file rather thanthe package name (so version can easily be seen)
Diffstat (limited to 'noncore/settings/aqpkg/server.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/server.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/noncore/settings/aqpkg/server.cpp b/noncore/settings/aqpkg/server.cpp
index 8bca892..539ebf0 100644
--- a/noncore/settings/aqpkg/server.cpp
+++ b/noncore/settings/aqpkg/server.cpp
@@ -101,25 +101,26 @@ void Server :: readLocalIpks( Server *local )
DocLnkSet files;
Global::findDocuments( &files, "application/ipkg" );
// Now add the items to the list
QListIterator<DocLnk> it( files.children() );
for ( ; it.current() ; ++it )
{
// OK, we have a local IPK file, I think the standard naming conventions
// for these are packagename_version_arm.ipk
QString file = (*it)->file();
- QString packageName = Utils::getPackageNameFromIpkFilename( file );
+ // Changed to display the filename (excluding the path)
+ QString packageName = Utils::getFilenameFromIpkFilename( file );
QString ver = Utils::getPackageVersionFromIpkFilename( file );
packageList.push_back( Package( packageName ) );
packageList.back().setVersion( ver );
packageList.back().setFilename( file );
packageList.back().setPackageStoredLocally( true );
}
#else
QString names[] = { "advancedfm_0.9.1-20020811_arm.ipk", "libopie_0.9.1-20020811_arm.ipk", "libopieobex_0.9.1-20020811.1_arm.ipk", "opie-addressbook_0.9.1-20020811_arm.ipk" };
for ( int i = 0 ; i < 4 ; ++i )
{
// OK, we have a local IPK file, I think the standard naming conventions
@@ -218,24 +219,29 @@ void Server :: readPackageFile( Server *local, bool clearAll, bool installingToR
in.close();
// build local packages
buildLocalPackages( local );
}
void Server :: buildLocalPackages( Server *local )
{
for ( unsigned int i = 0 ; i < packageList.size() ; ++i )
{
QString name = packageList[i].getPackageName();
+
+ // If the package name is an ipk name, then convert the filename to a package name
+ if ( name.find( ".ipk" ) != -1 )
+ name = Utils::getPackageNameFromIpkFilename( packageList[i].getFilename() );
+
if ( local )
packageList[i].setLocalPackage( local->getPackage( name ) );
else
packageList[i].setLocalPackage( 0 );
}
}
Package *Server :: getPackage( QString &name )
{
return getPackage( (const char *)name );
}