summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/server.cpp
Unidiff
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 )
101 DocLnkSet files; 101 DocLnkSet files;
102 Global::findDocuments( &files, "application/ipkg" ); 102 Global::findDocuments( &files, "application/ipkg" );
103 103
104 // Now add the items to the list 104 // Now add the items to the list
105 QListIterator<DocLnk> it( files.children() ); 105 QListIterator<DocLnk> it( files.children() );
106 106
107 for ( ; it.current() ; ++it ) 107 for ( ; it.current() ; ++it )
108 { 108 {
109 // OK, we have a local IPK file, I think the standard naming conventions 109 // OK, we have a local IPK file, I think the standard naming conventions
110 // for these are packagename_version_arm.ipk 110 // for these are packagename_version_arm.ipk
111 QString file = (*it)->file(); 111 QString file = (*it)->file();
112 112
113 QString packageName = Utils::getPackageNameFromIpkFilename( file ); 113 // Changed to display the filename (excluding the path)
114 QString packageName = Utils::getFilenameFromIpkFilename( file );
114 QString ver = Utils::getPackageVersionFromIpkFilename( file ); 115 QString ver = Utils::getPackageVersionFromIpkFilename( file );
115 packageList.push_back( Package( packageName ) ); 116 packageList.push_back( Package( packageName ) );
116 packageList.back().setVersion( ver ); 117 packageList.back().setVersion( ver );
117 packageList.back().setFilename( file ); 118 packageList.back().setFilename( file );
118 packageList.back().setPackageStoredLocally( true ); 119 packageList.back().setPackageStoredLocally( true );
119 120
120 } 121 }
121#else 122#else
122 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" }; 123 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" };
123 for ( int i = 0 ; i < 4 ; ++i ) 124 for ( int i = 0 ; i < 4 ; ++i )
124 { 125 {
125 // OK, we have a local IPK file, I think the standard naming conventions 126 // 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
218 219
219 in.close(); 220 in.close();
220 221
221 // build local packages 222 // build local packages
222 buildLocalPackages( local ); 223 buildLocalPackages( local );
223} 224}
224 225
225void Server :: buildLocalPackages( Server *local ) 226void Server :: buildLocalPackages( Server *local )
226{ 227{
227 for ( unsigned int i = 0 ; i < packageList.size() ; ++i ) 228 for ( unsigned int i = 0 ; i < packageList.size() ; ++i )
228 { 229 {
229 QString name = packageList[i].getPackageName(); 230 QString name = packageList[i].getPackageName();
231
232 // If the package name is an ipk name, then convert the filename to a package name
233 if ( name.find( ".ipk" ) != -1 )
234 name = Utils::getPackageNameFromIpkFilename( packageList[i].getFilename() );
235
230 if ( local ) 236 if ( local )
231 packageList[i].setLocalPackage( local->getPackage( name ) ); 237 packageList[i].setLocalPackage( local->getPackage( name ) );
232 else 238 else
233 packageList[i].setLocalPackage( 0 ); 239 packageList[i].setLocalPackage( 0 );
234 } 240 }
235 241
236} 242}
237 243
238Package *Server :: getPackage( QString &name ) 244Package *Server :: getPackage( QString &name )
239{ 245{
240 return getPackage( (const char *)name ); 246 return getPackage( (const char *)name );
241} 247}