diff options
Diffstat (limited to 'kpackage/gentooInterface.cpp')
-rw-r--r-- | kpackage/gentooInterface.cpp | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/kpackage/gentooInterface.cpp b/kpackage/gentooInterface.cpp index a8ef275..448b74c 100644 --- a/kpackage/gentooInterface.cpp +++ b/kpackage/gentooInterface.cpp @@ -69,12 +69,12 @@ Gentoo::Gentoo() archesPossible << "~x86" << "x86"; portageDir="/usr/portage/"; - QFile f(portageDir+"profiles/package.mask"); + TQFile f(portageDir+"profiles/package.mask"); if (f.open(IO_ReadOnly)) { - QTextStream stream( &f ); + TQTextStream stream( &f ); - QString line; + TQString line; while (!stream.atEnd()) { line = stream.readLine(); @@ -96,15 +96,15 @@ Gentoo::~Gentoo() } ////////////////////////////////////////////////////////////////////////////// -bool Gentoo::isType(char * /*buf*/, const QString &) +bool Gentoo::isType(char * /*buf*/, const TQString &) { return false; } -bool Gentoo::parseName(const QString& name, QString *n, QString *v) +bool Gentoo::parseName(const TQString& name, TQString *n, TQString *v) { // Taken from the portage code, should be correct - QRegExp r("([^/]+)-((\\d+(\\.\\d+)*[a-z]*)(_(alpha|beta|pre|rc|p)\\d*)?(-r(\\d+))?)$"); + TQRegExp r("([^/]+)-((\\d+(\\.\\d+)*[a-z]*)(_(alpha|beta|pre|rc|p)\\d*)?(-r(\\d+))?)$"); r.search(name); @@ -117,25 +117,25 @@ bool Gentoo::parseName(const QString& name, QString *n, QString *v) return true; } -void Gentoo::listInstalledPackages(QPtrList<packageInfo> *pki) +void Gentoo::listInstalledPackages(TQPtrList<packageInfo> *pki) { - QString vb; + TQString vb; packageInfo *p; - QString sline = i18n("Looking for Gentoo packages: "); + TQString sline = i18n("Looking for Gentoo packages: "); kpackage->setStatus(sline); kpackage->setPercent(0); - QFile f(portageDir+"profiles/categories"); + TQFile f(portageDir+"profiles/categories"); if (!f.open(IO_ReadOnly)) { kdWarning() << "Couldn't open categories file" << endl; return; } - QTextStream stream( &f ); - QStringList categories; + TQTextStream stream( &f ); + TQStringList categories; while (!stream.atEnd()) { categories.append(stream.readLine()); @@ -143,7 +143,7 @@ void Gentoo::listInstalledPackages(QPtrList<packageInfo> *pki) int categoriesCount = categories.count(); int categoriesDone = 0; - for (QStringList::Iterator category = categories.begin(); category != categories.end(); ++category) + for (TQStringList::Iterator category = categories.begin(); category != categories.end(); ++category) { kpackage->setPercent(categoriesDone/categoriesCount); categoriesDone += 100; @@ -151,9 +151,9 @@ void Gentoo::listInstalledPackages(QPtrList<packageInfo> *pki) if (*category == "packages" || *category == "local" || *category == "virtual") continue; - QDir d("/var/db/pkg/"+*category); - QStringList packages = d.entryList(QDir::Dirs); - for (QStringList::Iterator it = packages.begin(); it != packages.end(); ++it) + TQDir d("/var/db/pkg/"+*category); + TQStringList packages = d.entryList(TQDir::Dirs); + for (TQStringList::Iterator it = packages.begin(); it != packages.end(); ++it) { if (*it != "." && *it != "..") { @@ -168,20 +168,20 @@ void Gentoo::listInstalledPackages(QPtrList<packageInfo> *pki) } } d.setPath("/var/cache/edb/dep/"+*category); - packages = d.entryList(QDir::Files); - for (QStringList::Iterator it = packages.begin(); it != packages.end(); ++it) + packages = d.entryList(TQDir::Files); + for (TQStringList::Iterator it = packages.begin(); it != packages.end(); ++it) { if (*it != "." && *it != "..") { bool isMasked = false; - QString version, name; + TQString version, name; if (!parseName(*it, &name, &version)) { kdDebug() << "Couldn't parse name: " << *it << endl; continue; } - for (QStringList::Iterator maskIt = packageMask.begin(); maskIt != packageMask.end(); ++maskIt) + for (TQStringList::Iterator maskIt = packageMask.begin(); maskIt != packageMask.end(); ++maskIt) { // FIXME Should all be handled, just not implemented yet if ((*maskIt).startsWith("<") || (*maskIt).startsWith("=") || (*maskIt).startsWith("~") || (*maskIt).startsWith(">")) @@ -217,10 +217,10 @@ void Gentoo::listInstalledPackages(QPtrList<packageInfo> *pki) ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// // mode: i = query installed u = query uninstalled -packageInfo *Gentoo::getPackageInfo(char mode, const QString &name, const QString &version) +packageInfo *Gentoo::getPackageInfo(char mode, const TQString &name, const TQString &version) { packageInfo *pki = 0; - QString vb,search; + TQString vb,search; switch(mode) { @@ -242,16 +242,16 @@ packageInfo *Gentoo::getPackageInfo(char mode, const QString &name, const QStrin ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -packageInfo *Gentoo::collectInstalledInfo(const QString& name, const QString& category) +packageInfo *Gentoo::collectInstalledInfo(const TQString& name, const TQString& category) { - QMap<QString, QString> a; + TQMap<TQString, TQString> a; - QIODevice* iod(KFilterDev::deviceForFile("/var/db/pkg/"+category+"/"+name+"/environment.bz2","application/x-bzip2", true)); - QString line; + TQIODevice* iod(KFilterDev::deviceForFile("/var/db/pkg/"+category+"/"+name+"/environment.bz2","application/x-bzip2", true)); + TQString line; if (!iod->open(IO_ReadOnly)) return 0; - QTextStream stream( iod ); - QString n, version, description; + TQTextStream stream( iod ); + TQString n, version, description; while (!stream.atEnd()) { line = stream.readLine(); @@ -285,9 +285,9 @@ packageInfo *Gentoo::collectInstalledInfo(const QString& name, const QString& ca } ////////////////////////////////////////////////////////////////////////////// -packageInfo *Gentoo::collectUninstalledInfo(const QString& name, const QString& category, const QString& version) +packageInfo *Gentoo::collectUninstalledInfo(const TQString& name, const TQString& category, const TQString& version) { - QMap<QString, QString> a; + TQMap<TQString, TQString> a; a.insert("name", name); a.insert("group", category); @@ -295,7 +295,7 @@ packageInfo *Gentoo::collectUninstalledInfo(const QString& name, const QString& a.insert("base", portageDir+category+"/"+name); a.insert("filename", name+"-"+version+".ebuild"); - QFile f("/var/cache/edb/dep/"+category+"/"+name+"-"+version); + TQFile f("/var/cache/edb/dep/"+category+"/"+name+"-"+version); if (!f.open(IO_ReadOnly)) { kdDebug() << "Couldn't read: " << name << "-" << version << endl; @@ -316,19 +316,19 @@ packageInfo *Gentoo::collectUninstalledInfo(const QString& name, const QString& // 11: IUSE // Skip first 7 lines for now - QTextStream stream( &f ); + TQTextStream stream( &f ); for (int i=0; i < 7 && !stream.atEnd(); i++) stream.readLine(); if (!stream.atEnd()) a.insert("summary", stream.readLine()); - QStringList keywords = QStringList::split(' ', stream.readLine()); + TQStringList keywords = TQStringList::split(' ', stream.readLine()); bool works = false; - for (QStringList::Iterator it = keywords.begin(); it != keywords.end(); ++it) + for (TQStringList::Iterator it = keywords.begin(); it != keywords.end(); ++it) { - for (QStringList::Iterator it2 = archesPossible.begin(); it2 != archesPossible.end(); ++it2) + for (TQStringList::Iterator it2 = archesPossible.begin(); it2 != archesPossible.end(); ++it2) { if (*it == *it2) { @@ -354,12 +354,12 @@ packageInfo *Gentoo::collectUninstalledInfo(const QString& name, const QString& ////////////////////////////////////////////////////////////////////////////// -QStringList Gentoo::getChangeLog(packageInfo *p) { - QStringList clog; - QFile f(portageDir+p->getProperty("group")+"/"+p->getProperty("name")+"/ChangeLog"); +TQStringList Gentoo::getChangeLog(packageInfo *p) { + TQStringList clog; + TQFile f(portageDir+p->getProperty("group")+"/"+p->getProperty("name")+"/ChangeLog"); if (!f.open(IO_ReadOnly)) return clog; - QTextStream stream(&f); + TQTextStream stream(&f); while (!stream.atEnd()) clog.append(stream.readLine()); return clog; @@ -375,16 +375,16 @@ bool Gentoo::changeTab(packageInfo *) { } ////////////////////////////////////////////////////////////////////////////// -QStringList Gentoo::getFileList(packageInfo *p) +TQStringList Gentoo::getFileList(packageInfo *p) { - QStringList filelist; + TQStringList filelist; - QFile f("/var/db/pkg/"+p->getProperty("group")+"/"+p->getProperty("name")+"-"+p->getProperty("version")+"/CONTENTS"); + TQFile f("/var/db/pkg/"+p->getProperty("group")+"/"+p->getProperty("name")+"-"+p->getProperty("version")+"/CONTENTS"); if (!f.open(IO_ReadOnly)) return filelist; - QTextStream stream(&f); - QString line; - QRegExp removeEnd("(.*)( [a-f0-9]{32} [0-9]+| -> [^ ] [0-9]+| -> [^\\(]*\\([^\\)]*\\))$"); + TQTextStream stream(&f); + TQString line; + TQRegExp removeEnd("(.*)( [a-f0-9]{32} [0-9]+| -> [^ ] [0-9]+| -> [^\\(]*\\([^\\)]*\\))$"); while (!stream.atEnd()) { line = stream.readLine(); @@ -395,7 +395,7 @@ QStringList Gentoo::getFileList(packageInfo *p) line = line.mid(pos+1); removeEnd.search(line); - QString cap = removeEnd.cap(1); + TQString cap = removeEnd.cap(1); if (!cap.isEmpty()) line = cap; @@ -406,9 +406,9 @@ QStringList Gentoo::getFileList(packageInfo *p) } ////////////////////////////////////////////////////////////////////////////// -QString Gentoo::uninstall(int , QPtrList<packageInfo> *plist, bool &test) +TQString Gentoo::uninstall(int , TQPtrList<packageInfo> *plist, bool &test) { - QString cmd; + TQString cmd; packageInfo *pk; if (test) @@ -424,9 +424,9 @@ QString Gentoo::uninstall(int , QPtrList<packageInfo> *plist, bool &test) } ////////////////////////////////////////////////////////////////////////////// -QString Gentoo::install(int, QPtrList<packageInfo> *plist, bool &test) +TQString Gentoo::install(int, TQPtrList<packageInfo> *plist, bool &test) { - QString cmd; + TQString cmd; packageInfo *pk; if (test) @@ -443,9 +443,9 @@ QString Gentoo::install(int, QPtrList<packageInfo> *plist, bool &test) ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -QStringList Gentoo::FindFile(const QString &, bool) +TQStringList Gentoo::FindFile(const TQString &, bool) { - return QStringList(); + return TQStringList(); } |