summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg/packagelist.cpp
Unidiff
Diffstat (limited to 'noncore/unsupported/oipkg/packagelist.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/packagelist.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/noncore/unsupported/oipkg/packagelist.cpp b/noncore/unsupported/oipkg/packagelist.cpp
index edb9cc5..5f79ec1 100644
--- a/noncore/unsupported/oipkg/packagelist.cpp
+++ b/noncore/unsupported/oipkg/packagelist.cpp
@@ -16,14 +16,14 @@
16 16
17#include "debug.h" 17#include "debug.h"
18 18
19static QDict<Package> *packageListAll; 19static QDict<OipkgPackage> *packageListAll;
20static int packageListAllRefCount = 0; 20static int packageListAllRefCount = 0;
21 21
22PackageList::PackageList(QObject *parent, const char *name) 22PackageList::PackageList(QObject *parent, const char *name)
23 : QObject(parent,name), packageIter( packageList ) 23 : QObject(parent,name), packageIter( packageList )
24{ 24{
25 empty=true; 25 empty=true;
26 if (!packageListAll) packageListAll = new QDict<Package>(); 26 if (!packageListAll) packageListAll = new QDict<OipkgPackage>();
27 packageListAllRefCount++; 27 packageListAllRefCount++;
28 sections << "All"; 28 sections << "All";
29 subSections.insert("All", new QStringList() ); 29 subSections.insert("All", new QStringList() );
@@ -46,10 +46,10 @@ PackageList::~PackageList()
46} 46}
47 47
48/** Inserts a package into the list */ 48/** Inserts a package into the list */
49void PackageList::insertPackage( Package* pack ) 49void PackageList::insertPackage( OipkgPackage* pack )
50{ 50{
51 if (!pack) return; 51 if (!pack) return;
52 Package* p = packageListAll->find( pack->name() ); 52 OipkgPackage* p = packageListAll->find( pack->name() );
53 if ( p ) 53 if ( p )
54 { 54 {
55 if ( (p->version() == pack->version()) 55 if ( (p->version() == pack->version())
@@ -60,11 +60,11 @@ void PackageList::insertPackage( Package* pack )
60 delete pack; 60 delete pack;
61 pack = p; 61 pack = p;
62 } else { 62 } else {
63 QDict<Package> *packver = p->getOtherVersions(); 63 QDict<OipkgPackage> *packver = p->getOtherVersions();
64 // p->setName( pack->name()+"["+p->version()+"]" ); 64 // p->setName( pack->name()+"["+p->version()+"]" );
65 if (!packver) 65 if (!packver)
66 { 66 {
67 packver = new QDict<Package>(); 67 packver = new QDict<OipkgPackage>();
68 packver->insert( pack->name(), p ); 68 packver->insert( pack->name(), p );
69 p->setOtherVersions( packver ); 69 p->setOtherVersions( packver );
70 } 70 }
@@ -87,9 +87,9 @@ void PackageList::insertPackage( Package* pack )
87void PackageList::filterPackages( QString f ) 87void PackageList::filterPackages( QString f )
88 { 88 {
89 packageList.clear(); 89 packageList.clear();
90 QDictIterator<Package> filterIter( origPackageList ); 90 QDictIterator<OipkgPackage> filterIter( origPackageList );
91 filterIter.toFirst(); 91 filterIter.toFirst();
92 Package *pack= filterIter.current() ; 92 OipkgPackage *pack= filterIter.current() ;
93 while ( pack ) 93 while ( pack )
94 { 94 {
95 if ( 95 if (
@@ -105,18 +105,18 @@ void PackageList::filterPackages( QString f )
105 } 105 }
106} 106}
107 107
108Package* PackageList::find( QString n ) 108OipkgPackage* PackageList::find( QString n )
109{ 109{
110 return packageList.find( n ); 110 return packageList.find( n );
111} 111}
112 112
113Package* PackageList::first() 113OipkgPackage* PackageList::first()
114 { 114 {
115 packageIter.toFirst(); 115 packageIter.toFirst();
116 return packageIter.current(); 116 return packageIter.current();
117} 117}
118 118
119Package* PackageList::next() 119OipkgPackage* PackageList::next()
120{ 120{
121 ++packageIter; 121 ++packageIter;
122 return packageIter.current(); 122 return packageIter.current();
@@ -147,7 +147,7 @@ void PackageList::setSubSection( QString ssec )
147 aktSubSection = ssec; 147 aktSubSection = ssec;
148} 148}
149 149
150void PackageList::updateSections( Package* pack ) 150void PackageList::updateSections( OipkgPackage* pack )
151{ 151{
152 QString s = pack->section(); 152 QString s = pack->section();
153 if ( s.isEmpty() || s == "") return; 153 if ( s.isEmpty() || s == "") return;
@@ -182,7 +182,7 @@ void PackageList::readFileEntries( QString filename, QString dest )
182 //end of package 182 //end of package
183 if ( ! packEntry.isEmpty() ) 183 if ( ! packEntry.isEmpty() )
184 { 184 {
185 Package *p = new Package( packEntry, settings ); 185 OipkgPackage *p = new OipkgPackage( packEntry, settings );
186 if ( p ) 186 if ( p )
187 { 187 {
188 p->setDest( dest ); 188 p->setDest( dest );
@@ -197,7 +197,7 @@ void PackageList::readFileEntries( QString filename, QString dest )
197 //there might be no nl at the end of the package file 197 //there might be no nl at the end of the package file
198 if ( ! packEntry.isEmpty() ) 198 if ( ! packEntry.isEmpty() )
199 { 199 {
200 Package *p = new Package( packEntry, settings ); 200 OipkgPackage *p = new OipkgPackage( packEntry, settings );
201 if ( p ) 201 if ( p )
202 { 202 {
203 p->setDest( dest ); 203 p->setDest( dest );
@@ -214,7 +214,7 @@ void PackageList::setSettings( PackageManagerSettings *s )
214 settings = s; 214 settings = s;
215} 215}
216 216
217Package* PackageList::getByName( QString n ) 217OipkgPackage* PackageList::getByName( QString n )
218{ 218{
219 return origPackageList[n]; 219 return origPackageList[n];
220} 220}
@@ -228,9 +228,9 @@ void PackageList::clear()
228void PackageList::allPackages() 228void PackageList::allPackages()
229{ 229{
230 packageList.clear(); 230 packageList.clear();
231 QDictIterator<Package> filterIter( origPackageList ); 231 QDictIterator<OipkgPackage> filterIter( origPackageList );
232 filterIter.toFirst(); 232 filterIter.toFirst();
233 Package *pack= filterIter.current() ; 233 OipkgPackage *pack= filterIter.current() ;
234 while ( pack ) 234 while ( pack )
235 { 235 {
236 packageList.insert( pack->name(), pack ); 236 packageList.insert( pack->name(), pack );