Diffstat (limited to 'noncore/unsupported/oipkg/packagelist.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/packagelist.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/noncore/unsupported/oipkg/packagelist.cpp b/noncore/unsupported/oipkg/packagelist.cpp index be20c71..2fc4c41 100644 --- a/noncore/unsupported/oipkg/packagelist.cpp +++ b/noncore/unsupported/oipkg/packagelist.cpp | |||
@@ -4,16 +4,19 @@ | |||
4 | #include <qfile.h> | 4 | #include <qfile.h> |
5 | #include <qfileinfo.h> | 5 | #include <qfileinfo.h> |
6 | #include <qtextstream.h> | 6 | #include <qtextstream.h> |
7 | 7 | ||
8 | #include "debug.h" | 8 | #include "debug.h" |
9 | 9 | ||
10 | static QDict<Package> *packageListAll; | ||
11 | |||
10 | PackageList::PackageList() | 12 | PackageList::PackageList() |
11 | : packageIter( packageList ) | 13 | : packageIter( packageList ) |
12 | { | 14 | { |
13 | empty=true; | 15 | empty=true; |
16 | if (!packageListAll) packageListAll = new QDict<Package>(); | ||
14 | sections << "All"; | 17 | sections << "All"; |
15 | subSections.insert("All", new QStringList() ); | 18 | subSections.insert("All", new QStringList() ); |
16 | QStringList *ss = subSections["All"]; | 19 | QStringList *ss = subSections["All"]; |
17 | *ss << "All"; | 20 | *ss << "All"; |
18 | aktSection = "All"; | 21 | aktSection = "All"; |
19 | aktSubSection = "All"; | 22 | aktSubSection = "All"; |
@@ -31,27 +34,39 @@ PackageList::~PackageList() | |||
31 | } | 34 | } |
32 | 35 | ||
33 | /** Inserts a package into the list */ | 36 | /** Inserts a package into the list */ |
34 | void PackageList::insertPackage( Package* pack ) | 37 | void PackageList::insertPackage( Package* pack ) |
35 | { | 38 | { |
36 | if (!pack) return; | 39 | if (!pack) return; |
37 | Package* p = packageList.find( pack->name() ); | 40 | Package* p = packageListAll->find( pack->name() ); |
38 | if ( p ) | 41 | if ( p ) |
39 | { | 42 | { |
40 | if ( p->version() == pack->version() ) | 43 | if ( (p->version() == pack->version()) |
44 | && (p->dest() == pack->dest()) ) | ||
41 | { | 45 | { |
42 | p->copyValues( pack ); | 46 | p->copyValues( pack ); |
43 | delete pack; | 47 | delete pack; |
44 | pack = p; | 48 | pack = p; |
45 | } else { | 49 | } else { |
46 | p->setName( pack->name()+"["+p->version()+"]" ); | 50 | QDict<Package> *packver = p->getOtherVersions(); |
51 | // p->setName( pack->name()+"["+p->version()+"]" ); | ||
52 | if (!packver) | ||
53 | { | ||
54 | packver = new QDict<Package>; | ||
55 | packver->insert( pack->name(), p ); | ||
56 | p->setOtherVersions( packver ); | ||
57 | } | ||
47 | pack->setName( pack->name()+"["+pack->version()+"]" ); | 58 | pack->setName( pack->name()+"["+pack->version()+"]" ); |
59 | pack->setOtherVersions( packver ); | ||
60 | packver->insert( pack->name(), pack ); | ||
61 | packageListAll->insert( pack->name(), pack ); | ||
48 | packageList.insert( pack->name(), pack ); | 62 | packageList.insert( pack->name(), pack ); |
49 | origPackageList.insert( pack->name(), pack ); | 63 | origPackageList.insert( pack->name(), pack ); |
50 | } | 64 | } |
51 | }else{ | 65 | }else{ |
66 | packageListAll->insert( pack->name(), pack ); | ||
52 | packageList.insert( pack->name(), pack ); | 67 | packageList.insert( pack->name(), pack ); |
53 | origPackageList.insert( pack->name(), pack ); | 68 | origPackageList.insert( pack->name(), pack ); |
54 | }; | 69 | }; |
55 | empty=false; | 70 | empty=false; |
56 | updateSections( pack ); | 71 | updateSections( pack ); |
57 | } | 72 | } |