summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg/packagelist.cpp
Side-by-side diff
Diffstat (limited to 'noncore/unsupported/oipkg/packagelist.cpp') (more/less context) (ignore 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
@@ -13,20 +13,20 @@
#include <qfile.h>
#include <qfileinfo.h>
#include <qtextstream.h>
#include "debug.h"
-static QDict<Package> *packageListAll;
+static QDict<OipkgPackage> *packageListAll;
static int packageListAllRefCount = 0;
PackageList::PackageList(QObject *parent, const char *name)
: QObject(parent,name), packageIter( packageList )
{
empty=true;
- if (!packageListAll) packageListAll = new QDict<Package>();
+ if (!packageListAll) packageListAll = new QDict<OipkgPackage>();
packageListAllRefCount++;
sections << "All";
subSections.insert("All", new QStringList() );
QStringList *ss = subSections["All"];
*ss << "All";
aktSection = "All";
@@ -43,31 +43,31 @@ PackageList::PackageList( PackageManagerSettings* s, QObject *parent, const char
PackageList::~PackageList()
{
if (--packageListAllRefCount < 1 ) delete packageListAll;
}
/** Inserts a package into the list */
-void PackageList::insertPackage( Package* pack )
+void PackageList::insertPackage( OipkgPackage* pack )
{
if (!pack) return;
- Package* p = packageListAll->find( pack->name() );
+ OipkgPackage* p = packageListAll->find( pack->name() );
if ( p )
{
if ( (p->version() == pack->version())
// && (p->dest() == pack->dest())
)
{
p->copyValues( pack );
delete pack;
pack = p;
} else {
- QDict<Package> *packver = p->getOtherVersions();
+ QDict<OipkgPackage> *packver = p->getOtherVersions();
// p->setName( pack->name()+"["+p->version()+"]" );
if (!packver)
{
- packver = new QDict<Package>();
+ packver = new QDict<OipkgPackage>();
packver->insert( pack->name(), p );
p->setOtherVersions( packver );
}
pack->setName( pack->name() );//+"["+pack->version()+"]" );
pack->setOtherVersions( packver );
packver->insert( pack->name(), pack );
@@ -84,15 +84,15 @@ void PackageList::insertPackage( Package* pack )
updateSections( pack );
}
void PackageList::filterPackages( QString f )
{
packageList.clear();
- QDictIterator<Package> filterIter( origPackageList );
+ QDictIterator<OipkgPackage> filterIter( origPackageList );
filterIter.toFirst();
- Package *pack= filterIter.current() ;
+ OipkgPackage *pack= filterIter.current() ;
while ( pack )
{
if (
((aktSection=="All")||(pack->section()==aktSection)) &&
((aktSubSection=="All")||(pack->subSection()==aktSubSection)) &&
pack->name().contains( f )
@@ -102,24 +102,24 @@ void PackageList::filterPackages( QString f )
}
++filterIter;
pack = filterIter.current();
}
}
-Package* PackageList::find( QString n )
+OipkgPackage* PackageList::find( QString n )
{
return packageList.find( n );
}
-Package* PackageList::first()
+OipkgPackage* PackageList::first()
{
packageIter.toFirst();
return packageIter.current();
}
-Package* PackageList::next()
+OipkgPackage* PackageList::next()
{
++packageIter;
return packageIter.current();
}
QStringList PackageList::getSections()
@@ -144,13 +144,13 @@ void PackageList::setSection( QString sec )
void PackageList::setSubSection( QString ssec )
{
aktSubSection = ssec;
}
-void PackageList::updateSections( Package* pack )
+void PackageList::updateSections( OipkgPackage* pack )
{
QString s = pack->section();
if ( s.isEmpty() || s == "") return;
if ( !sections.contains(s) ) sections += s;
QString ss = pack->subSection();
if ( ss.isEmpty() || ss == "" ) return;
@@ -179,13 +179,13 @@ void PackageList::readFileEntries( QString filename, QString dest )
QString line = statusStream->readLine();
if ( line.find(QRegExp("[\n\t ]*")) || line == "" )
{
//end of package
if ( ! packEntry.isEmpty() )
{
- Package *p = new Package( packEntry, settings );
+ OipkgPackage *p = new OipkgPackage( packEntry, settings );
if ( p )
{
p->setDest( dest );
insertPackage( p );
packEntry.clear();
}
@@ -194,13 +194,13 @@ void PackageList::readFileEntries( QString filename, QString dest )
packEntry << line;
};
}
//there might be no nl at the end of the package file
if ( ! packEntry.isEmpty() )
{
- Package *p = new Package( packEntry, settings );
+ OipkgPackage *p = new OipkgPackage( packEntry, settings );
if ( p )
{
p->setDest( dest );
insertPackage( p );
packEntry.clear();
}
@@ -211,13 +211,13 @@ void PackageList::readFileEntries( QString filename, QString dest )
void PackageList::setSettings( PackageManagerSettings *s )
{
settings = s;
}
-Package* PackageList::getByName( QString n )
+OipkgPackage* PackageList::getByName( QString n )
{
return origPackageList[n];
}
void PackageList::clear()
{
@@ -225,15 +225,15 @@ void PackageList::clear()
packageList.clear();
}
void PackageList::allPackages()
{
packageList.clear();
- QDictIterator<Package> filterIter( origPackageList );
+ QDictIterator<OipkgPackage> filterIter( origPackageList );
filterIter.toFirst();
- Package *pack= filterIter.current() ;
+ OipkgPackage *pack= filterIter.current() ;
while ( pack )
{
packageList.insert( pack->name(), pack );
++filterIter;
pack = filterIter.current();
}