Diffstat (limited to 'noncore/unsupported/oipkg/packagelist.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/packagelist.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/noncore/unsupported/oipkg/packagelist.cpp b/noncore/unsupported/oipkg/packagelist.cpp index 2fc4c41..fdd1163 100644 --- a/noncore/unsupported/oipkg/packagelist.cpp +++ b/noncore/unsupported/oipkg/packagelist.cpp | |||
@@ -5,18 +5,20 @@ | |||
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; | 10 | static QDict<Package> *packageListAll; |
11 | static int packageListAllRefCount = 0; | ||
11 | 12 | ||
12 | PackageList::PackageList() | 13 | PackageList::PackageList() |
13 | : packageIter( packageList ) | 14 | : packageIter( packageList ) |
14 | { | 15 | { |
15 | empty=true; | 16 | empty=true; |
16 | if (!packageListAll) packageListAll = new QDict<Package>(); | 17 | if (!packageListAll) packageListAll = new QDict<Package>(); |
18 | packageListAllRefCount++; | ||
17 | sections << "All"; | 19 | sections << "All"; |
18 | subSections.insert("All", new QStringList() ); | 20 | subSections.insert("All", new QStringList() ); |
19 | QStringList *ss = subSections["All"]; | 21 | QStringList *ss = subSections["All"]; |
20 | *ss << "All"; | 22 | *ss << "All"; |
21 | aktSection = "All"; | 23 | aktSection = "All"; |
22 | aktSubSection = "All"; | 24 | aktSubSection = "All"; |
@@ -28,12 +30,13 @@ PackageList::PackageList( PackageManagerSettings* s) | |||
28 | settings = s; | 30 | settings = s; |
29 | PackageList(); | 31 | PackageList(); |
30 | } | 32 | } |
31 | 33 | ||
32 | PackageList::~PackageList() | 34 | PackageList::~PackageList() |
33 | { | 35 | { |
36 | if (--packageListAllRefCount < 1 ) delete packageListAll; | ||
34 | } | 37 | } |
35 | 38 | ||
36 | /** Inserts a package into the list */ | 39 | /** Inserts a package into the list */ |
37 | void PackageList::insertPackage( Package* pack ) | 40 | void PackageList::insertPackage( Package* pack ) |
38 | { | 41 | { |
39 | if (!pack) return; | 42 | if (!pack) return; |
@@ -48,13 +51,13 @@ void PackageList::insertPackage( Package* pack ) | |||
48 | pack = p; | 51 | pack = p; |
49 | } else { | 52 | } else { |
50 | QDict<Package> *packver = p->getOtherVersions(); | 53 | QDict<Package> *packver = p->getOtherVersions(); |
51 | // p->setName( pack->name()+"["+p->version()+"]" ); | 54 | // p->setName( pack->name()+"["+p->version()+"]" ); |
52 | if (!packver) | 55 | if (!packver) |
53 | { | 56 | { |
54 | packver = new QDict<Package>; | 57 | packver = new QDict<Package>(); |
55 | packver->insert( pack->name(), p ); | 58 | packver->insert( pack->name(), p ); |
56 | p->setOtherVersions( packver ); | 59 | p->setOtherVersions( packver ); |
57 | } | 60 | } |
58 | pack->setName( pack->name()+"["+pack->version()+"]" ); | 61 | pack->setName( pack->name()+"["+pack->version()+"]" ); |
59 | pack->setOtherVersions( packver ); | 62 | pack->setOtherVersions( packver ); |
60 | packver->insert( pack->name(), pack ); | 63 | packver->insert( pack->name(), pack ); |
@@ -179,12 +182,13 @@ void PackageList::readFileEntries( QString filename, QString dest ) | |||
179 | } | 182 | } |
180 | } | 183 | } |
181 | }else{ | 184 | }else{ |
182 | packEntry << line; | 185 | packEntry << line; |
183 | }; | 186 | }; |
184 | } | 187 | } |
188 | delete statusStream; | ||
185 | return; | 189 | return; |
186 | } | 190 | } |
187 | 191 | ||
188 | void PackageList::setSettings( PackageManagerSettings *s ) | 192 | void PackageList::setSettings( PackageManagerSettings *s ) |
189 | { | 193 | { |
190 | settings = s; | 194 | settings = s; |