author | andyq <andyq> | 2002-11-17 20:03:25 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-11-17 20:03:25 (UTC) |
commit | d94c9d39ab6e744f848a04c07eac03f20c91987c (patch) (unidiff) | |
tree | a9f32cca7c59ae565ab9caa3caf567100ed07cb4 /noncore/settings/aqpkg/server.cpp | |
parent | a94877f543bf0ebc2ec9c4c931cb5f21713b7872 (diff) | |
download | opie-d94c9d39ab6e744f848a04c07eac03f20c91987c.zip opie-d94c9d39ab6e744f848a04c07eac03f20c91987c.tar.gz opie-d94c9d39ab6e744f848a04c07eac03f20c91987c.tar.bz2 |
Added filter by category, and added extra fields to package display (Section and size)
Diffstat (limited to 'noncore/settings/aqpkg/server.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/server.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/noncore/settings/aqpkg/server.cpp b/noncore/settings/aqpkg/server.cpp index 539ebf0..7c3257b 100644 --- a/noncore/settings/aqpkg/server.cpp +++ b/noncore/settings/aqpkg/server.cpp | |||
@@ -25,12 +25,13 @@ | |||
25 | 25 | ||
26 | #include <iostream> | 26 | #include <iostream> |
27 | #include <fstream> | 27 | #include <fstream> |
28 | using namespace std; | 28 | using namespace std; |
29 | 29 | ||
30 | #include "server.h" | 30 | #include "server.h" |
31 | #include "datamgr.h" | ||
31 | 32 | ||
32 | #ifdef QWS | 33 | #ifdef QWS |
33 | #include <qpe/global.h> | 34 | #include <qpe/global.h> |
34 | #include <qpe/applnk.h> | 35 | #include <qpe/applnk.h> |
35 | #include <qlist.h> | 36 | #include <qlist.h> |
36 | #endif | 37 | #endif |
@@ -208,12 +209,24 @@ void Server :: readPackageFile( Server *local, bool clearAll, bool installingToR | |||
208 | } | 209 | } |
209 | else if ( key == "Filename" ) | 210 | else if ( key == "Filename" ) |
210 | { | 211 | { |
211 | if ( currPackage ) | 212 | if ( currPackage ) |
212 | currPackage->setFilename( value ); | 213 | currPackage->setFilename( value ); |
213 | } | 214 | } |
215 | else if ( key == "Size" ) | ||
216 | { | ||
217 | if ( currPackage ) | ||
218 | currPackage->setPackageSize( value ); | ||
219 | } | ||
220 | else if ( key == "Section" ) | ||
221 | { | ||
222 | if ( currPackage ) | ||
223 | currPackage->setSection( value ); | ||
224 | |||
225 | DataManager::setAvailableCategories( value ); | ||
226 | } | ||
214 | else if ( key == "" ) | 227 | else if ( key == "" ) |
215 | { | 228 | { |
216 | newPackage = true; | 229 | newPackage = true; |
217 | } | 230 | } |
218 | } while ( !in.eof() ); | 231 | } while ( !in.eof() ); |
219 | 232 | ||
@@ -267,13 +280,19 @@ QString Server :: toString() | |||
267 | 280 | ||
268 | for ( unsigned int i = 0 ; i < packageList.size() ; ++i ) | 281 | for ( unsigned int i = 0 ; i < packageList.size() ; ++i ) |
269 | ret += "\n " + packageList[i].toString(); | 282 | ret += "\n " + packageList[i].toString(); |
270 | 283 | ||
271 | 284 | ||
272 | return ret; | 285 | return ret; |
286 | } /* | ||
287 | void addAvailableSection( QString section ) | ||
288 | { | ||
289 | if ( DataManager::availableCategories.find( value ) == -1 ) | ||
290 | // DataManager::availableCategories += "#" + value; | ||
273 | } | 291 | } |
292 | */ | ||
274 | 293 | ||
275 | vector<Package> &Server::getPackageList() | 294 | vector<Package> &Server::getPackageList() |
276 | { | 295 | { |
277 | return packageList; | 296 | return packageList; |
278 | } | 297 | } |
279 | 298 | ||