diff options
Diffstat (limited to 'kpackage/packageInfo.cpp')
-rw-r--r-- | kpackage/packageInfo.cpp | 124 |
1 files changed, 62 insertions, 62 deletions
diff --git a/kpackage/packageInfo.cpp b/kpackage/packageInfo.cpp index 1e19afc..6ea0ffa 100644 --- a/kpackage/packageInfo.cpp +++ b/kpackage/packageInfo.cpp @@ -35,8 +35,8 @@ // Standard headers #include <stdlib.h> -#include <qregexp.h> -#include <qdir.h> +#include <tqregexp.h> +#include <tqdir.h> #include <ctype.h> // KDE headers @@ -54,11 +54,11 @@ #include "options.h" // Global pixmap for -QPixmap *pict = NULL; +TQPixmap *pict = NULL; ////////////////////////////////////////////////////////////////////////////// // Constructor -- get the pixmap -packageInfo::packageInfo(QMap<QString, QString> _info, pkgInterface *type) +packageInfo::packageInfo(TQMap<TQString, TQString> _info, pkgInterface *type) { interface = type; info = _info; @@ -66,11 +66,11 @@ packageInfo::packageInfo(QMap<QString, QString> _info, pkgInterface *type) item = NULL; packageState = UNSET; updated = FALSE; - url = QString::null; + url = TQString::null; } // Another constructor, for a packge with a url -packageInfo::packageInfo(QMap<QString, QString> _info, const QString &_url) +packageInfo::packageInfo(TQMap<TQString, TQString> _info, const TQString &_url) { info = _info; url = _url; @@ -82,19 +82,19 @@ packageInfo::~packageInfo() } // Return a property -QString packageInfo::getProperty(const QString &property) +TQString packageInfo::getProperty(const TQString &property) { - QString result = info[property]; + TQString result = info[property]; if (result.isEmpty()) { - return QString::null; + return TQString::null; } return result; } // Check for existance of a property -bool packageInfo::hasProperty(const QString &property) +bool packageInfo::hasProperty(const TQString &property) { - QString s = info[property]; + TQString s = info[property]; if (s.isEmpty()) return false; else @@ -105,7 +105,7 @@ bool packageInfo::hasProperty(const QString &property) void packageInfo::fixup() { if (info["name"].isEmpty()) { - QString q; + TQString q; q.setNum((long)this); info.insert("name", q); } @@ -121,13 +121,13 @@ void packageInfo::fixup() } // Set the file name -void packageInfo::setFilename(const QString &f) +void packageInfo::setFilename(const TQString &f) { url = f; } // Get the url -QString packageInfo::getUrl() +TQString packageInfo::getUrl() { if (url.isEmpty()) { if (hasProperty("base") && hasProperty("filename")) { @@ -137,14 +137,14 @@ QString packageInfo::getUrl() return url; } -QString packageInfo::fetchFilename() +TQString packageInfo::fetchFilename() { - QString f = getFilename(); + TQString f = getFilename(); if (!f.isEmpty()) { return f; } else { - QString aurl = getUrl(); + TQString aurl = getUrl(); if (!aurl.isEmpty()) { return kpackage->fetchNetFile(aurl); } else { @@ -155,7 +155,7 @@ QString packageInfo::fetchFilename() bool packageInfo::isFileLocal() { - QString aurl = getUrl(); + TQString aurl = getUrl(); if (!aurl.isEmpty()) { return KPACKAGE::isFileLocal(aurl); } @@ -179,10 +179,10 @@ bool packageInfo::isFetchable() return false; } -QString packageInfo::getFilename() +TQString packageInfo::getFilename() { - QString cn = ""; - QString aurl = getUrl(); + TQString cn = ""; + TQString aurl = getUrl(); if (!aurl.isEmpty()) { return KPACKAGE::getFileName(aurl,cn); } else { @@ -190,11 +190,11 @@ QString packageInfo::getFilename() } } -int packageInfo::getDigElement(const QString &str, int *pos) +int packageInfo::getDigElement(const TQString &str, int *pos) // Extract the next element from the string // All digits { - QString s = str; + TQString s = str; if (*pos < 0) return -1; @@ -203,7 +203,7 @@ int packageInfo::getDigElement(const QString &str, int *pos) if (s.isEmpty()) return -1; - QRegExp ndig("[^0-9]"); + TQRegExp ndig("[^0-9]"); int nf = 0; int val = 0; @@ -223,23 +223,23 @@ int packageInfo::getDigElement(const QString &str, int *pos) return val; } -QString packageInfo::getNdigElement(const QString &string, int *pos) +TQString packageInfo::getNdigElement(const TQString &string, int *pos) // Extract the next element from the string // All all non-digits { - QString s(string); + TQString s(string); if (*pos < 0) - return QString::null; + return TQString::null; s = s.mid(*pos); if (s.isEmpty()) - return QString::null; + return TQString::null; - QString str; + TQString str; int nf = 0; - QRegExp idig("[0-9]"); + TQRegExp idig("[0-9]"); if ((s[0] < '0') || (s[0] > '9') ) { nf = s.find(idig); @@ -260,7 +260,7 @@ QString packageInfo::getNdigElement(const QString &string, int *pos) } -int packageInfo::pnewer(const QString &s, const QString &sp) +int packageInfo::pnewer(const TQString &s, const TQString &sp) { int ns = 0, nsp = 0, vs, vsp; @@ -280,8 +280,8 @@ int packageInfo::pnewer(const QString &s, const QString &sp) else if (vs > vsp) return -1; - QString svs = getNdigElement(s,&ns); - QString svsp = getNdigElement(sp,&nsp); + TQString svs = getNdigElement(s,&ns); + TQString svsp = getNdigElement(sp,&nsp); // kdDebug() << "vs=" << ns << " " << svs << " sp=" << nsp << " " << svsp << "\n"; if (svs.isEmpty() && svsp.isEmpty()) return 0; @@ -303,7 +303,7 @@ int packageInfo::pnewer(const QString &s, const QString &sp) } } -static bool split(QString orig, char seperator, QString &first, QString &second) +static bool split(TQString orig, char seperator, TQString &first, TQString &second) { int pos = orig.find(seperator); if (pos > 0) { @@ -316,12 +316,12 @@ static bool split(QString orig, char seperator, QString &first, QString &second) int packageInfo::newer(packageInfo *p) { - QString mySerial; // Serial number of this package - QString myVersion; // Version of this package - QString myRelease; // Release of this package + TQString mySerial; // Serial number of this package + TQString myVersion; // Version of this package + TQString myRelease; // Release of this package // Version of this package - QString s = getProperty("version"); + TQString s = getProperty("version"); (void) split(s, ':', mySerial, s); if (!split(s, '-', myVersion, myRelease)) @@ -330,9 +330,9 @@ int packageInfo::newer(packageInfo *p) } // Version of other package - QString hisSerial; // Serial number of the other package - QString hisVersion; // Version of the other package - QString hisRelease; // Release of the other package + TQString hisSerial; // Serial number of the other package + TQString hisVersion; // Version of the other package + TQString hisRelease; // Release of the other package s = p->getProperty("version"); if (p->hasProperty("release")) { @@ -392,7 +392,7 @@ bool packageInfo::display(int treeType) KpTreeListItem *packageInfo::place(KpTreeList *tree, bool insertI) { KpTreeListItem *search = tree->firstChild(), *parent=NULL, *child=NULL; - QString qtmp, tmp; + TQString qtmp, tmp; bool doit = FALSE; doit = TRUE; @@ -405,8 +405,8 @@ KpTreeListItem *packageInfo::place(KpTreeList *tree, bool insertI) qtmp += getProperty("group"); int cnt = 0; - QStringList list = QStringList::split("/",qtmp); - for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { + TQStringList list = TQStringList::split("/",qtmp); + for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { KpTreeListItem *group; if( search && (group=findGroup(*it, search)) ) { @@ -431,7 +431,7 @@ KpTreeListItem *packageInfo::place(KpTreeList *tree, bool insertI) if(item) delete item; - QString sz = ""; + TQString sz = ""; if (!info["size"].isEmpty()) { sz = info["size"].stripWhiteSpace(); if (sz.length() > 3) @@ -449,22 +449,22 @@ KpTreeListItem *packageInfo::place(KpTreeList *tree, bool insertI) } sz = sz.rightJustify(6,' '); - QString ver = ""; + TQString ver = ""; if (!info["version"].isEmpty()) { ver = info["version"]; } - QString over = ""; + TQString over = ""; if (!info["old-version"].isEmpty()) { over = info["old-version"]; } - QString summary = ""; + TQString summary = ""; if (!info["summary"].isEmpty()) { summary = info["summary"]; } - QPixmap pic; + TQPixmap pic; if (packageState == BAD_INSTALL) { pic = interface->bad_pict; } else if (packageState == UPDATED) { @@ -504,14 +504,14 @@ KpTreeListItem *packageInfo::getItem() } ////////////////////////////////////////////////////////////////////////////// -bool packageInfo::smerge( const QString &exp) { +bool packageInfo::smerge( const TQString &exp) { - QDict<packageInfo> *dirInfoPackages = kpackage->management->dirInfoPackages; - QString pname = getProperty("name") + exp; + TQDict<packageInfo> *dirInfoPackages = kpackage->management->dirInfoPackages; + TQString pname = getProperty("name") + exp; packageInfo *pi = dirInfoPackages->find(pname); if (pi) { - QMap<QString,QString>::Iterator it; + TQMap<TQString,TQString>::Iterator it; for ( it = pi->info.begin(); it != pi->info.end(); ++it ) { if (!(it.key() == "size" && !info["size"].isEmpty()) || @@ -526,7 +526,7 @@ bool packageInfo::smerge( const QString &exp) { } ////////////////////////////////////////////////////////////////////////////// -void packageInfo::pkgFileIns(const QString &fileName) +void packageInfo::pkgFileIns(const TQString &fileName) { info.insert("filename", fileName); info.insert("base", "/"); @@ -535,20 +535,20 @@ void packageInfo::pkgFileIns(const QString &fileName) packageState = packageInfo::NEW; place(kpackage->management->treeList,TRUE); - QString pname = getProperty("name") + interface->typeID; + TQString pname = getProperty("name") + interface->typeID; kpackage->management->dirUninstPackages->insert(pname,this); } } ////////////////////////////////////////////////////////////////////////////// -bool packageInfo::pkgInsert(QPtrList<packageInfo> *pki, const QString &exp, +bool packageInfo::pkgInsert(TQPtrList<packageInfo> *pki, const TQString &exp, bool installed, bool infoPackage) { - QDict<packageInfo> *dirInstPackages = kpackage->management->dirInstPackages; - QDict<packageInfo> *dirUninstPackages = kpackage->management->dirUninstPackages; - QDict<packageInfo> *dirInfoPackages = kpackage->management->dirInfoPackages; + TQDict<packageInfo> *dirInstPackages = kpackage->management->dirInstPackages; + TQDict<packageInfo> *dirUninstPackages = kpackage->management->dirUninstPackages; + TQDict<packageInfo> *dirInfoPackages = kpackage->management->dirInfoPackages; - QString pname = getProperty("name") + exp; + TQString pname = getProperty("name") + exp; // printf("U1=%s\n",pname.data()); bool shouldUpdate = TRUE; @@ -589,7 +589,7 @@ bool packageInfo::pkgInsert(QPtrList<packageInfo> *pki, const QString &exp, if (hidden) { packageState = HIDDEN; } else { - QString version = pi->getProperty("version"); + TQString version = pi->getProperty("version"); if (version.isEmpty()) { if (pi->packageState == NOLIST) packageState = NEW; @@ -603,7 +603,7 @@ bool packageInfo::pkgInsert(QPtrList<packageInfo> *pki, const QString &exp, } else { info.insert("old-version",version); } - QString group = getProperty("group"); + TQString group = getProperty("group"); if (group == "NEW") { if (pi->hasProperty("group")) { info.replace("group", |