diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:25:18 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:25:18 +0000 |
commit | aa3a1ca934bc541bddd3fa136a85f106f7da266e (patch) | |
tree | 9ad0b795aed8fa4ac30c2fe0fd1aacb8175714c0 /kpackage | |
parent | b10cf7066791a2f362495890cd50c984e8025412 (diff) | |
download | tdeadmin-aa3a1ca934bc541bddd3fa136a85f106f7da266e.tar.gz tdeadmin-aa3a1ca934bc541bddd3fa136a85f106f7da266e.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeadmin@1157635 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kpackage')
53 files changed, 1806 insertions, 1806 deletions
diff --git a/kpackage/cache.cpp b/kpackage/cache.cpp index 1877728..a50e838 100644 --- a/kpackage/cache.cpp +++ b/kpackage/cache.cpp @@ -37,8 +37,8 @@ extern Opts *opts; ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -cacheObj::cacheObj(const QString &Pbase, const QString &Plocation, const QString &PcacheFile, - const QString &Poption, bool Psubdirs) +cacheObj::cacheObj(const TQString &Pbase, const TQString &Plocation, const TQString &PcacheFile, + const TQString &Poption, bool Psubdirs) { base = Pbase; location = Plocation; @@ -50,48 +50,48 @@ cacheObj::cacheObj(const QString &Pbase, const QString &Plocation, const QString cacheObj::~cacheObj() {} -QString cacheObj::PDir() +TQString cacheObj::PDir() { struct stat buf; - stat(QFile::encodeName(QDir::homeDirPath()), &buf); + stat(TQFile::encodeName(TQDir::homeDirPath()), &buf); - QString tmpd = opts->CacheDir ; + TQString tmpd = opts->CacheDir ; - QDir d(tmpd); + TQDir d(tmpd); if (!d.exists()) { if (!d.mkdir(tmpd)) { KpMsgE(i18n("Cannot create folder %1").arg(tmpd),TRUE); tmpd = ""; } else { - chown(QFile::encodeName(tmpd),buf.st_uid,buf.st_gid); + chown(TQFile::encodeName(tmpd),buf.st_uid,buf.st_gid); } } return tmpd; } -QString cacheObj::CDir() +TQString cacheObj::CDir() { - QString tmpd = PDir(); + TQString tmpd = PDir(); if (!tmpd.isEmpty()) { struct stat buf; - stat(QFile::encodeName(tmpd),&buf); + stat(TQFile::encodeName(tmpd),&buf); tmpd += "dir/"; - QDir d(tmpd); + TQDir d(tmpd); if (!d.exists()) { if (!d.mkdir(tmpd)) { KpMsgE(i18n("Cannot create folder %1").arg(tmpd),TRUE); tmpd = ""; } else { - chown(QFile::encodeName(tmpd),buf.st_uid,buf.st_gid); + chown(TQFile::encodeName(tmpd),buf.st_uid,buf.st_gid); } } } return tmpd; } -int cacheObj::newDCache(const QString &url, const QString &fn, QString &fname) { +int cacheObj::newDCache(const TQString &url, const TQString &fn, TQString &fname) { KURL u(url); if ( !u.isValid() ) { @@ -99,7 +99,7 @@ int cacheObj::newDCache(const QString &url, const QString &fn, QString &fname) return -1; } - QString tmpd = cacheObj::CDir(); + TQString tmpd = cacheObj::CDir(); if (tmpd.isEmpty()) { return -1; } else { @@ -114,7 +114,7 @@ int cacheObj::newDCache(const QString &url, const QString &fn, QString &fname) return 1; } - QFileInfo f(fname); + TQFileInfo f(fname); if (f.exists() && f.size() > 0) { return 0;; @@ -126,42 +126,42 @@ int cacheObj::newDCache(const QString &url, const QString &fn, QString &fname) } } -void cacheObj::rmDCache(const QString &fn) { - QString tmpd = cacheObj::CDir(); +void cacheObj::rmDCache(const TQString &fn) { + TQString tmpd = cacheObj::CDir(); tmpd += fn; if (!tmpd.isEmpty()) { - unlink(QFile::encodeName(tmpd)); + unlink(TQFile::encodeName(tmpd)); } } void cacheObj::clearDCache() { - QString tmpd = cacheObj::CDir(); + TQString tmpd = cacheObj::CDir(); if (!tmpd.isEmpty()) { - QDir d(tmpd); + TQDir d(tmpd); CacheList cl(d) ; for (CacheList::iterator it = cl.begin() ; it != cl.end() ; ++it) { - QString s = tmpd; + TQString s = tmpd; s += *it; - unlink(QFile::encodeName(s)); + unlink(TQFile::encodeName(s)); } - unlink(QFile::encodeName(cl.getCLFileName())) ; // also delete the kpackage_cachelist file + unlink(TQFile::encodeName(cl.getCLFileName())) ; // also delete the kpackage_cachelist file } } void cacheObj::clearPCache() { - QString tmpd = cacheObj::PDir(); + TQString tmpd = cacheObj::PDir(); if (!tmpd.isEmpty()) { - QDir d(tmpd); + TQDir d(tmpd); CacheList cl(d); for (CacheList::iterator it = cl.begin() ; it != cl.end() ; ++it) { - QString s = tmpd ; + TQString s = tmpd ; s += *it; - unlink(QFile::encodeName(s)); + unlink(TQFile::encodeName(s)); } - unlink(QFile::encodeName(cl.getCLFileName())) ; // also delete the kpackage_cachelist file + unlink(TQFile::encodeName(cl.getCLFileName())) ; // also delete the kpackage_cachelist file } } @@ -178,7 +178,7 @@ LcacheObj::~LcacheObj() ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -CacheList::CacheList (const QDir& dir) +CacheList::CacheList (const TQDir& dir) { CLFile.setName (dir.path() + "/kpackage_cachelist") ; read() ; @@ -188,8 +188,8 @@ void CacheList::read () { kdDebug() << "reading cachelist: " << CLFile.name() << "\n" ; if (CLFile.open (IO_ReadOnly)) { - QTextStream stream (&CLFile) ; - QString line ; + TQTextStream stream (&CLFile) ; + TQString line ; while (!stream.eof()) { line = stream.readLine() ; if (line[0] != '#') { // not a comment @@ -207,10 +207,10 @@ void CacheList::write () { kdDebug() << "writing cachelist: " << CLFile.name() << "\n" ; if (CLFile.open (IO_WriteOnly)) { - QTextStream stream (&CLFile) ; + TQTextStream stream (&CLFile) ; stream << "# This file contains a list of files that have been cached in this folder.\n" ; stream << "# Please only delete this if you want kpackage to forget what it has cached.\n" ; - for (QStringList::iterator it = begin() ; it != end() ; ++it) { + for (TQStringList::iterator it = begin() ; it != end() ; ++it) { stream << *it << "\n" ; } CLFile.close() ; @@ -220,7 +220,7 @@ void CacheList::write () } } -QString CacheList::getCLFileName () const +TQString CacheList::getCLFileName () const { return CLFile.name() ; } diff --git a/kpackage/cache.h b/kpackage/cache.h index 02dc830..2a54b7c 100644 --- a/kpackage/cache.h +++ b/kpackage/cache.h @@ -29,8 +29,8 @@ #ifndef CACHE_H #define CACHE_H -#include <qdir.h> -#include <qptrlist.h> +#include <tqdir.h> +#include <tqptrlist.h> #include <kurl.h> @@ -45,29 +45,29 @@ class LcacheObj; class cacheObj { public: - QString base; - QString location; - QString cacheFile; - QString option; + TQString base; + TQString location; + TQString cacheFile; + TQString option; bool subdirs; - cacheObj(const QString &Pbase, const QString &Plocation, const QString &PcacheFile, const QString &Poption = QString::null, bool Psubdirs = FALSE); + cacheObj(const TQString &Pbase, const TQString &Plocation, const TQString &PcacheFile, const TQString &Poption = TQString::null, bool Psubdirs = FALSE); ~cacheObj(); - static QString PDir(); + static TQString PDir(); // return path of kpackage cache directory - static QString CDir(); + static TQString CDir(); // return path of kpackage directory cache - static int newDCache(const QString &url, const QString &fn, QString &fname); + static int newDCache(const TQString &url, const TQString &fn, TQString &fname); // Checks directory cache // -1 Cann't get cache file name // 0 Cache file exists // 1 Cache file doesn't exit // fname return file name - static void rmDCache(const QString &fn); + static void rmDCache(const TQString &fn); static void clearDCache(); static void clearPCache(); @@ -75,7 +75,7 @@ public: ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -class LcacheObj: public QPtrList<cacheObj> +class LcacheObj: public TQPtrList<cacheObj> { public: LcacheObj(); @@ -94,17 +94,17 @@ public: /** * create (and read) a cachelist object for the directory dir **/ - CacheList (const QDir& dir) ; + CacheList (const TQDir& dir) ; /** * write this cachelist to disk **/ void write (void) ; - QString getCLFileName (void) const ; + TQString getCLFileName (void) const ; private: - QFile CLFile ; + TQFile CLFile ; void read (void) ; } ; diff --git a/kpackage/debAptInterface.cpp b/kpackage/debAptInterface.cpp index 9dffb39..9139adf 100644 --- a/kpackage/debAptInterface.cpp +++ b/kpackage/debAptInterface.cpp @@ -60,8 +60,8 @@ DEBAPT::DEBAPT():DEB() locatedialog->dLocations(1, 8, this, i18n("Folders", "F"), "Deb", "*.deb", i18n("Location of Folders Containing Debian Packages")); - connect(locatedialog,SIGNAL(returnVal(LcacheObj *)), - this,SLOT(setAvail(LcacheObj *))); + connect(locatedialog,TQT_SIGNAL(returnVal(LcacheObj *)), + this,TQT_SLOT(setAvail(LcacheObj *))); locatedialog->apply_slot(); paramsInst.append(new param(i18n("Download only"),FALSE,FALSE,"-d")); @@ -93,28 +93,28 @@ DEBAPT::~DEBAPT() ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -bool DEBAPT::isType(char *, const QString &) +bool DEBAPT::isType(char *, const TQString &) { return false; } void DEBAPT::makeMenu(KActionCollection* act) { - updateM = new KAction( i18n("&Update"), QString::null, + updateM = new KAction( i18n("&Update"), TQString::null, 0, this, - SLOT(updateS()), act, "debapt_update"); + TQT_SLOT(updateS()), act, "debapt_update"); - upgradeM = new KAction( i18n("U&pgrade"), QString::null, + upgradeM = new KAction( i18n("U&pgrade"), TQString::null, 0, this, - SLOT(upgradeS()), act, "debapt_upgrade"); + TQT_SLOT(upgradeS()), act, "debapt_upgrade"); - fixupM = new KAction( i18n("&Fixup"), QString::null, + fixupM = new KAction( i18n("&Fixup"), TQString::null, 0, this, - SLOT(fixupS()), act, "debapt_fixup"); + TQT_SLOT(fixupS()), act, "debapt_fixup"); - fileM = new KAction( i18n("&Apt-File Update"), QString::null, + fileM = new KAction( i18n("&Apt-File Update"), TQString::null, 0, this, - SLOT(fileS()), act, "debapt_file"); + TQT_SLOT(fileS()), act, "debapt_file"); } void DEBAPT::setMenu(KActionCollection*, bool enable) @@ -160,7 +160,7 @@ void DEBAPT::fileS() } } -void DEBAPT::listPackages(QPtrList<packageInfo> *pki) +void DEBAPT::listPackages(TQPtrList<packageInfo> *pki) { if (hostName.isEmpty()) { listInstalledPackages(pki); @@ -173,24 +173,24 @@ void DEBAPT::listPackages(QPtrList<packageInfo> *pki) } } -void DEBAPT::listRemotePackages(QPtrList<packageInfo> *pki) +void DEBAPT::listRemotePackages(TQPtrList<packageInfo> *pki) { listRPack(pki); } -void DEBAPT::listRPack(QPtrList<packageInfo> *pki) +void DEBAPT::listRPack(TQPtrList<packageInfo> *pki) { int NLINES = 70000; packageInfo *p; - QStringList plist; + TQStringList plist; kpackage->setStatus(i18n("Querying DEB APT remote package list: %1").arg(hostName)); kpackage->setPercent(0); - QString cmd = "cat " STATUS; + TQString cmd = "cat " STATUS; - QStringList list = kpty->run(cmd); + TQStringList list = kpty->run(cmd); kpackage->setStatus(i18n("Processing DEB APT remote package list: %1").arg(hostName)); // kdDebug() << "P=" << list.count() <<"\n"; kpackage->setPercent(50); @@ -198,12 +198,12 @@ void DEBAPT::listRPack(QPtrList<packageInfo> *pki) if (list.count() > 0) { - QString s; + TQString s; kpackage->setPercent(50 ); int cnt = 0; - for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { + for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { cnt++; if (cnt % (NLINES/20) == 0) { kpackage->setPercent(((cnt * 100)/ NLINES ) + 50); @@ -232,12 +232,12 @@ void DEBAPT::listRPack(QPtrList<packageInfo> *pki) kpackage->setPercent(100); } -void DEBAPT::listAvail(QPtrList<packageInfo> *pki) +void DEBAPT::listAvail(TQPtrList<packageInfo> *pki) { int NLINES = 150000; packageInfo *p; - QStringList plist; + TQStringList plist; // kdDebug() << "H=" << hostName << "\n"; if (hostName.isEmpty()) @@ -246,7 +246,7 @@ void DEBAPT::listAvail(QPtrList<packageInfo> *pki) kpackage->setStatus(i18n("Querying DEB APT available list: %1").arg(hostName)); kpackage->setPercent(0); - QStringList list = kpty->run("apt-cache dumpavail"); + TQStringList list = kpty->run("apt-cache dumpavail"); if (hostName.isEmpty()) kpackage->setStatus(i18n("Processing DEB APT available list")); else @@ -257,12 +257,12 @@ void DEBAPT::listAvail(QPtrList<packageInfo> *pki) if (list.count() > 0) { - QString s; + TQString s; kpackage->setPercent(50 ); int cnt = 0; - for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { + for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { cnt++; if (cnt % (NLINES/20) == 0) { kpackage->setPercent(((cnt * 100)/ NLINES ) + 50); @@ -288,12 +288,12 @@ void DEBAPT::listAvail(QPtrList<packageInfo> *pki) kpackage->setPercent(100); } -QStringList DEBAPT::listInstalls(const QStringList &packs, bool install, bool &cancel) +TQStringList DEBAPT::listInstalls(const TQStringList &packs, bool install, bool &cancel) { bool extras=FALSE, found=FALSE; - QString match; - QString s = "apt-get -s "; + TQString match; + TQString s = "apt-get -s "; if (install) { s += "install "; match = " extra packages "; @@ -302,12 +302,12 @@ QStringList DEBAPT::listInstalls(const QStringList &packs, bool install, bool & s += "remove "; } - for ( QStringList::ConstIterator it = packs.begin(); it != packs.end(); ++it ) { + for ( TQStringList::ConstIterator it = packs.begin(); it != packs.end(); ++it ) { s += *it; s += " "; } - QStringList list = kpty->run(s, TRUE, TRUE); + TQStringList list = kpty->run(s, TRUE, TRUE); if (!kpty->inSession) { cancel = TRUE; // Root login did not work } else { @@ -315,8 +315,8 @@ QStringList DEBAPT::listInstalls(const QStringList &packs, bool install, bool & } // kdDebug() << "LS=" << list.count() << "\n"; - QString packAll; - for ( QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) { + TQString packAll; + for ( TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) { // kdDebug() << "M=" << *it << "\n"; if ((*it).find(match) >= 0 || extras) { if (extras) { @@ -332,32 +332,32 @@ QStringList DEBAPT::listInstalls(const QStringList &packs, bool install, bool & } if (!found) { - QStringList nill; + TQStringList nill; return nill; } else { - QStringList plist = QStringList::split(' ',packAll); + TQStringList plist = TQStringList::split(' ',packAll); return plist; } } ////////////////////////////////////////////////////////////////////////////// -QStringList DEBAPT::FindFile(const QString &name, bool searchAll) +TQStringList DEBAPT::FindFile(const TQString &name, bool searchAll) { if (searchAll) { if (ifExe("apt-file") || !hostName.isEmpty()) { - QString s = "apt-file search "; + TQString s = "apt-file search "; s += name; - QStringList filelist = kpty->run(s); + TQStringList filelist = kpty->run(s); - for ( QStringList::Iterator it = filelist.begin(); it != filelist.end(); ++it ) { + for ( TQStringList::Iterator it = filelist.begin(); it != filelist.end(); ++it ) { int p = (*it).find(": "); if( p !=-1 ) (*it).replace(p, 2, "\t"); } if (filelist.count() == 1) { - QStringList::Iterator it = filelist.begin(); + TQStringList::Iterator it = filelist.begin(); if ((*it).find("not found") >= 0) { filelist.remove(it); } @@ -366,7 +366,7 @@ QStringList DEBAPT::FindFile(const QString &name, bool searchAll) return filelist; } else { KpMsg("Error",i18n("The %1 program needs to be installed").arg("apt-file"), TRUE); - QStringList nill; + TQStringList nill; return nill; } } else { @@ -375,9 +375,9 @@ QStringList DEBAPT::FindFile(const QString &name, bool searchAll) } -QStringList DEBAPT::getFileList(packageInfo *p) +TQStringList DEBAPT::getFileList(packageInfo *p) { - QString fn( p->getFilename()); + TQString fn( p->getFilename()); if(!fn.isEmpty()) return getUFileList(fn); else { @@ -392,10 +392,10 @@ QStringList DEBAPT::getFileList(packageInfo *p) } } - QStringList DEBAPT::getRFileList(packageInfo *p) + TQStringList DEBAPT::getRFileList(packageInfo *p) { - QString from; - QString name = p->getProperty("name"); + TQString from; + TQString name = p->getProperty("name"); from = "cat " INFODIR; from += name; @@ -405,9 +405,9 @@ QStringList DEBAPT::getFileList(packageInfo *p) } ////////////////////////////////////////////////////////////////////////////// -QString DEBAPT::doUninstall(int uninstallFlags, const QString &packs, bool &test) +TQString DEBAPT::doUninstall(int uninstallFlags, const TQString &packs, bool &test) { - QString s = env + "apt-get remove "; + TQString s = env + "apt-get remove "; s += setOptions(uninstallFlags, paramsUninst); s += packs; @@ -420,16 +420,16 @@ QString DEBAPT::doUninstall(int uninstallFlags, const QString &packs, bool &test } ////////////////////////////////////////////////////////////////////////////// -QString DEBAPT::install(int installFlags, QPtrList<packageInfo> *p, +TQString DEBAPT::install(int installFlags, TQPtrList<packageInfo> *p, bool &test) { - QString packs = ""; - QString files = ""; + TQString packs = ""; + TQString files = ""; packageInfo *i; for (i = p->first(); i!= 0; i = p->next()) { - QString file = i->getFilename(); - QString fname = i->fetchFilename(); + TQString file = i->getFilename(); + TQString fname = i->fetchFilename(); if (!file.isEmpty()) { files += KProcess::quote(file); @@ -447,9 +447,9 @@ QString DEBAPT::install(int installFlags, QPtrList<packageInfo> *p, } } -QString DEBAPT::doInstall(int installFlags, const QString &packs, bool &test) +TQString DEBAPT::doInstall(int installFlags, const TQString &packs, bool &test) { - QString s = env + "apt-get install "; + TQString s = env + "apt-get install "; s += setOptions(installFlags, paramsInst); s += packs; @@ -464,7 +464,7 @@ QString DEBAPT::doInstall(int installFlags, const QString &packs, bool &test) ////////////////////////////////////////////////////////////////////////////// -QStringList DEBAPT::readApt() +TQStringList DEBAPT::readApt() { if (hostName.isEmpty()) { return readAptF(); @@ -473,14 +473,14 @@ QStringList DEBAPT::readApt() } } -QStringList DEBAPT::readAptS() +TQStringList DEBAPT::readAptS() { - QString cmd = "cat -E " APT_SOURCE; + TQString cmd = "cat -E " APT_SOURCE; - QStringList list = kpty->run(cmd); + TQStringList list = kpty->run(cmd); if (!kpty->Result) { - QString s; - for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { + TQString s; + for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { (*it).truncate((*it).length() - 1); (*it) = (*it).stripWhiteSpace(); } @@ -490,13 +490,13 @@ QStringList DEBAPT::readAptS() } } -QStringList DEBAPT::readAptF() +TQStringList DEBAPT::readAptF() { - QStringList lines; - QFile file( "/etc/apt/sources.list" ); + TQStringList lines; + TQFile file( "/etc/apt/sources.list" ); if ( file.open( IO_ReadOnly ) ) { - QTextStream stream( &file ); - QString line; + TQTextStream stream( &file ); + TQString line; while ( !stream.atEnd() ) { line = stream.readLine(); // line of text excluding '\n' line = line.stripWhiteSpace(); @@ -509,11 +509,11 @@ QStringList DEBAPT::readAptF() } } -void DEBAPT::writeApt(const QStringList &list) { +void DEBAPT::writeApt(const TQStringList &list) { kdDebug() << "writeApt\n"; - QString cmd = "sh -c \"/bin/echo -e '"; - for ( QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) { - QString s = *it; + TQString cmd = "sh -c \"/bin/echo -e '"; + for ( TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) { + TQString s = *it; s.replace("\""," "); s.replace("'"," "); s.replace("!"," "); @@ -525,8 +525,8 @@ void DEBAPT::writeApt(const QStringList &list) { cmd += "mv /etc/apt/sources.list /etc/apt/sources.list.b; mv /etc/apt/sources.list.n /etc/apt/sources.list; fi\" "; - QStringList rlist = kpty->run(cmd,TRUE,TRUE); - //for ( QStringList::Iterator it = rlist.begin(); it != rlist.end(); ++it ) { + TQStringList rlist = kpty->run(cmd,TRUE,TRUE); + //for ( TQStringList::Iterator it = rlist.begin(); it != rlist.end(); ++it ) { // kdDebug() << "SL=" << *it << "\n"; //} } diff --git a/kpackage/debAptInterface.h b/kpackage/debAptInterface.h index 71e52ea..2e23ac5 100644 --- a/kpackage/debAptInterface.h +++ b/kpackage/debAptInterface.h @@ -43,30 +43,30 @@ public: DEBAPT(); ~DEBAPT(); - virtual bool isType(char *buf, const QString &fname); + virtual bool isType(char *buf, const TQString &fname); - void listPackages(QPtrList<packageInfo> *pki); - QStringList listInstalls(const QStringList &packs, bool install, bool &cancel); + void listPackages(TQPtrList<packageInfo> *pki); + TQStringList listInstalls(const TQStringList &packs, bool install, bool &cancel); - QString doUninstall(int uninstallFlags, const QString &packs, bool &test); - QString doInstall(int installFlags, const QString &packs, bool &test); - QString install(int installFlags, QPtrList<packageInfo> *p, + TQString doUninstall(int uninstallFlags, const TQString &packs, bool &test); + TQString doInstall(int installFlags, const TQString &packs, bool &test); + TQString install(int installFlags, TQPtrList<packageInfo> *p, bool &test); - virtual QStringList FindFile(const QString &name, bool seachAll=false); + virtual TQStringList FindFile(const TQString &name, bool seachAll=false); - void listRemotePackages(QPtrList<packageInfo> *pki); - QStringList getFileList(packageInfo *p); + void listRemotePackages(TQPtrList<packageInfo> *pki); + TQStringList getFileList(packageInfo *p); KAction *updateM, *upgradeM, *fixupM, *fileM; void makeMenu(KActionCollection* act); void setMenu(KActionCollection* act, bool enable); - QStringList readApt(); - QStringList readAptS(); - QStringList readAptF(); - void writeApt(const QStringList &list); + TQStringList readApt(); + TQStringList readAptS(); + TQStringList readAptF(); + void writeApt(const TQStringList &list); private slots: void updateS(); @@ -75,10 +75,10 @@ private slots: void fileS(); private: - void listAvail(QPtrList<packageInfo> *pki); - void listRPack(QPtrList<packageInfo> *pki); - QStringList getRFileList(packageInfo *p); + void listAvail(TQPtrList<packageInfo> *pki); + void listRPack(TQPtrList<packageInfo> *pki); + TQStringList getRFileList(packageInfo *p); - QString env; + TQString env; }; #endif diff --git a/kpackage/debDpkgInterface.cpp b/kpackage/debDpkgInterface.cpp index 896bdfb..a1c4504 100644 --- a/kpackage/debDpkgInterface.cpp +++ b/kpackage/debDpkgInterface.cpp @@ -77,8 +77,8 @@ DEBDPKG::DEBDPKG():DEB() locatedialog->dLocations(2, 6, this, i18n("Folders", "F"), "Deb", "*.deb", i18n("Location of Folders Containing Debian Packages")); - connect(locatedialog,SIGNAL(returnVal(LcacheObj *)), - this,SLOT(setAvail(LcacheObj *))); + connect(locatedialog,TQT_SIGNAL(returnVal(LcacheObj *)), + this,TQT_SLOT(setAvail(LcacheObj *))); locatedialog->apply_slot(); paramsInst.append(new param(i18n("Allow Downgrade"),TRUE,TRUE,"--refuse-downgrade")); @@ -102,27 +102,27 @@ DEBDPKG::~DEBDPKG() } ////////////////////////////////////////////////////////////////////////////// -void DEBDPKG::distPackages(QPtrList<packageInfo> *pki, cacheObj *cp) +void DEBDPKG::distPackages(TQPtrList<packageInfo> *pki, cacheObj *cp) { LcacheObj *cList = new LcacheObj(); - QString loc = cp->base; + TQString loc = cp->base; - QStringList opt = QStringList::split('\n',cp->option); - QStringList::Iterator ocIt = opt.begin(); - QString rel = *ocIt; - QString arch = *(++ocIt); + TQStringList opt = TQStringList::split('\n',cp->option); + TQStringList::Iterator ocIt = opt.begin(); + TQString rel = *ocIt; + TQString arch = *(++ocIt); - QString parts[3] = {"main", "contrib", "non-free"}; + TQString parts[3] = {"main", "contrib", "non-free"}; for (int i = 0; i < 3; i++) { - QString file = loc + "/dists/"; + TQString file = loc + "/dists/"; file += rel; file += "/"; file += parts[i]; file += "/binary-"; file += arch; file += "/Packages"; - QString s; - QString tmp = cp->cacheFile; + TQString s; + TQString tmp = cp->cacheFile; tmp += s.setNum(i); cacheObj *cp = new cacheObj(loc,file,tmp); cList->append(cp); @@ -131,7 +131,7 @@ void DEBDPKG::distPackages(QPtrList<packageInfo> *pki, cacheObj *cp) listUnIPackages(pki, cList); } -void DEBDPKG::listPackages(QPtrList<packageInfo> *pki) +void DEBDPKG::listPackages(TQPtrList<packageInfo> *pki) { listInstalledPackages(pki); if (packageLoc) { @@ -146,9 +146,9 @@ void DEBDPKG::listPackages(QPtrList<packageInfo> *pki) // Call the script to uninstall packages setting parameters // to dpkg dependent on flags, returning whether everyting worked ////////////////////////////////////////////////////////////////////////////// -QString DEBDPKG::doUninstall(int uninstallFlags, const QString &packs, bool &test) +TQString DEBDPKG::doUninstall(int uninstallFlags, const TQString &packs, bool &test) { - QString s = "dpkg "; + TQString s = "dpkg "; // The -r or -p flag is set by setOptions s += setOptions(uninstallFlags, paramsUninst); s += packs; diff --git a/kpackage/debDpkgInterface.h b/kpackage/debDpkgInterface.h index f65ccf0..fe9f422 100644 --- a/kpackage/debDpkgInterface.h +++ b/kpackage/debDpkgInterface.h @@ -43,19 +43,19 @@ public: DEBDPKG(); ~DEBDPKG(); - QString doUninstall(int installFlags, const QString &packs, bool &test); + TQString doUninstall(int installFlags, const TQString &packs, bool &test); - void listPackList(QPtrList<packageInfo> *pki, const QString &fname, + void listPackList(TQPtrList<packageInfo> *pki, const TQString &fname, cacheObj *cp); - void listPackages(QPtrList<packageInfo> *pki); - void distPackages(QPtrList<packageInfo> *pki, cacheObj *cp); + void listPackages(TQPtrList<packageInfo> *pki); + void distPackages(TQPtrList<packageInfo> *pki, cacheObj *cp); public slots: protected: - packageInfo *getIPackageInfo(const QString &name); - packageInfo *getUPackageInfo(const QString &name); + packageInfo *getIPackageInfo(const TQString &name); + packageInfo *getUPackageInfo(const TQString &name); }; diff --git a/kpackage/debInterface.cpp b/kpackage/debInterface.cpp index 4c79485..41146fe 100644 --- a/kpackage/debInterface.cpp +++ b/kpackage/debInterface.cpp @@ -78,7 +78,7 @@ DEB::~DEB() ////////////////////////////////////////////////////////////////////////////// // check if debian file -bool DEB::isType(char *buf, const QString &) +bool DEB::isType(char *buf, const TQString &) { if (hasProgram) { if (!strcmp(buf,"!<arch>\n")) { @@ -92,13 +92,13 @@ bool DEB::isType(char *buf, const QString &) } } -void DEB::distPackages(QPtrList<packageInfo> *, cacheObj *) +void DEB::distPackages(TQPtrList<packageInfo> *, cacheObj *) { } -void DEB::listUnIPackages(QPtrList<packageInfo> *pki, LcacheObj *pCache) +void DEB::listUnIPackages(TQPtrList<packageInfo> *pki, LcacheObj *pCache) { - QString s; + TQString s; cacheObj *cp; for (cp = pCache->first(); cp != 0; cp = pCache->next()) { @@ -119,7 +119,7 @@ void DEB::listUnIPackages(QPtrList<packageInfo> *pki, LcacheObj *pCache) } } -bool DEB::parseName(const QString &name, QString *n, QString *v) +bool DEB::parseName(const TQString &name, TQString *n, TQString *v) { int d1, d2, s1; @@ -138,17 +138,17 @@ bool DEB::parseName(const QString &name, QString *n, QString *v) return FALSE; } -void DEB::listInstalledPackages(QPtrList<packageInfo> *pki) +void DEB::listInstalledPackages(TQPtrList<packageInfo> *pki) { listPackList(pki,STATUS,0); } -void DEB::listPackList(QPtrList<packageInfo> *pki, const QString &fname, cacheObj *cp) +void DEB::listPackList(TQPtrList<packageInfo> *pki, const TQString &fname, cacheObj *cp) { bool local = FALSE; packageInfo *p; - QStringList list; - QString sline( i18n("Querying DEB package list: ")+fname ); + TQStringList list; + TQString sline( i18n("Querying DEB package list: ")+fname ); if (cp) { KURL u(cp->base); @@ -158,12 +158,12 @@ void DEB::listPackList(QPtrList<packageInfo> *pki, const QString &fname, cacheOb kpackage->setStatus(sline); kpackage->setPercent(0); - QFile file(STATUS); - QString s; + TQFile file(STATUS); + TQString s; bool fileOpened= file.open(IO_ReadOnly); if (fileOpened) { - QTextStream stream( &file ); + TQTextStream stream( &file ); s = ""; while ( !s.isNull() ) { s = stream.readLine(); @@ -190,7 +190,7 @@ void DEB::listPackList(QPtrList<packageInfo> *pki, const QString &fname, cacheOb ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -packageInfo *DEB::getPackageInfo(char mode, const QString &name, const QString &) +packageInfo *DEB::getPackageInfo(char mode, const TQString &name, const TQString &) { if (mode == 'i') { if (hostName.isEmpty()) { @@ -202,19 +202,19 @@ packageInfo *DEB::getPackageInfo(char mode, const QString &name, const QString & return getUPackageInfo(name); } -packageInfo *DEB::getIPackageInfo( const QString &name) +packageInfo *DEB::getIPackageInfo( const TQString &name) { // query an installed package! packageInfo *pki = 0; - QString search; - QStringList list; + TQString search; + TQStringList list; search = "Package: "+ name; - QFile f(STATUS); + TQFile f(STATUS); if ( f.open(IO_ReadOnly) ) { - QTextStream t( &f ); - QString s; + TQTextStream t( &f ); + TQString s; while ( !t.eof() ) { s = t.readLine(); @@ -238,15 +238,15 @@ packageInfo *DEB::getIPackageInfo( const QString &name) return pki; } -packageInfo *DEB::getIRPackageInfo( const QString &name) +packageInfo *DEB::getIRPackageInfo( const TQString &name) { // query an remote installed package packageInfo *pki = 0; - QString s = "dpkg --status "; + TQString s = "dpkg --status "; s += name; - QStringList list = kpty->run(s); - for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { + TQStringList list = kpty->run(s); + for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { // kdDebug() << "U=" << *it << "\n"; if ((*it).find("Package:") >= 0) { kdDebug() << "found\n"; @@ -269,16 +269,16 @@ packageInfo *DEB::getIRPackageInfo( const QString &name) return pki; } -packageInfo *DEB::getUPackageInfo( const QString &name) +packageInfo *DEB::getUPackageInfo( const TQString &name) { // query an uninstalled package packageInfo *pki = 0; - QString s = "dpkg --info "; + TQString s = "dpkg --info "; s += KProcess::quote(name); - QStringList list = kpty->run(s); - for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { + TQStringList list = kpty->run(s); + for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { // kdDebug() << "U=" << *it << "\n"; if ((*it).find("Package:") >= 0) { // kdDebug() << "found\n"; @@ -301,20 +301,20 @@ packageInfo *DEB::getUPackageInfo( const QString &name) ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -packageInfo *DEB::collectInfo(QStringList &ln, pkgInterface *pkgInt) +packageInfo *DEB::collectInfo(TQStringList &ln, pkgInterface *pkgInt) { if (!pkgInt) { pkgInt = this; } - QMap<QString, QString> a; + TQMap<TQString, TQString> a; - QString key, val; + TQString key, val; bool bad_install = FALSE; bool available = FALSE; bool haveName = FALSE; - for ( QStringList::Iterator it = ln.begin(); it != ln.end(); ++it ) { + for ( TQStringList::Iterator it = ln.begin(); it != ln.end(); ++it ) { loop: int col = (*it).find(':'); key = ((*it).left(col)).lower(); @@ -334,7 +334,7 @@ packageInfo *DEB::collectInfo(QStringList &ln, pkgInterface *pkgInt) } } else if (key == "description") { a.insert("summary", val); - QString desc; + TQString desc; while (++it != ln.end()) { if ((*it)[0] == ' ') { desc += *it; @@ -394,19 +394,19 @@ packageInfo *DEB::collectInfo(QStringList &ln, pkgInterface *pkgInt) ////////////////////////////////////////////////////////////////////////////// -QStringList DEB::getChangeLog(packageInfo *p) { - QString fn( p->getFilename()); +TQStringList DEB::getChangeLog(packageInfo *p) { + TQString fn( p->getFilename()); if(!fn.isEmpty()) return 0; else return getIChangeLog(p); } -QStringList DEB::getIChangeLog(packageInfo *p) +TQStringList DEB::getIChangeLog(packageInfo *p) { - QString from; - QStringList ret; - QString name = p->getProperty("name"); + TQString from; + TQStringList ret; + TQString name = p->getProperty("name"); from = "zcat /usr/share/doc/"; from += name; @@ -447,9 +447,9 @@ bool DEB::changeTab(packageInfo *p) { ////////////////////////////////////////////////////////////////////////////// -QStringList DEB::getFileList(packageInfo *p) +TQStringList DEB::getFileList(packageInfo *p) { - QString fn( p->getFilename()); + TQString fn( p->getFilename()); if(!fn.isEmpty()) return getUFileList(fn); else @@ -457,13 +457,13 @@ QStringList DEB::getFileList(packageInfo *p) } // query an installed package -QStringList DEB::getIFileList(packageInfo *p) +TQStringList DEB::getIFileList(packageInfo *p) { FILE *file; - QString name = p->getProperty("name"); - QStringList filelist; + TQString name = p->getProperty("name"); + TQStringList filelist; - QString vb( INFODIR + name + ".list"); + TQString vb( INFODIR + name + ".list"); file= fopen(vb.ascii(),"r"); if (file) { @@ -478,17 +478,17 @@ QStringList DEB::getIFileList(packageInfo *p) } // query an uninstalled package -QStringList DEB::getUFileList(const QString &fn) +TQStringList DEB::getUFileList(const TQString &fn) { - QString s = "dpkg --contents "; + TQString s = "dpkg --contents "; s += "'"; s += fn; s += "'"; - QStringList filelist = kpty->run(s); + TQStringList filelist = kpty->run(s); int pt = -1; - for ( QStringList::Iterator it = filelist.begin(); + for ( TQStringList::Iterator it = filelist.begin(); it != filelist.end(); ++it ) { // kdDebug() << "F=" << *it << "\n"; if (pt < 0) { @@ -501,21 +501,21 @@ QStringList DEB::getUFileList(const QString &fn) ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -QStringList DEB::FindFile(const QString &name, bool) +TQStringList DEB::FindFile(const TQString &name, bool) { - QString s = "dpkg -S "; + TQString s = "dpkg -S "; s += name; - QStringList filelist = kpty->run(s); + TQStringList filelist = kpty->run(s); - for ( QStringList::Iterator it = filelist.begin(); it != filelist.end(); ++it ) { + for ( TQStringList::Iterator it = filelist.begin(); it != filelist.end(); ++it ) { int p = (*it).find(": "); if( p !=-1 ) (*it).replace(p, 2, "\t"); } if (filelist.count() == 1) { - QStringList::Iterator it = filelist.begin(); + TQStringList::Iterator it = filelist.begin(); if ((*it).find("not found") >= 0) { filelist.remove(it); } @@ -543,10 +543,10 @@ void DEB::setAvail(LcacheObj *slist) ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -QString DEB::uninstall(int uninstallFlags, QPtrList<packageInfo> *p, +TQString DEB::uninstall(int uninstallFlags, TQPtrList<packageInfo> *p, bool &test) { - QString packs = ""; + TQString packs = ""; packageInfo *i; for (i = p->first(); i!= 0; i = p->next()) { @@ -557,14 +557,14 @@ QString DEB::uninstall(int uninstallFlags, QPtrList<packageInfo> *p, } ////////////////////////////////////////////////////////////////////////////// -QString DEB::install(int installFlags, QPtrList<packageInfo> *p, +TQString DEB::install(int installFlags, TQPtrList<packageInfo> *p, bool &test) { - QString packs = ""; + TQString packs = ""; packageInfo *i; for (i = p->first(); i!= 0; i = p->next()) { - QString fname = i->fetchFilename(); + TQString fname = i->fetchFilename(); if (!fname.isEmpty()) { packs += KProcess::quote(fname); packs += " "; @@ -579,9 +579,9 @@ QString DEB::install(int installFlags, QPtrList<packageInfo> *p, ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -QString DEB::doInstall(int installFlags, const QString &packs, bool &test) +TQString DEB::doInstall(int installFlags, const TQString &packs, bool &test) { - QString s = "dpkg -i "; + TQString s = "dpkg -i "; s += setOptions(installFlags, paramsInst); s += packs; diff --git a/kpackage/debInterface.h b/kpackage/debInterface.h index 98307f8..9cc450d 100644 --- a/kpackage/debInterface.h +++ b/kpackage/debInterface.h @@ -30,12 +30,12 @@ #include "../config.h" -#include <qptrlist.h> -#include <qdir.h> -#include <qfile.h> -#include <qfileinfo.h> -#include <qtextstream.h> -#include <qstringlist.h> +#include <tqptrlist.h> +#include <tqdir.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqtextstream.h> +#include <tqstringlist.h> #include <kprocess.h> @@ -59,12 +59,12 @@ public: DEB(); ~DEB(); - virtual bool isType(char *buf, const QString &fname); + virtual bool isType(char *buf, const TQString &fname); - virtual packageInfo *getPackageInfo(char mode, const QString &name, - const QString &version); - virtual QStringList getFileList(packageInfo *p); - virtual QStringList getChangeLog(packageInfo *p); + virtual packageInfo *getPackageInfo(char mode, const TQString &name, + const TQString &version); + virtual TQStringList getFileList(packageInfo *p); + virtual TQStringList getChangeLog(packageInfo *p); bool filesTab(packageInfo *p); // If files tab is to be enabled @@ -72,38 +72,38 @@ public: bool changeTab(packageInfo *p); // If change log tab is to be enabled - virtual void listInstalledPackages(QPtrList<packageInfo> *pki); + virtual void listInstalledPackages(TQPtrList<packageInfo> *pki); - virtual QStringList FindFile(const QString &name, bool seachAll=false); - virtual bool parseName(const QString &name, QString *n, QString *v); + virtual TQStringList FindFile(const TQString &name, bool seachAll=false); + virtual bool parseName(const TQString &name, TQString *n, TQString *v); - virtual packageInfo* collectInfo(QStringList &ln, pkgInterface *pkgInt = 0); + virtual packageInfo* collectInfo(TQStringList &ln, pkgInterface *pkgInt = 0); - QString uninstall(int uninstallFlags, QPtrList<packageInfo> *p, + TQString uninstall(int uninstallFlags, TQPtrList<packageInfo> *p, bool &test); - QString install(int installFlags, QPtrList<packageInfo> *p, + TQString install(int installFlags, TQPtrList<packageInfo> *p, bool &test); - QString doInstall(int installFlags, const QString &packs, bool &test); + TQString doInstall(int installFlags, const TQString &packs, bool &test); public slots: void setLocation(); void setAvail(LcacheObj *); protected: - packageInfo *getIPackageInfo(const QString &name); - packageInfo *getIRPackageInfo(const QString &name); - packageInfo *getUPackageInfo(const QString &name); + packageInfo *getIPackageInfo(const TQString &name); + packageInfo *getIRPackageInfo(const TQString &name); + packageInfo *getUPackageInfo(const TQString &name); - QStringList getIChangeLog(packageInfo *p); + TQStringList getIChangeLog(packageInfo *p); - void listPackList(QPtrList<packageInfo> *pki, - const QString &fname, cacheObj *cp); + void listPackList(TQPtrList<packageInfo> *pki, + const TQString &fname, cacheObj *cp); - virtual void distPackages(QPtrList<packageInfo> *pki, cacheObj *cp); - void listUnIPackages(QPtrList<packageInfo> *pki, LcacheObj *pCache); + virtual void distPackages(TQPtrList<packageInfo> *pki, cacheObj *cp); + void listUnIPackages(TQPtrList<packageInfo> *pki, LcacheObj *pCache); - QStringList getIFileList(packageInfo *p); - QStringList getUFileList(const QString &fn); + TQStringList getIFileList(packageInfo *p); + TQStringList getUFileList(const TQString &fn); }; #endif diff --git a/kpackage/fbsdInterface.cpp b/kpackage/fbsdInterface.cpp index 980ad36..8b5a6d6 100644 --- a/kpackage/fbsdInterface.cpp +++ b/kpackage/fbsdInterface.cpp @@ -35,7 +35,7 @@ #include <fcntl.h> #include <sys/utsname.h> -#include <qstringlist.h> +#include <tqstringlist.h> #include <klocale.h> #include <kglobal.h> @@ -66,7 +66,7 @@ fbsdInterface::fbsdInterface():pkgInterface() { packagePattern = "*.tgz *.tbz"; typeID = "/tbz"; - QDict <bsdPortsIndexItem> ports(17777, false); + TQDict <bsdPortsIndexItem> ports(17777, false); queryMsg = i18n("Querying package list: "); locatedialog = new Locations(i18n("Location of BSD Packages and Ports")); @@ -74,7 +74,7 @@ fbsdInterface::fbsdInterface():pkgInterface() { i18n("Location of Ports Tree (e.g. /usr/ports or /usr/opt)"),FALSE); locatedialog->dLocations(1, 6, this, i18n("Packages"), "Pkg", "*.tbz", i18n("Location of Folders Containing BSD Packages or Package Trees")); - connect(locatedialog, SIGNAL(returnVal(LcacheObj *)), this, SLOT(setAvail(LcacheObj *))); + connect(locatedialog, TQT_SIGNAL(returnVal(LcacheObj *)), this, TQT_SLOT(setAvail(LcacheObj *))); locatedialog->apply_slot(); paramsInst.append(new param(i18n("Ignore Scripts"),FALSE,FALSE,"-I")); @@ -92,11 +92,11 @@ fbsdInterface::~fbsdInterface() { } -bool fbsdInterface::isType(char *, const QString &fname) { +bool fbsdInterface::isType(char *, const TQString &fname) { // These files are .tgz or .tbz files. Pass it to pkg_info and see whether it // succeeds. if (hasProgram) { - QString cmd = PKG_INFO_BIN; // cmd += "_q"; + TQString cmd = PKG_INFO_BIN; // cmd += "_q"; cmd += " -q "; cmd += fname; kpty->run(cmd); @@ -110,23 +110,23 @@ bool fbsdInterface::isType(char *, const QString &fname) { } } -static void insertGroups(QMap<QString, QString> *a, QString cats) +static void insertGroups(TQMap<TQString, TQString> *a, TQString cats) { /* Create the list of groups (which is space-separated), and then ** iterate through it with the iterator i. count is just to ** distinguish the first entry (count==0) from the rest, since ** the key used in a->insert() needs to be different. */ - QStringList grlist = QStringList::split(' ',cats); + TQStringList grlist = TQStringList::split(' ',cats); unsigned int count = 0; - for (QStringList::Iterator i = grlist.begin(); + for (TQStringList::Iterator i = grlist.begin(); i != grlist.end(); ++count,++i) { a->insert( (count ? "also in" : "group"), *i); } } -packageInfo *fbsdInterface::getPackageInfo(char mode, const QString &pname, const QString &version) { - QString name( pname); +packageInfo *fbsdInterface::getPackageInfo(char mode, const TQString &pname, const TQString &version) { + TQString name( pname); bool installed = false; kpackage->setStatus(i18n("Getting package info")); @@ -136,14 +136,14 @@ packageInfo *fbsdInterface::getPackageInfo(char mode, const QString &pname, cons name += "-" + version; } - QMap<QString, QString> a; + TQMap<TQString, TQString> a; // Get the package name first (for mode = 'u'). if (mode == 'u') { - QString cmd = PKG_INFO_BIN; // cmd += "_qf"; + TQString cmd = PKG_INFO_BIN; // cmd += "_qf"; cmd += " -qf "; cmd += name; - QStringList list = kpty->run(cmd); + TQStringList list = kpty->run(cmd); int last_dir = name.find('/'); if (last_dir != -1) { @@ -155,10 +155,10 @@ packageInfo *fbsdInterface::getPackageInfo(char mode, const QString &pname, cons } if (list.count() > 0) { - for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { + for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { // Look for a line of the form '@name <pkgname>' if ((*it).left(5) == "@name") { - QString n = (*it).mid(6); + TQString n = (*it).mid(6); addNV(a, n); break; } @@ -169,19 +169,19 @@ packageInfo *fbsdInterface::getPackageInfo(char mode, const QString &pname, cons // Open a pipe to a pkg_info process in order to read the one line comment // and description for the package. This works for both installed packages // and for files. - QString cmd = PKG_INFO_BIN; // cmd += "_q"; + TQString cmd = PKG_INFO_BIN; // cmd += "_q"; cmd += " -q "; cmd += name; - QStringList list = kpty->run(cmd); + TQStringList list = kpty->run(cmd); - QStringList::Iterator it = list.begin(); + TQStringList::Iterator it = list.begin(); if (list.count() > 0) { - QStringList::Iterator it = list.begin(); + TQStringList::Iterator it = list.begin(); a["summary"] = *it; it++; - QString desc; + TQString desc; int prevlen = 0, len; for ( ; it != list.end(); ++it ) { len = (*it).length(); @@ -205,7 +205,7 @@ packageInfo *fbsdInterface::getPackageInfo(char mode, const QString &pname, cons } a["description"] = desc; } else { - kpackage->setStatus(QString::null); + kpackage->setStatus(TQString::null); return 0; } @@ -213,11 +213,11 @@ packageInfo *fbsdInterface::getPackageInfo(char mode, const QString &pname, cons ret->packageState = installed? packageInfo::INSTALLED : packageInfo::AVAILABLE; ret->fixup(); if (!installed) ret->smerge(typeID); - kpackage->setStatus(QString::null); + kpackage->setStatus(TQString::null); return ret; } -QStringList fbsdInterface::getChangeLog(packageInfo *) { +TQStringList fbsdInterface::getChangeLog(packageInfo *) { return 0; } @@ -230,32 +230,32 @@ bool fbsdInterface::changeTab(packageInfo *) { return FALSE; } -QStringList fbsdInterface::getFileList(packageInfo *p) { +TQStringList fbsdInterface::getFileList(packageInfo *p) { // Run pkg_info on the package name to get the file list. // The file list is returned on stdout, one per line. kpackage->setStatus(i18n("Getting file list")); - QStringList ret; + TQStringList ret; // Find the full name 'name-version', or just 'name' if version is empty. // Check first that it is actually installed. - QString name( p->getProperty("filename")); + TQString name( p->getProperty("filename")); if (!name.isEmpty() && (p->packageState != packageInfo::INSTALLED)) { - QString qbname( p->getProperty("base")); + TQString qbname( p->getProperty("base")); if (!qbname.isEmpty()) name = qbname + "/" + name; } else { if (!p->hasProperty("name")) { ret.append(i18n("Can't find package name!")); - kpackage->setStatus(QString::null); + kpackage->setStatus(TQString::null); return ret; } name = p->getProperty("name"); - QString version( p->getProperty("version")); + TQString version( p->getProperty("version")); if (!version.isEmpty()) { name = name + "-" + version; } @@ -263,24 +263,24 @@ QStringList fbsdInterface::getFileList(packageInfo *p) { // Open a pipe to a pkg_info process in order to read the file list. // This works for both installed packages and for files. - QString cmd = PKG_INFO_BIN; // cmd += "_Lq"; + TQString cmd = PKG_INFO_BIN; // cmd += "_Lq"; cmd += " -L -q "; cmd += name; - QStringList list = kpty->run(cmd); + TQStringList list = kpty->run(cmd); ret = list; - kpackage->setStatus(QString::null); + kpackage->setStatus(TQString::null); return ret; } -// QPtrList<char> *verify(packageInfo *p, QPtrList<char> *files); +// TQPtrList<char> *verify(packageInfo *p, TQPtrList<char> *files); -QString fbsdInterface::doUninstall(int uninstallFlags, const QString &packs, bool &) +TQString fbsdInterface::doUninstall(int uninstallFlags, const TQString &packs, bool &) { - QString s = PKG_DELETE_BIN; + TQString s = PKG_DELETE_BIN; s += " "; s += setOptions(uninstallFlags, paramsUninst); s += packs; @@ -291,10 +291,10 @@ QString fbsdInterface::doUninstall(int uninstallFlags, const QString &packs, boo } -QString fbsdInterface::doInstall(int installFlags, const QString &packs, bool &) +TQString fbsdInterface::doInstall(int installFlags, const TQString &packs, bool &) { - QString s = PKG_ADD_BIN; + TQString s = PKG_ADD_BIN; s += " "; s += setOptions(installFlags, paramsInst); s += packs; @@ -304,35 +304,35 @@ QString fbsdInterface::doInstall(int installFlags, const QString &packs, bool &) return s; } -QString fbsdInterface::uninstall(int uninstallFlags, packageInfo *p, bool &test) +TQString fbsdInterface::uninstall(int uninstallFlags, packageInfo *p, bool &test) { - QString packs( p->getProperty("name")); - QString vers( p->getProperty("version")); + TQString packs( p->getProperty("name")); + TQString vers( p->getProperty("version")); if (vers.length() > 0) packs += "-" + vers; return doUninstall(uninstallFlags, packs, test); } -QString fbsdInterface::uninstall(int uninstallFlags, QPtrList<packageInfo> *p, bool &test) +TQString fbsdInterface::uninstall(int uninstallFlags, TQPtrList<packageInfo> *p, bool &test) { - QString packs ; + TQString packs ; packageInfo *i; for (i = p->first(); i!= 0; i = p->next()) { packs += i->getProperty("name"); - QString vers( i->getProperty("version")); + TQString vers( i->getProperty("version")); if (vers.length() != 0) packs += "-" + vers; packs += " "; } return doUninstall( uninstallFlags, packs, test); } -QStringList fbsdInterface::FindFile(const QString &, bool) { - QStringList tmp; +TQStringList fbsdInterface::FindFile(const TQString &, bool) { + TQStringList tmp; return tmp; } -bool fbsdInterface::parseName(const QString &name, QString *n, QString *v) { +bool fbsdInterface::parseName(const TQString &name, TQString *n, TQString *v) { int m1; m1 = name.findRev('-'); @@ -342,12 +342,12 @@ bool fbsdInterface::parseName(const QString &name, QString *n, QString *v) { return true; } -void fbsdInterface::addNV(QMap<QString, QString> &d, const QString &name) { - QString n, v; +void fbsdInterface::addNV(TQMap<TQString, TQString> &d, const TQString &name) { + TQString n, v; if (!parseName(name, &n, &v)) { n = name; - v = QString::null; + v = TQString::null; } d.insert("name", n); @@ -369,10 +369,10 @@ void fbsdInterface::setAvail(LcacheObj *slist) { if (cp && !cp->location.isEmpty()) { for (; cp != 0; cp = packageLoc->next()) { - QString oldloc = cp->location; + TQString oldloc = cp->location; cp->location += "/INDEX"; - QString s = getPackList(cp); - if (!s.isEmpty()) bsdPortsIndexItem::processFile(this, QFile::encodeName(s), true, oldloc); + TQString s = getPackList(cp); + if (!s.isEmpty()) bsdPortsIndexItem::processFile(this, TQFile::encodeName(s), true, oldloc); cp->location = oldloc; } } @@ -380,7 +380,7 @@ void fbsdInterface::setAvail(LcacheObj *slist) { // Try /usr/port/INDEX-<major version> on FreeBSD struct utsname fbsdName; if(uname(&fbsdName) != -1 && !strcmp(fbsdName.sysname, "FreeBSD")) - bsdPortsIndexItem::processFile(this, QString("/usr/ports/INDEX-").append(*fbsdName.release), false, "/usr/ports"); + bsdPortsIndexItem::processFile(this, TQString("/usr/ports/INDEX-").append(*fbsdName.release), false, "/usr/ports"); // Try the standard ports tree locations. bsdPortsIndexItem::processFile(this, "/usr/ports/INDEX", false, "/usr/ports"); // FreeBSD/OpenBSD @@ -388,17 +388,17 @@ void fbsdInterface::setAvail(LcacheObj *slist) { } -void fbsdInterface::listPackages(QPtrList<packageInfo> *pki) { +void fbsdInterface::listPackages(TQPtrList<packageInfo> *pki) { kdDebug() << k_funcinfo << endl; listInstalledPackages(pki); - QDictIterator<bsdPortsIndexItem> it( ports ); // See QDictIterator + TQDictIterator<bsdPortsIndexItem> it( ports ); // See QDictIterator for( ; it.current(); ++it ) { bsdPortsIndexItem *scan = it.current(); if (!scan->installed /*&& scan->bin */) { - QMap<QString, QString> a; + TQMap<TQString, TQString> a; addNV(a, scan->fields[bsdPortsIndexItem::NAME]); a["summary"] = scan->fields[bsdPortsIndexItem::COMMENT]; @@ -424,7 +424,7 @@ void fbsdInterface::listPackages(QPtrList<packageInfo> *pki) { } -int fbsdInterface::parseItem(QStringList::Iterator &it, QString &name, QString &value, QString separator, QStringList list ) { +int fbsdInterface::parseItem(TQStringList::Iterator &it, TQString &name, TQString &value, TQString separator, TQStringList list ) { if ((*it).left(separator.length()) == separator) { name = *it; name = name.mid(separator.length()); @@ -450,11 +450,11 @@ int fbsdInterface::parseItem(QStringList::Iterator &it, QString &name, QString & return 1; } -int fbsdInterface::pathInfo(QMap<QString, QString> &a) +int fbsdInterface::pathInfo(TQMap<TQString, TQString> &a) { int pkg_state = packageInfo::INSTALLED; if (a["group"].isEmpty()) { - QString s, ps; + TQString s, ps; ps = a["name"]; if (ps.isEmpty()) s = ps; @@ -463,22 +463,22 @@ int fbsdInterface::pathInfo(QMap<QString, QString> &a) ps = a["version"]; if (!ps.isEmpty()) - s.append(QString("-")+(ps)); + s.append(TQString("-")+(ps)); kdDebug() << "Package " << (s) << " has no group." << endl; /* This must be an installed package with no INDEX entry, ** which usually means that the port has been updated. */ - QString cmd = PKG_INFO_BIN; + TQString cmd = PKG_INFO_BIN; // cmd += "2"; cmd += " -ol "; cmd += INFO_SEPARATOR; - QStringList list = kpty->run(cmd); + TQStringList list = kpty->run(cmd); if (list.count() > 0) { - QStringList::Iterator it = list.begin(); - QString name, value; + TQStringList::Iterator it = list.begin(); + TQString name, value; parseItem(it, name, value, INFO_SEPARATOR, list); // Information parseItem(it, name, value, INFO_SEPARATOR, list); // Path @@ -492,7 +492,7 @@ int fbsdInterface::pathInfo(QMap<QString, QString> &a) return pkg_state; } - void fbsdInterface::listInstalledPackages(QPtrList<packageInfo> *pki) { + void fbsdInterface::listInstalledPackages(TQPtrList<packageInfo> *pki) { kdDebug() << k_funcinfo << endl; // Open a pipe to a pkg_info process in order to read the comment, name @@ -500,10 +500,10 @@ int fbsdInterface::pathInfo(QMap<QString, QString> &a) kpackage->setStatus(i18n("Querying BSD packages database for installed packages")); - QString cmd = PKG_INFO_BIN; + TQString cmd = PKG_INFO_BIN; cmd += " -acdl "; cmd += INFO_SEPARATOR; - QStringList list = kpty->run(cmd); + TQStringList list = kpty->run(cmd); // We should now get: // INFO_SEPARATORInformation for pkgname: @@ -518,17 +518,17 @@ int fbsdInterface::pathInfo(QMap<QString, QString> &a) // INFO_SEPARATOR // INFO_SEPARATORInformation for [etc] - QMap<QString, QString> a; - QString name, value; + TQMap<TQString, TQString> a; + TQString name, value; if (list.count() > 0) { - for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { + for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { parseItem(it, name, value, INFO_SEPARATOR, list); // Information // Find the last word on this line (which should be the package name) minus a trailing :. - QString pkg = name.section(' ',-1); + TQString pkg = name.section(' ',-1); if (pkg.isEmpty()) { KpMsgE(i18n("Unexpected output from pkg_info (looking for package name): %1").arg(value), TRUE); - kpackage->setStatus(QString::null); + kpackage->setStatus(TQString::null); return; } else { if (pkg[pkg.length()-1] == ':') { @@ -577,16 +577,16 @@ int fbsdInterface::pathInfo(QMap<QString, QString> &a) } -bsdPortsIndexItem::bsdPortsIndexItem(fbsdInterface *parent, char *desc, bool binaries, const QString &dname) : bin(binaries), port(!binaries), installed(false) { - fields = QStringList::split('|', desc, TRUE); - QString name = fields[NAME]; +bsdPortsIndexItem::bsdPortsIndexItem(fbsdInterface *parent, char *desc, bool binaries, const TQString &dname) : bin(binaries), port(!binaries), installed(false) { + fields = TQStringList::split('|', desc, TRUE); + TQString name = fields[NAME]; bsdPortsIndexItem *port = parent->ports[name]; if (port) { port->bin = port->bin || bin; port->port = port->port || port; if (binaries) { - port->bin_filename = QString(name) + ".tbz"; + port->bin_filename = TQString(name) + ".tbz"; port->bin_filename_base = dname + "/"; } fields[NAME] = ""; // Acts as a 'not used' tag. @@ -594,13 +594,13 @@ bsdPortsIndexItem::bsdPortsIndexItem(fbsdInterface *parent, char *desc, bool bin } if (binaries) { - bin_filename = QString(name) + ".tbz"; + bin_filename = TQString(name) + ".tbz"; bin_filename_base = dname + "/"; } } -void bsdPortsIndexItem::processFile(fbsdInterface *parent, const QString &fname, bool binaries, const QString &dname) { +void bsdPortsIndexItem::processFile(fbsdInterface *parent, const TQString &fname, bool binaries, const TQString &dname) { // Read the file in to a buffer and null terminate it. struct stat s; diff --git a/kpackage/fbsdInterface.h b/kpackage/fbsdInterface.h index 270b0c9..4966711 100644 --- a/kpackage/fbsdInterface.h +++ b/kpackage/fbsdInterface.h @@ -34,8 +34,8 @@ //#ifdef HAVE_FBSD_PKGTOOLS -#include <qptrlist.h> -#include <qmap.h> +#include <tqptrlist.h> +#include <tqmap.h> #include "packageInfo.h" #include "pkgInterface.h" @@ -54,11 +54,11 @@ public: void init(); - bool isType(char *buf, const QString &fname); + bool isType(char *buf, const TQString &fname); - packageInfo *getPackageInfo(char mode, const QString &name, const QString &version); - QStringList getFileList(packageInfo *p); - QStringList getChangeLog(packageInfo *p); + packageInfo *getPackageInfo(char mode, const TQString &name, const TQString &version); + TQStringList getFileList(packageInfo *p); + TQStringList getChangeLog(packageInfo *p); bool filesTab(packageInfo *p); // If files tab is to be enabled @@ -66,33 +66,33 @@ public: bool changeTab(packageInfo *p); // If change log tab is to be enabled - QString uninstall(int uninstallFlags, QPtrList<packageInfo> *p, bool &test); - QString uninstall(int uninstallFlags, packageInfo *p, bool &test); - QString doUninstall(int uninstallFlags, const QString &packs, bool &test); - QString doInstall(int installFlags, const QString &packs, bool &test); + TQString uninstall(int uninstallFlags, TQPtrList<packageInfo> *p, bool &test); + TQString uninstall(int uninstallFlags, packageInfo *p, bool &test); + TQString doUninstall(int uninstallFlags, const TQString &packs, bool &test); + TQString doInstall(int installFlags, const TQString &packs, bool &test); - QStringList FindFile(const QString &name, bool seachAll=false); - void collectDepends(packageInfo *p, const QString &name, int src); - bool parseName(const QString& name, QString *n, QString *v); + TQStringList FindFile(const TQString &name, bool seachAll=false); + void collectDepends(packageInfo *p, const TQString &name, int src); + bool parseName(const TQString& name, TQString *n, TQString *v); - void listInstalledPackages(QPtrList<packageInfo> *pki); - void listPackages(QPtrList<packageInfo> *pki); + void listInstalledPackages(TQPtrList<packageInfo> *pki); + void listPackages(TQPtrList<packageInfo> *pki); - QDict <bsdPortsIndexItem> ports; + TQDict <bsdPortsIndexItem> ports; public slots: void setLocation(); void setAvail(LcacheObj *); private: /** - * @short Add the name and version identifiers to a QMap<QString, QString>. + * @short Add the name and version identifiers to a TQMap<TQString, TQString>. * * name is parsed in to name and version and these are added to * d. Errors are handled. */ - void addNV(QMap<QString, QString> &d, const QString &name); - int parseItem(QStringList::Iterator &it, QString &name, QString &value, QString separator, QStringList list ); - int pathInfo(QMap<QString, QString> &a); + void addNV(TQMap<TQString, TQString> &d, const TQString &name); + int parseItem(TQStringList::Iterator &it, TQString &name, TQString &value, TQString separator, TQStringList list ); + int pathInfo(TQMap<TQString, TQString> &a); }; @@ -117,7 +117,7 @@ public: * * dname is the name of the base directory of this ports/packages tree. */ - bsdPortsIndexItem(fbsdInterface *parent, char *desc, bool binaries, const QString &dname); + bsdPortsIndexItem(fbsdInterface *parent, char *desc, bool binaries, const TQString &dname); /** @short true if this has a binary packages. */ bool bin; @@ -131,13 +131,13 @@ public: /** @short The next item in this linked list */ bsdPortsIndexItem *next; - QStringList fields; + TQStringList fields; enum {NAME=0, PATH, PREFIX, COMMENT, DESC_PATH, MAINT, CATS, BDEPS, RDEPS}; - QString bin_filename; - QString bin_filename_base; - QString port_dirname; + TQString bin_filename; + TQString bin_filename_base; + TQString port_dirname; /** * @short Given the path to an INDEX file process each port in it. @@ -145,7 +145,7 @@ public: * binaries should be true if the file is an index for packages, false for ports. * dname is the base directory. */ - static void processFile(fbsdInterface *parent, const QString &fname, bool binaries, const QString &dname); + static void processFile(fbsdInterface *parent, const TQString &fname, bool binaries, const TQString &dname); private: unsigned int name_hash; diff --git a/kpackage/findf.cpp b/kpackage/findf.cpp index 20e6a7c..9b51944 100644 --- a/kpackage/findf.cpp +++ b/kpackage/findf.cpp @@ -26,8 +26,8 @@ #include "../config.h" -#include <qlineedit.h> -#include <qpainter.h> +#include <tqlineedit.h> +#include <tqpainter.h> #include <klocale.h> #include <kdebug.h> @@ -43,7 +43,7 @@ extern pkgInterface *kpinterface[]; extern Opts *opts; -FindF::FindF(QWidget *parent) +FindF::FindF(TQWidget *parent) : KDialogBase(parent, "find_file", false, i18n("Find File"), User1 | Close, User1, true, @@ -51,28 +51,28 @@ FindF::FindF(QWidget *parent) { tick = UserIcon("ptick"); - QFrame *page = makeMainWidget(); + TQFrame *page = makeMainWidget(); - setFocusPolicy(QWidget::StrongFocus); + setFocusPolicy(TQWidget::StrongFocus); - QVBoxLayout* vtop = new QVBoxLayout( page, 10, 10, "vtop"); - QFrame *frame1 = new QGroupBox(i18n("Find Package"), page, "frame1"); + TQVBoxLayout* vtop = new TQVBoxLayout( page, 10, 10, "vtop"); + TQFrame *frame1 = new TQGroupBox(i18n("Find Package"), page, "frame1"); vtop->addWidget(frame1,1); - QGridLayout* gtop = new QGridLayout( frame1, 1, 1, 20 ); + TQGridLayout* gtop = new TQGridLayout( frame1, 1, 1, 20 ); // gtop->setMargin( KDialog::marginHint() ); gtop->setSpacing( KDialog::spacingHint() ); - value = new QLineEdit( frame1, "value" ); - connect(value,SIGNAL(textChanged ( const QString & )),this,SLOT(textChanged ( const QString & ))); + value = new TQLineEdit( frame1, "value" ); + connect(value,TQT_SIGNAL(textChanged ( const TQString & )),this,TQT_SLOT(textChanged ( const TQString & ))); value->setFocus(); - QLabel *valueLabel = new QLabel(value, i18n("Find:"), frame1); + TQLabel *valueLabel = new TQLabel(value, i18n("Find:"), frame1); valueLabel->setAlignment( AlignRight ); tab = new KListView(frame1, "tab"); - connect(tab, SIGNAL(selectionChanged ( QListViewItem * )), - this, SLOT(search( QListViewItem * ))); + connect(tab, TQT_SIGNAL(selectionChanged ( TQListViewItem * )), + this, TQT_SLOT(search( TQListViewItem * ))); tab->addColumn(i18n("Installed"),18); tab->addColumn(i18n("Type"),110); tab->addColumn("",0); // Hidden column for package type @@ -82,9 +82,9 @@ FindF::FindF(QWidget *parent) tab->setSorting(1); if (kpackage->management->dirInstPackages->find("apt-file/deb")) { - searchAll = new QCheckBox(i18n("Also search uninstalled packages"), frame1, "searchAll"); + searchAll = new TQCheckBox(i18n("Also search uninstalled packages"), frame1, "searchAll"); } else { - searchAll = new QCheckBox(i18n("Also search uninstalled packages (apt-file needs to be installed)"), frame1, "searchAll"); + searchAll = new TQCheckBox(i18n("Also search uninstalled packages (apt-file needs to be installed)"), frame1, "searchAll"); } searchAll->setChecked(FALSE); @@ -94,8 +94,8 @@ FindF::FindF(QWidget *parent) gtop->addWidget(searchAll, 2, 0); - connect(this, SIGNAL(user1Clicked()), this, SLOT(ok_slot())); - connect(this, SIGNAL(closeClicked()), this, SLOT(done_slot())); + connect(this, TQT_SIGNAL(user1Clicked()), this, TQT_SLOT(ok_slot())); + connect(this, TQT_SIGNAL(closeClicked()), this, TQT_SLOT(done_slot())); enableButton(User1 , false); show(); @@ -121,7 +121,7 @@ void FindF::checkSearchAll() searchAll->setEnabled(hasAll); } -void FindF::textChanged ( const QString & text) +void FindF::textChanged ( const TQString & text) { enableButton(User1 , !text.isEmpty()); } @@ -131,37 +131,37 @@ void FindF::ok_slot() doFind(value->text()); } -void FindF::doFind(const QString &str) +void FindF::doFind(const TQString &str) { - QString t; + TQString t; int i, cnt = 0; bool all = searchAll->isChecked(); - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); tab->clear(); for (i = 0; i < kpinterfaceN; i++) { if (kpinterface[i] && opts->handlePackage[i]) { - QStringList filelist = kpinterface[i]->FindFile(str, all); + TQStringList filelist = kpinterface[i]->FindFile(str, all); if (filelist.count() > 0) { cnt++; - for ( QStringList::Iterator it = filelist.begin(); it != filelist.end(); ++it ) { + for ( TQStringList::Iterator it = filelist.begin(); it != filelist.end(); ++it ) { if ((*it).find("diversion by") >= 0) { - new QListViewItem(tab, "", *it); + new TQListViewItem(tab, "", *it); } int t1 = (*it).find('\t'); - QString s1 = (*it).left(t1); - QString s2 = (*it).right((*it).length()-t1); + TQString s1 = (*it).left(t1); + TQString s2 = (*it).right((*it).length()-t1); s2 = s2.stripWhiteSpace(); - QListViewItem *ql = new QListViewItem(tab, "", kpinterface[i]->name, kpinterface[i]->head, s1, s2); + TQListViewItem *ql = new TQListViewItem(tab, "", kpinterface[i]->name, kpinterface[i]->head, s1, s2); - QString tx = s1 + kpinterface[i]->typeID; + TQString tx = s1 + kpinterface[i]->typeID; if (kpackage->management->dirInstPackages->find(tx)) { ql->setPixmap(0,tick); } @@ -171,10 +171,10 @@ void FindF::doFind(const QString &str) } if (!cnt) { - new QListViewItem(tab, "", i18n("--Nothing found--")); + new TQListViewItem(tab, "", i18n("--Nothing found--")); } - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } void FindF::done_slot() @@ -182,14 +182,14 @@ void FindF::done_slot() hide(); } -void FindF::resizeEvent(QResizeEvent *){ +void FindF::resizeEvent(TQResizeEvent *){ } -void FindF::search(QListViewItem *item) +void FindF::search(TQListViewItem *item) { int p; - QString s = item->text(3); + TQString s = item->text(3); s = s.stripWhiteSpace(); kdDebug() << "searchF=" << s << "\n"; @@ -203,12 +203,12 @@ void FindF::search(QListViewItem *item) kpackage->management->treeList->changePack(k); } -void FindF::dragEnterEvent(QDragEnterEvent* e) +void FindF::dragEnterEvent(TQDragEnterEvent* e) { e->accept(KURLDrag::canDecode(e)); } -void FindF::dropEvent(QDropEvent *de) // something has been dropped +void FindF::dropEvent(TQDropEvent *de) // something has been dropped { KURL::List list; if (!KURLDrag::decode(de, list) || list.isEmpty()) @@ -217,7 +217,7 @@ void FindF::dropEvent(QDropEvent *de) // something has been dropped const KURL &url = list.first(); if (url.isLocalFile()) { - QString file = url.path(-1); + TQString file = url.path(-1); value->setText(file); doFind(file); } else { diff --git a/kpackage/findf.h b/kpackage/findf.h index 5208c05..62b8a0e 100644 --- a/kpackage/findf.h +++ b/kpackage/findf.h @@ -34,14 +34,14 @@ #include <stdio.h> // Qt Headers -#include <qdir.h> -#include <qwidget.h> -#include <qframe.h> -#include <qlabel.h> -#include <qfiledialog.h> -#include <qgroupbox.h> -#include <qcheckbox.h> -#include <qlayout.h> +#include <tqdir.h> +#include <tqwidget.h> +#include <tqframe.h> +#include <tqlabel.h> +#include <tqfiledialog.h> +#include <tqgroupbox.h> +#include <tqcheckbox.h> +#include <tqlayout.h> // KDE headers #include <kapplication.h> @@ -55,26 +55,26 @@ class FindF : public KDialogBase public: - FindF ( QWidget *parent = 0); + FindF ( TQWidget *parent = 0); ~FindF(); - void resizeEvent(QResizeEvent *); - void dropEvent(QDropEvent *); - void dragEnterEvent(QDragEnterEvent* e); + void resizeEvent(TQResizeEvent *); + void dropEvent(TQDropEvent *); + void dragEnterEvent(TQDragEnterEvent* e); void checkSearchAll(); private: - void doFind(const QString &str); + void doFind(const TQString &str); // Do the actual search - QLineEdit *value; - QListView *tab; - QVBoxLayout* vl; - QVBoxLayout* vtop, vf; + TQLineEdit *value; + TQListView *tab; + TQVBoxLayout* vl; + TQVBoxLayout* vtop, vf; - QHBoxLayout* hb; - QCheckBox *searchAll; - QPixmap tick; + TQHBoxLayout* hb; + TQCheckBox *searchAll; + TQPixmap tick; signals: void findf_signal(); @@ -83,8 +83,8 @@ signals: public slots: void done_slot(); void ok_slot(); - void search(QListViewItem *); - void textChanged ( const QString & text); + void search(TQListViewItem *); + void textChanged ( const TQString & text); }; 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(); } diff --git a/kpackage/gentooInterface.h b/kpackage/gentooInterface.h index 12eaedb..1a99f56 100644 --- a/kpackage/gentooInterface.h +++ b/kpackage/gentooInterface.h @@ -31,12 +31,12 @@ public: Gentoo(); ~Gentoo(); - bool isType(char *buf, const QString &fname); + bool isType(char *buf, const TQString &fname); param *initinstallOptions(); param *inituninstallOptions(); - packageInfo *getPackageInfo(char mode, const QString &name, const QString &version); - QStringList getFileList(packageInfo *p); - QStringList getChangeLog(packageInfo *p); + packageInfo *getPackageInfo(char mode, const TQString &name, const TQString &version); + TQStringList getFileList(packageInfo *p); + TQStringList getChangeLog(packageInfo *p); bool filesTab(packageInfo *p); // If files tab is to be enabled @@ -44,24 +44,24 @@ public: bool changeTab(packageInfo *p); // If change log tab is to be enabled - QStringList FindFile(const QString &name, bool seachAll=false); - bool parseName(const QString& name, QString *n, QString *v); + TQStringList FindFile(const TQString &name, bool seachAll=false); + bool parseName(const TQString& name, TQString *n, TQString *v); public slots: void setLocation(); void setAvail(LcacheObj *); private: - packageInfo* collectInstalledInfo(const QString& name, const QString& category); - packageInfo* collectUninstalledInfo(const QString& name, const QString& category, const QString& version); - void listInstalledPackages(QPtrList<packageInfo> *pki); + packageInfo* collectInstalledInfo(const TQString& name, const TQString& category); + packageInfo* collectUninstalledInfo(const TQString& name, const TQString& category, const TQString& version); + void listInstalledPackages(TQPtrList<packageInfo> *pki); - QString install(int installFlags, QPtrList<packageInfo> *plist, bool &test); - QString uninstall(int uninstallFlags, QPtrList<packageInfo> *plist, bool &test); + TQString install(int installFlags, TQPtrList<packageInfo> *plist, bool &test); + TQString uninstall(int uninstallFlags, TQPtrList<packageInfo> *plist, bool &test); - QStringList archesPossible; - QString portageDir; - QStringList packageMask; + TQStringList archesPossible; + TQString portageDir; + TQStringList packageMask; }; diff --git a/kpackage/kio.cpp b/kpackage/kio.cpp index 1eb6f52..f11ed53 100644 --- a/kpackage/kio.cpp +++ b/kpackage/kio.cpp @@ -32,11 +32,11 @@ Kio::Kio() { } -bool Kio::download(const KURL & from, const QString & to) +bool Kio::download(const KURL & from, const TQString & to) { KIO::Job *iojob = KIO::file_copy(from, to); - connect( iojob, SIGNAL( result(KIO::Job*) ), - SLOT( slotIOJobFinished( KIO::Job* ))); + connect( iojob, TQT_SIGNAL( result(KIO::Job*) ), + TQT_SLOT( slotIOJobFinished( KIO::Job* ))); // missing modal widget hack here. // I'd recommend using KIO::NetAccess instead (David). kapp->enter_loop(); @@ -61,13 +61,13 @@ Kiod::~Kiod() delete fileT; } -bool Kiod::listDir(const QString &url, const QString &fname, bool subdirs) +bool Kiod::listDir(const TQString &url, const TQString &fname, bool subdirs) { delete file; - file = new QFile(fname); + file = new TQFile(fname); if (file->open(IO_WriteOnly)) { delete fileT; - fileT = new QTextStream(file); + fileT = new TQTextStream(file); KIO::ListJob *job; if (!subdirs) job = KIO::listDir( url ); @@ -76,10 +76,10 @@ bool Kiod::listDir(const QString &url, const QString &fname, bool subdirs) kdDebug() << "started " << job << " " << subdirs << endl; - QObject::connect( job, SIGNAL( entries( KIO::Job*, const KIO::UDSEntryList& ) ), - SLOT( slotListEntries( KIO::Job*, const KIO::UDSEntryList& ) ) ); - QObject::connect( job, SIGNAL( result( KIO::Job * ) ), - SLOT( slotFinished( KIO::Job* ) ) ); + TQObject::connect( job, TQT_SIGNAL( entries( KIO::Job*, const KIO::UDSEntryList& ) ), + TQT_SLOT( slotListEntries( KIO::Job*, const KIO::UDSEntryList& ) ) ); + TQObject::connect( job, TQT_SIGNAL( result( KIO::Job * ) ), + TQT_SLOT( slotFinished( KIO::Job* ) ) ); kapp->enter_loop(); @@ -95,7 +95,7 @@ bool Kiod::listDir(const QString &url, const QString &fname, bool subdirs) void Kiod::slotListEntries( KIO::Job *, const KIO::UDSEntryList& entries ) { long size = 0; - QString text; + TQString text; KIO::UDSEntryList::ConstIterator entryIt = entries.begin(); diff --git a/kpackage/kio.h b/kpackage/kio.h index 60614ea..6e3a414 100644 --- a/kpackage/kio.h +++ b/kpackage/kio.h @@ -31,9 +31,9 @@ #include <vector> -#include <qobject.h> -#include <qfile.h> -#include <qtextstream.h> +#include <tqobject.h> +#include <tqfile.h> +#include <tqtextstream.h> #include "../config.h" #include <kio/job.h> @@ -44,7 +44,7 @@ class Kio: public QObject public: Kio(); - bool download(const KURL & from, const QString & to); + bool download(const KURL & from, const TQString & to); private: bool worked; @@ -61,11 +61,11 @@ public: Kiod(); ~Kiod(); - bool listDir(const QString &url, const QString &fname, bool subdirs); + bool listDir(const TQString &url, const TQString &fname, bool subdirs); private: - QFile *file; - QTextStream *fileT; + TQFile *file; + TQTextStream *fileT; bool worked; private slots: diff --git a/kpackage/kissInterface.cpp b/kpackage/kissInterface.cpp index a568a18..29de45f 100644 --- a/kpackage/kissInterface.cpp +++ b/kpackage/kissInterface.cpp @@ -34,8 +34,8 @@ #include <setjmp.h> -#include <qdir.h> -#include <qfileinfo.h> +#include <tqdir.h> +#include <tqfileinfo.h> #include <kurl.h> #include <kglobal.h> @@ -74,8 +74,8 @@ KISS::KISS():pkgInterface() "KISS", "*.installer", i18n("Location of Folders Containing KISS Packages")); - connect(locatedialog,SIGNAL(returnVal(LcacheObj *)), - this,SLOT(setAvail(LcacheObj *))); + connect(locatedialog,TQT_SIGNAL(returnVal(LcacheObj *)), + this,TQT_SLOT(setAvail(LcacheObj *))); locatedialog->apply_slot(); queryMsg = i18n("Querying KISS package list: "); @@ -99,10 +99,10 @@ KISS::~KISS() ////////////////////////////////////////////////////////////////////////////// // check if kiss file -bool KISS::isType(char *buf, const QString &) +bool KISS::isType(char *buf, const TQString &) { if (hasProgram) { - QString tmp = buf; + TQString tmp = buf; if (tmp.find("perl",0,false) >= 0) return true; else @@ -112,7 +112,7 @@ bool KISS::isType(char *buf, const QString &) } } -bool KISS::parseName(const QString& name, QString *n, QString *v) +bool KISS::parseName(const TQString& name, TQString *n, TQString *v) { int d1, d2, s1; @@ -131,12 +131,12 @@ bool KISS::parseName(const QString& name, QString *n, QString *v) return FALSE; } -void KISS::listInstalledPackages(QPtrList<packageInfo> *pki) +void KISS::listInstalledPackages(TQPtrList<packageInfo> *pki) { - QString vb; + TQString vb; packageInfo *p; - QString sline = i18n("Querying KISS package list: "); + TQString sline = i18n("Querying KISS package list: "); reader.setup("kiss"); *reader.proc << "-qq"; @@ -167,10 +167,10 @@ void KISS::listInstalledPackages(QPtrList<packageInfo> *pki) ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// // mode: i = query installed u = query uninstalled -packageInfo *KISS::getPackageInfo(char mode, const QString &name, const QString &) +packageInfo *KISS::getPackageInfo(char mode, const TQString &name, const TQString &) { packageInfo *pki = 0; - QString vb,search; + TQString vb,search; switch(mode) { @@ -193,8 +193,8 @@ packageInfo *KISS::getPackageInfo(char mode, const QString &name, const QString if (reader.start(0,TRUE)) { pki = collectInfo(reader.buf.ascii()); - QFileInfo fi(name); - QString s; + TQFileInfo fi(name); + TQString s; s.setNum(fi.size()); pki->info.insert("file-size", s); } @@ -208,10 +208,10 @@ packageInfo *KISS::getPackageInfo(char mode, const QString &name, const QString ////////////////////////////////////////////////////////////////////////////// packageInfo *KISS::collectInfo(const char *_inp) { - QMap<QString, QString> a; + TQMap<TQString, TQString> a; char *str, *xstr; - QString qstr; + TQString qstr; char *inp = qstrdup(_inp); str = strtok(inp,"\n"); @@ -250,7 +250,7 @@ packageInfo *KISS::collectInfo(const char *_inp) } else if (!strcmp("size",str)) { a.insert("file-size", xstr); } else if (!strcmp("installed-size",str)) { - QString str = xstr; + TQString str = xstr; a.insert("size", str + "000"); } else { a.insert(str, xstr); @@ -269,7 +269,7 @@ packageInfo *KISS::collectInfo(const char *_inp) ////////////////////////////////////////////////////////////////////////////// -QStringList KISS::getChangeLog(packageInfo *) { +TQStringList KISS::getChangeLog(packageInfo *) { return 0; } @@ -283,10 +283,10 @@ bool KISS::changeTab(packageInfo *) { } ////////////////////////////////////////////////////////////////////////////// -QStringList KISS::getFileList(packageInfo *p) +TQStringList KISS::getFileList(packageInfo *p) { - QString vb, fn; - QString name; + TQString vb, fn; + TQString name; char mode; fn = p->getFilename(); @@ -295,7 +295,7 @@ QStringList KISS::getFileList(packageInfo *p) else mode = 'i'; - QStringList filelist; + TQStringList filelist; switch(mode) { @@ -343,9 +343,9 @@ QStringList KISS::getFileList(packageInfo *p) // Call the script to install packages setting parameters // to kiss dependent on flags ////////////////////////////////////////////////////////////////////////////// -QString KISS::uninstall(int uninstallFlags, QPtrList<packageInfo> *plist, bool &test) +TQString KISS::uninstall(int uninstallFlags, TQPtrList<packageInfo> *plist, bool &test) { - QString packs; + TQString packs; packageInfo *pk; for (pk = plist->first(); pk != 0; pk = plist->next()) { @@ -355,7 +355,7 @@ QString KISS::uninstall(int uninstallFlags, QPtrList<packageInfo> *plist, bool & return 0; } -QString KISS::doUninstall(int, const QString &packs, bool &) +TQString KISS::doUninstall(int, const TQString &packs, bool &) { return "kiss -d " + packs; } @@ -364,12 +364,12 @@ QString KISS::doUninstall(int, const QString &packs, bool &) // Call the script to install packages setting parameters // to kiss dependent on flags, returning whether everyting worked ////////////////////////////////////////////////////////////////////////////// -QString KISS::install(int installFlags, QPtrList<packageInfo> *plist, bool &test) +TQString KISS::install(int installFlags, TQPtrList<packageInfo> *plist, bool &test) { packageInfo *pk; int i = 0; for (pk = plist->first(); pk != 0; pk = plist->next()) { - QString fname = pk->fetchFilename(); + TQString fname = pk->fetchFilename(); if (!fname.isEmpty()) { doInstall(installFlags, fname, test); i++; @@ -378,22 +378,22 @@ QString KISS::install(int installFlags, QPtrList<packageInfo> *plist, bool &test return 0; } -QString KISS::doInstall(int, const QString &packs, bool &) +TQString KISS::doInstall(int, const TQString &packs, bool &) { return "perl " + packs; } ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -QStringList KISS::FindFile(const QString &name, bool) +TQStringList KISS::FindFile(const TQString &name, bool) { - QString s = "kiss -p "; + TQString s = "kiss -p "; s += name; - QStringList filelist; + TQStringList filelist; // filelist = kpty->run(s); - // for ( QStringList::Iterator it = filelist.begin(); it != filelist.end(); ++it ) { + // for ( TQStringList::Iterator it = filelist.begin(); it != filelist.end(); ++it ) { // *it = *it + '\t' + name ; // } diff --git a/kpackage/kissInterface.h b/kpackage/kissInterface.h index 4a4484d..1f411eb 100644 --- a/kpackage/kissInterface.h +++ b/kpackage/kissInterface.h @@ -29,8 +29,8 @@ #include "../config.h" -#include <qptrlist.h> -#include <qstringlist.h> +#include <tqptrlist.h> +#include <tqstringlist.h> #include <kprocess.h> #include "procbuf.h" @@ -48,12 +48,12 @@ public: KISS(); ~KISS(); - bool isType(char *buf, const QString &fname); + bool isType(char *buf, const TQString &fname); param *initinstallOptions(); param *inituninstallOptions(); - packageInfo *getPackageInfo(char mode, const QString &name, const QString &version); - QStringList getFileList(packageInfo *p); - QStringList getChangeLog(packageInfo *p); + packageInfo *getPackageInfo(char mode, const TQString &name, const TQString &version); + TQStringList getFileList(packageInfo *p); + TQStringList getChangeLog(packageInfo *p); bool filesTab(packageInfo *p); // If files tab is to be enabled @@ -61,8 +61,8 @@ public: bool changeTab(packageInfo *p); // If change log tab is to be enabled - QStringList FindFile(const QString &name, bool seachAll=false); - bool parseName(const QString& name, QString *n, QString *v); + TQStringList FindFile(const TQString &name, bool seachAll=false); + bool parseName(const TQString& name, TQString *n, TQString *v); public slots: void setLocation(); @@ -70,13 +70,13 @@ public slots: private: packageInfo* collectInfo(const char *inp); - void listInstalledPackages(QPtrList<packageInfo> *pki); + void listInstalledPackages(TQPtrList<packageInfo> *pki); - QString install(int installFlags, QPtrList<packageInfo> *plist, bool &test); - QString uninstall(int uninstallFlags, QPtrList<packageInfo> *plist, bool &test); + TQString install(int installFlags, TQPtrList<packageInfo> *plist, bool &test); + TQString uninstall(int uninstallFlags, TQPtrList<packageInfo> *plist, bool &test); - QString doUninstall(int installFlags, const QString &packs, bool &test); - QString doInstall(int installFlags, const QString &packs, bool &test); + TQString doUninstall(int installFlags, const TQString &packs, bool &test); + TQString doInstall(int installFlags, const TQString &packs, bool &test); procbuf reader; }; diff --git a/kpackage/kpPty.cpp b/kpackage/kpPty.cpp index b395483..23eb15f 100644 --- a/kpackage/kpPty.cpp +++ b/kpackage/kpPty.cpp @@ -27,8 +27,8 @@ #include "../config.h" -#include <qtimer.h> -#include <qregexp.h> +#include <tqtimer.h> +#include <tqregexp.h> #include <kprocctrl.h> #include <kpty.h> @@ -49,7 +49,7 @@ const int PROMPT = -1; extern Opts *opts; ////////////////////////////////////////////////////////////////////////////// -kpKProcIO::kpKProcIO ( QTextCodec *_codec) +kpKProcIO::kpKProcIO ( TQTextCodec *_codec) : KProcIO(_codec) { } @@ -61,38 +61,38 @@ kpKProcIO::~kpKProcIO() bool kpKProcIO::sstart (RunMode runmode) { - connect (this, SIGNAL (receivedStdout (KProcess *, char *, int)), - this, SLOT (received (KProcess *, char *, int))); + connect (this, TQT_SIGNAL (receivedStdout (KProcess *, char *, int)), + this, TQT_SLOT (received (KProcess *, char *, int))); - connect (this, SIGNAL (wroteStdin(KProcess *)), - this, SLOT (sent (KProcess *))); + connect (this, TQT_SIGNAL (wroteStdin(KProcess *)), + this, TQT_SLOT (sent (KProcess *))); return KProcess::start (runmode,( KProcess::Communication) ( KProcess::Stdin | KProcess::Stdout)); } ////////////////////////////////////////////////////////////////////////////// -kpPty::kpPty() : QObject() +kpPty::kpPty() : TQObject() { pty = new kpKProcIO(); pty->setUsePty(KProcess::All, false); - connect(pty, SIGNAL(readReady(KProcIO *)), this, - SLOT(readLines())); - connect(pty, SIGNAL(processExited(KProcess *)), this, - SLOT(done())); + connect(pty, TQT_SIGNAL(readReady(KProcIO *)), this, + TQT_SLOT(readLines())); + connect(pty, TQT_SIGNAL(processExited(KProcess *)), this, + TQT_SLOT(done())); pty->pty()->setWinSize(0,80); - tm = new QTimer(this); - connect(tm, SIGNAL(timeout()), this, SLOT(slotTimeout())); + tm = new TQTimer(this); + connect(tm, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotTimeout())); eventLoop = FALSE; inSession = FALSE; pUnterm = FALSE; loginSession = FALSE; - codec = QTextCodec::codecForLocale(); - QMap<QString, QCString> passwords; + codec = TQTextCodec::codecForLocale(); + TQMap<TQString, TQCString> passwords; } @@ -147,14 +147,14 @@ bool kpPty::startSession(bool needRoot) kdDebug() << "kpPty::startSession TRUE\n"; loginSession = TRUE; int ret; - QString s = "echo START=$?\n"; + TQString s = "echo START=$?\n"; FULL_RESTART: interact = FALSE; retList.clear(); pty->resetAll(); - QString passMsg; + TQString passMsg; kdDebug() << "privCmd=" << opts->privCmd << "\n"; if (opts->privCmd == Opts::SSHcmd || !hostName.isEmpty()) { passMsg = i18n("The action you requested uses ssh. Please enter the password or pass phrase.\n"); @@ -189,7 +189,7 @@ bool kpPty::startSession(bool needRoot) inSession = TRUE; } } else if (Result == PASSWORD) { // We got a password prompt - QCString pass; + TQCString pass; int res; interact = TRUE; // kdDebug() << "H=" << hostName << " PH=" << passwords[hostName] << " PT=" << passwordTried <<"\n"; @@ -198,7 +198,7 @@ bool kpPty::startSession(bool needRoot) res = 1; } else { kdDebug() << "Passwd=" << retList.last() << "\n"; - QString msg = passMsg; + TQString msg = passMsg; // kdDebug() << "privCmd=" << opts->privCmd << " host=" << hostName.isEmpty() << "\n"; if (opts->privCmd == Opts::SSHcmd || !hostName.isEmpty()) { msg += retList.last(); @@ -224,11 +224,11 @@ bool kpPty::startSession(bool needRoot) inSession = TRUE; kdDebug() << "kpPty::startSession TRUE\n"; } else { // process return code - pty->writeStdin(QCString("\04"), false); // SU doesn't listen to ^C + pty->writeStdin(TQCString("\04"), false); // SU doesn't listen to ^C if (interact) { goto FULL_RESTART; } else { - QString errMsg = retList.join(" "); + TQString errMsg = retList.join(" "); KpMsgE(errMsg, TRUE); inSession = FALSE; } @@ -244,15 +244,15 @@ bool kpPty::startSession(bool needRoot) return inSession; } -void kpPty::breakUpCmd(const QString &cmd) +void kpPty::breakUpCmd(const TQString &cmd) { kdDebug() << " kpPty::run CMD=\""<< cmd <<"\" pty = " << pty << endl; bool quote = FALSE; - QString s; - QStringList cl = QStringList::split(" ", cmd); + TQString s; + TQStringList cl = TQStringList::split(" ", cmd); - for ( QStringList::Iterator it = cl.begin(); it != cl.end(); ++it ) { + for ( TQStringList::Iterator it = cl.begin(); it != cl.end(); ++it ) { int lastPt = (*it).length() - 1; if ((*it)[0] == '\'') { // Start of quoted string s = *it; @@ -278,7 +278,7 @@ void kpPty::breakUpCmd(const QString &cmd) } } -QStringList kpPty::run(const QString &cmd, bool inLoop, bool needRoot) +TQStringList kpPty::run(const TQString &cmd, bool inLoop, bool needRoot) { Result = 0; @@ -296,7 +296,7 @@ QStringList kpPty::run(const QString &cmd, bool inLoop, bool needRoot) } else { if (startSession(needRoot)) { kdDebug() << "CMDroot='"<< cmd <<"'\n"; - QString s = cmd + ";echo RESULT=$?"; + TQString s = cmd + ";echo RESULT=$?"; pty->writeStdin(s); kdDebug() << " kpPty::run session\n"; } else { @@ -331,7 +331,7 @@ void kpPty::finish(int ret) { kdDebug() << "kpPty::finish " << ret << "\n"; - QStringList::Iterator l; + TQStringList::Iterator l; Result = ret; if (ret == PROMPT) { // Called program executed in session @@ -375,14 +375,14 @@ void kpPty::readLines() { bool unterm = FALSE; - QString stext; + TQString stext; while(pty->readln(stext, false, &unterm) >= 0) { stext = codec->toUnicode(stext.ascii(), stext.length()); emit textIn(stext, !unterm); // kdDebug() << "[" << pUnterm << "-" << unterm << "-" << stext << ">\n"; if (pUnterm) { - QStringList::Iterator lst = retList.fromLast(); + TQStringList::Iterator lst = retList.fromLast(); if (lst != retList.end()) { stext = *lst + stext; @@ -410,7 +410,7 @@ void kpPty::readLines() emit textIn("\r \n", false); finish(PROMPT); } else if (loginSession) { - QRegExp rx( "^[^:]+:[\\s]*$"); // Password prompt + TQRegExp rx( "^[^:]+:[\\s]*$"); // Password prompt if (rx.search(retList.last()) >= 0) { kdDebug() << loginSession << " " <<retList.last()<< " Match password p\n"; finish(PASSWORD); @@ -422,7 +422,7 @@ void kpPty::readLines() void kpPty::keyOut(char ch) { - QCString s(2); + TQCString s(2); s[0] = ch; s[1] = '\0'; pty->writeStdin(s, false); @@ -431,7 +431,7 @@ void kpPty::keyOut(char ch) void kpPty::done() { int ret = pty->exitStatus(); - QString stext; + TQString stext; //kdDebug() << "Done (" << ret << ")" << endl; diff --git a/kpackage/kpPty.h b/kpackage/kpPty.h index f427ef8..bf303f2 100644 --- a/kpackage/kpPty.h +++ b/kpackage/kpPty.h @@ -27,11 +27,11 @@ #ifndef KPPTY_H #define KPPTY_H -#include <qmultilineedit.h> -#include <qstringlist.h> -#include <qregexp.h> -#include <qtextcodec.h> -#include <qmap.h> +#include <tqmultilineedit.h> +#include <tqstringlist.h> +#include <tqregexp.h> +#include <tqtextcodec.h> +#include <tqmap.h> #include <kprocio.h> @@ -43,7 +43,7 @@ class kpKProcIO: public KProcIO public: - kpKProcIO ( QTextCodec *_codec = 0); + kpKProcIO ( TQTextCodec *_codec = 0); ~kpKProcIO(); bool sstart (RunMode runmode); @@ -57,12 +57,12 @@ public: kpPty(); ~kpPty(); - QStringList run(const QString &cmd, bool inLoop = TRUE, + TQStringList run(const TQString &cmd, bool inLoop = TRUE, bool needRoot= FALSE); bool startSession(bool needRoot); void close(); - QString remote; + TQString remote; int Result; // True if have started a session bool inSession; @@ -76,8 +76,8 @@ public slots: void keyOut(char); signals: - void textIn(const QString &, bool); - void result(QStringList &, int); + void textIn(const TQString &, bool); + void result(TQStringList &, int); private: void finish(int ret); @@ -85,21 +85,21 @@ private: void startSsh(); void startSu(); void startSudo(); - void breakUpCmd(const QString &); + void breakUpCmd(const TQString &); bool needSession(bool needRoot); kpKProcIO* pty; - QTimer *tm; - QStringList retList; - QRegExp terminator; + TQTimer *tm; + TQStringList retList; + TQRegExp terminator; bool pUnterm; - QString uptext; + TQString uptext; // True if in event loop bool eventLoop; // True if trying to login bool loginSession; - QTextCodec *codec; - QMap<QString, QCString> passwords; + TQTextCodec *codec; + TQMap<TQString, TQCString> passwords; }; diff --git a/kpackage/kpTerm.cpp b/kpackage/kpTerm.cpp index 0336da9..aab6ab8 100644 --- a/kpackage/kpTerm.cpp +++ b/kpackage/kpTerm.cpp @@ -27,7 +27,7 @@ #include "../config.h" -#include <qvbox.h> +#include <tqvbox.h> #include <kglobalsettings.h> #include <kdebug.h> @@ -38,8 +38,8 @@ ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -kpTerm::kpTerm(kpPty *pt, QWidget * parent, const char * name ) : - QTextEdit(parent,name) +kpTerm::kpTerm(kpPty *pt, TQWidget * parent, const char * name ) : + TQTextEdit(parent,name) { pty = pt; setFont(KGlobalSettings::fixedFont()); @@ -51,25 +51,25 @@ kpTerm::kpTerm(kpPty *pt, QWidget * parent, const char * name ) : void kpTerm::doConnect() { - connect(pty, SIGNAL(textIn(const QString &, bool)), this, - SLOT(textIn(const QString &, bool))); - connect(pty,SIGNAL(result(QStringList &, int)), - this,SLOT(slotResult(QStringList &, int))); - connect(this, SIGNAL(keyOut(char)), pty, - SLOT(keyOut(char))); + connect(pty, TQT_SIGNAL(textIn(const TQString &, bool)), this, + TQT_SLOT(textIn(const TQString &, bool))); + connect(pty,TQT_SIGNAL(result(TQStringList &, int)), + this,TQT_SLOT(slotResult(TQStringList &, int))); + connect(this, TQT_SIGNAL(keyOut(char)), pty, + TQT_SLOT(keyOut(char))); } void kpTerm::doUnconnect() { - disconnect(pty, SIGNAL(textIn(const QString &, bool)), this, - SLOT(textIn(const QString &, bool))); - disconnect(pty,SIGNAL(result(QStringList &, int)), - this,SLOT(slotResult(QStringList &, int))); - disconnect(this, SIGNAL(keyOut(char)), pty, - SLOT(keyOut(char))); + disconnect(pty, TQT_SIGNAL(textIn(const TQString &, bool)), this, + TQT_SLOT(textIn(const TQString &, bool))); + disconnect(pty,TQT_SIGNAL(result(TQStringList &, int)), + this,TQT_SLOT(slotResult(TQStringList &, int))); + disconnect(this, TQT_SIGNAL(keyOut(char)), pty, + TQT_SLOT(keyOut(char))); } -bool kpTerm::run(const QString &cmd, QStringList &r) +bool kpTerm::run(const TQString &cmd, TQStringList &r) { setReadOnly(FALSE); setFocus(); @@ -95,21 +95,21 @@ void kpTerm::done() clearFocus(); } -void kpTerm::keyPressEvent ( QKeyEvent * e ) +void kpTerm::keyPressEvent ( TQKeyEvent * e ) { // kdDebug() << "K=" << e->ascii() << "," << e->ascii() << "\n"; if (e->ascii()) { emit keyOut(e->ascii()); } else { - QTextEdit::keyPressEvent (e); + TQTextEdit::keyPressEvent (e); } setCursorPosition(9999,9999); } -void kpTerm::textIn(const QString &stext, bool bNewLine) +void kpTerm::textIn(const TQString &stext, bool bNewLine) { - QRegExp chrs("[\\010\\012\\015]"); - QString del = "\010"; + TQRegExp chrs("[\\010\\012\\015]"); + TQString del = "\010"; // kdDebug() << "Tin=[" << stext << "]\n"; if (stext.find(chrs) < 0) { insert( stext ); @@ -141,7 +141,7 @@ void kpTerm::textIn(const QString &stext, bool bNewLine) moveCursor(MoveEnd, false); } -void kpTerm::insert ( const QString & str, bool) { +void kpTerm::insert ( const TQString & str, bool) { int x,y; getCursorPosition(&y,&x); @@ -152,11 +152,11 @@ void kpTerm::insert ( const QString & str, bool) { getCursorPosition(&y,&x); // kdDebug() << "k=" << y << "," << x <<"\n"; } - QTextEdit::insert(str,(bool)FALSE); + TQTextEdit::insert(str,(bool)FALSE); } } -void kpTerm::slotResult(QStringList &rlist, int ret) +void kpTerm::slotResult(TQStringList &rlist, int ret) { emit result(rlist, ret); doUnconnect(); @@ -169,28 +169,28 @@ void kpTerm::slotResult(QStringList &rlist, int ret) // Dialog window for password prompt // ////////////////////////////////////////////////////////////////////////////// -kpRun::kpRun( QWidget *parent) - : KDialogBase(parent, "kpRun", true, QString::null, +kpRun::kpRun( TQWidget *parent) + : KDialogBase(parent, "kpRun", true, TQString::null, Cancel, Cancel, true ) { - QVBox *page = makeVBoxMainWidget(); - title = new QLabel("", page); - QFont f( KGlobalSettings::generalFont()); + TQVBox *page = makeVBoxMainWidget(); + title = new TQLabel("", page); + TQFont f( KGlobalSettings::generalFont()); f.setBold(true); f.setPointSize(f.pointSize()+4); title->setFont(f); term = new kpTerm(kpty,page); resize(600, 300); - connect(term,SIGNAL(result(QStringList &, int)), - this,SLOT(slotResult(QStringList &, int))); + connect(term,TQT_SIGNAL(result(TQStringList &, int)), + this,TQT_SLOT(slotResult(TQStringList &, int))); hide(); } -bool kpRun::run(QString cmd, QString msg) +bool kpRun::run(TQString cmd, TQString msg) { - QStringList r; + TQStringList r; title->setText(msg); if (!cmd.isEmpty()) { @@ -203,17 +203,17 @@ bool kpRun::run(QString cmd, QString msg) } } -void kpRun::addText(const QStringList &ret) +void kpRun::addText(const TQStringList &ret) { int last = ret.count()-1; int i = 0; - for ( QStringList::ConstIterator it = ret.begin(); it != ret.end(); ++it, ++i ) { + for ( TQStringList::ConstIterator it = ret.begin(); it != ret.end(); ++it, ++i ) { // kdDebug() << "ks=" << *it << "\n"; term->textIn(*it, (i != last)); } } -void kpRun::slotResult(QStringList &, int ret) +void kpRun::slotResult(TQStringList &, int ret) { if (ret == 0 || ret == 666) { term->clear(); diff --git a/kpackage/kpTerm.h b/kpackage/kpTerm.h index 7767565..00ac57a 100644 --- a/kpackage/kpTerm.h +++ b/kpackage/kpTerm.h @@ -31,10 +31,10 @@ #include "../config.h" -#include <qtextedit.h> -#include <qstringlist.h> -#include <qlayout.h> -#include <qlabel.h> +#include <tqtextedit.h> +#include <tqstringlist.h> +#include <tqlayout.h> +#include <tqlabel.h> #include <klocale.h> #include <kdialogbase.h> @@ -47,23 +47,23 @@ class kpTerm: public QTextEdit Q_OBJECT public: - kpTerm(kpPty *pt, QWidget * parent=0, const char * name=0); - void keyPressEvent ( QKeyEvent * e ); - bool run(const QString &cmd, QStringList &r); + kpTerm(kpPty *pt, TQWidget * parent=0, const char * name=0); + void keyPressEvent ( TQKeyEvent * e ); + bool run(const TQString &cmd, TQStringList &r); void doConnect(); void doUnconnect(); - void insert ( const QString & str, bool mark=FALSE ); + void insert ( const TQString & str, bool mark=FALSE ); kpPty *pty; void cancel(); void done(); public slots: - void textIn(const QString &, bool); - void slotResult(QStringList &, int); + void textIn(const TQString &, bool); + void slotResult(TQStringList &, int); signals: void keyOut(char); - void result(QStringList &, int); + void result(TQStringList &, int); }; @@ -74,17 +74,17 @@ class kpRun: public KDialogBase Q_OBJECT public: - kpRun(QWidget *parent = 0); - bool run(QString cmd, QString title); - void addText(const QStringList &ret); + kpRun(TQWidget *parent = 0); + bool run(TQString cmd, TQString title); + void addText(const TQStringList &ret); public slots: - void slotResult(QStringList &, int); + void slotResult(TQStringList &, int); void slotCancel(); private: kpTerm *term; - QLabel *title; + TQLabel *title; }; ////////////////////////////////////////////////////////////////////////////// #endif diff --git a/kpackage/kpackage.cpp b/kpackage/kpackage.cpp index 5c328e1..c5dd2eb 100644 --- a/kpackage/kpackage.cpp +++ b/kpackage/kpackage.cpp @@ -31,9 +31,9 @@ #include "../config.h" -#include <qdir.h> -#include <qlabel.h> -#include <qframe.h> +#include <tqdir.h> +#include <tqlabel.h> +#include <tqframe.h> #include <kdebug.h> #include <kapplication.h> @@ -93,94 +93,94 @@ KPKG::KPKG(KConfig *_config) void KPKG::setupMenu() { - pack_open = KStdAction::open(kpackage, SLOT(fileOpen()), + pack_open = KStdAction::open(kpackage, TQT_SLOT(fileOpen()), actionCollection()); - recent = KStdAction::openRecent(this, SLOT(openRecent(const KURL&)), + recent = KStdAction::openRecent(this, TQT_SLOT(openRecent(const KURL&)), actionCollection()); recent->loadEntries( config ); pack_find = new KAction( i18n("Find &Package..."), "find", KStdAccel::shortcut(KStdAccel::Find), kpackage, - SLOT(find()), actionCollection(), "pack_find"); + TQT_SLOT(find()), actionCollection(), "pack_find"); pack_findf = new KAction( i18n("Find &File..."), "filefind", 0, kpackage, - SLOT(findf()), actionCollection(), "pack_findf"); + TQT_SLOT(findf()), actionCollection(), "pack_findf"); kpack_reload = new KAction( i18n("&Reload"), "reload", KStdAccel::shortcut(KStdAccel::Reload), kpackage, - SLOT(reload()), actionCollection(), "kpack_reload"); + TQT_SLOT(reload()), actionCollection(), "kpack_reload"); - (void) KStdAction::quit(kpackage, SLOT(fileQuit()), + (void) KStdAction::quit(kpackage, TQT_SLOT(fileQuit()), actionCollection()); - pack_prev = KStdAction::back(kpackage->management->treeList, SLOT(previous()), + pack_prev = KStdAction::back(kpackage->management->treeList, TQT_SLOT(previous()), actionCollection(),"pack_prev"); - pack_next = KStdAction::forward(kpackage->management->treeList, SLOT(next()), + pack_next = KStdAction::forward(kpackage->management->treeList, TQT_SLOT(next()), actionCollection(),"pack_next"); (void) (new KAction( i18n("&Expand Tree"), "ftout", 0, kpackage, - SLOT(expandTree()), actionCollection(), "kpack_expand")); + TQT_SLOT(expandTree()), actionCollection(), "kpack_expand")); (void) (new KAction( i18n("&Collapse Tree"), "ftin", 0, kpackage, - SLOT(collapseTree()), actionCollection(), "kpack_collapse")); + TQT_SLOT(collapseTree()), actionCollection(), "kpack_collapse")); - (void) (new KAction( i18n("Clear &Marked"), QString::null, + (void) (new KAction( i18n("Clear &Marked"), TQString::null, 0, kpackage, - SLOT(clearMarked()), actionCollection(), "kpack_clear")); + TQT_SLOT(clearMarked()), actionCollection(), "kpack_clear")); - (void) (new KAction( i18n("Mark &All"), QString::null, + (void) (new KAction( i18n("Mark &All"), TQString::null, 0, kpackage, - SLOT(markAll()), actionCollection(), "kpack_markall")); + TQT_SLOT(markAll()), actionCollection(), "kpack_markall")); - pack_install = new KAction( i18n("&Install"), QString::null, + pack_install = new KAction( i18n("&Install"), TQString::null, 0, kpackage->management, - SLOT(installSingleClicked()), actionCollection(), "install_single"); + TQT_SLOT(installSingleClicked()), actionCollection(), "install_single"); pack_install->setEnabled(false); kpackage->management->setInstallAction(pack_install); - pack_uninstall = new KAction( i18n("&Uninstall"), QString::null, + pack_uninstall = new KAction( i18n("&Uninstall"), TQString::null, 0, kpackage->management, - SLOT(uninstallSingleClicked()), actionCollection(), "uninstall_single"); + TQT_SLOT(uninstallSingleClicked()), actionCollection(), "uninstall_single"); pack_uninstall->setEnabled(false); kpackage->management->setUninstallAction(pack_uninstall); - (void) (new KAction( i18n("&Install Marked"), QString::null, + (void) (new KAction( i18n("&Install Marked"), TQString::null, 0, kpackage->management, - SLOT(installMultClicked()), actionCollection(), "install_marked")); + TQT_SLOT(installMultClicked()), actionCollection(), "install_marked")); - (void) (new KAction( i18n("&Uninstall Marked"), QString::null, + (void) (new KAction( i18n("&Uninstall Marked"), TQString::null, 0, kpackage->management, - SLOT(uninstallMultClicked()), actionCollection(), "uninstall_marked")); + TQT_SLOT(uninstallMultClicked()), actionCollection(), "uninstall_marked")); setStandardToolBarMenuEnabled(true); - KStdAction::configureToolbars( this, SLOT(configureToolBars()), + KStdAction::configureToolbars( this, TQT_SLOT(configureToolBars()), actionCollection()); - KStdAction::saveOptions( this, SLOT(saveSettings()), actionCollection()); + KStdAction::saveOptions( this, TQT_SLOT(saveSettings()), actionCollection()); - KStdAction::keyBindings( guiFactory(), SLOT(configureShortcuts()), actionCollection()); + KStdAction::keyBindings( guiFactory(), TQT_SLOT(configureShortcuts()), actionCollection()); (void) (new KAction( i18n("Configure &KPackage..."), "configure", 0, this, - SLOT(setOptions()), actionCollection(), "kpack_options")); + TQT_SLOT(setOptions()), actionCollection(), "kpack_options")); - (void) (new KAction( i18n("Clear Package &Folder Cache"), QString::null, + (void) (new KAction( i18n("Clear Package &Folder Cache"), TQString::null, 0, this, - SLOT(clearDCache()), actionCollection(), "clear_dcache")); + TQT_SLOT(clearDCache()), actionCollection(), "clear_dcache")); - (void) (new KAction( i18n("Clear &Package Cache"), QString::null, + (void) (new KAction( i18n("Clear &Package Cache"), TQString::null, 0, this, - SLOT(clearPCache()), actionCollection(), "clear_pcache")); + TQT_SLOT(clearPCache()), actionCollection(), "clear_pcache")); int i; for (i = 0; i < kpinterfaceN; i++) { @@ -230,7 +230,7 @@ void KPKG::openRecent(const KURL& url){ kpackage->openNetFile( url ); } -void KPKG::add_recent_file(const QString &newfile){ +void KPKG::add_recent_file(const TQString &newfile){ KURL url = KURL(newfile); @@ -239,7 +239,7 @@ void KPKG::add_recent_file(const QString &newfile){ void KPKG::configureToolBars() { KEditToolbar dlg(actionCollection()); - connect(&dlg,SIGNAL(newToolbarConfig()),this,SLOT(slotNewToolbarConfig())); + connect(&dlg,TQT_SIGNAL(newToolbarConfig()),this,TQT_SLOT(slotNewToolbarConfig())); dlg.exec(); } @@ -287,7 +287,7 @@ void KPKG::saveProperties(KConfig *config ) void KPKG::readProperties(KConfig *config) { - QString entry = config->readPathEntry("Name"); // no default + TQString entry = config->readPathEntry("Name"); // no default if (entry.isNull()) return; kpackage->openNetFiles(entry); @@ -302,8 +302,8 @@ bool KPKG::queryClose() { ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -KPACKAGE::KPACKAGE(KConfig *_config, QWidget *parent) - : QWidget(parent) +KPACKAGE::KPACKAGE(KConfig *_config, TQWidget *parent) + : TQWidget(parent) { // Save copy of config @@ -329,7 +329,7 @@ KPACKAGE::~KPACKAGE() } // resize event -- arrange the widgets -void KPACKAGE::resizeEvent(QResizeEvent *re) +void KPACKAGE::resizeEvent(TQResizeEvent *re) { re = re; // prevent warning arrangeWidgets(); @@ -364,12 +364,12 @@ void KPACKAGE::destroyModeWidgets() // Set up the status bar void KPACKAGE::setupStatusBar() { - statusbar = new QFrame(this); - statusbar->setFrameStyle(QFrame::Raised | QFrame::Panel); + statusbar = new TQFrame(this); + statusbar->setFrameStyle(TQFrame::Raised | TQFrame::Panel); processProgress = new KProgress(100,statusbar); processProgress->setTextEnabled(FALSE); - status = new QLabel(i18n("Management Mode"), statusbar); + status = new TQLabel(i18n("Management Mode"), statusbar); } // Arrange the widgets nicely @@ -455,13 +455,13 @@ void KPACKAGE::collapseTree() management->treeList->collapseTree(management->treeList); } -pkgInterface *KPACKAGE::pkType(const QString &fname) +pkgInterface *KPACKAGE::pkType(const TQString &fname) { // Get the package information for this package char buf[51]; int i; - FILE *file= fopen(QFile::encodeName(fname),"r"); + FILE *file= fopen(TQFile::encodeName(fname),"r"); if (file) { fgets(buf,sizeof(buf)-1,file); buf[50] = 0; @@ -504,28 +504,28 @@ int KPACKAGE::typeIndex(pkgInterface *type) { return -1; } -void KPACKAGE::openNetFiles (const QStringList &urls, bool install ) +void KPACKAGE::openNetFiles (const TQStringList &urls, bool install ) { - QStringList files; + TQStringList files; int i; int index; - QPtrList<packageInfo> **lst = new QPtrList<packageInfo>*[kpinterfaceN]; + TQPtrList<packageInfo> **lst = new TQPtrList<packageInfo>*[kpinterfaceN]; packageInfo *pk = 0; kdDebug() << "openNetFiles\n"; - for (QStringList::ConstIterator it = urls.begin(); it != urls.end(); ++it) { + for (TQStringList::ConstIterator it = urls.begin(); it != urls.end(); ++it) { files.append(fetchNetFile(*it)); kpkg->add_recent_file(*it); } for (i = 0; i < kpinterfaceN; i++) { if (kpinterface[i]) { - lst[i] = new QPtrList<packageInfo>; + lst[i] = new TQPtrList<packageInfo>; } } - for (QStringList::Iterator t = files.begin(); t != files.end(); ++t) { + for (TQStringList::Iterator t = files.begin(); t != files.end(); ++t) { pkgInterface *type = pkType(*t); index = typeIndex(type); if (index >= 0) { @@ -579,10 +579,10 @@ void KPACKAGE::openNetFile(const KURL &url, bool install ) -QString KPACKAGE::getFileName(const KURL & url, QString &cacheName ) +TQString KPACKAGE::getFileName(const KURL & url, TQString &cacheName ) { - QString none = ""; - QString fname = ""; + TQString none = ""; + TQString fname = ""; if ( !url.isValid() ) { KpMsgE(i18n("Malformed URL: %1").arg(url.url()),TRUE); @@ -594,13 +594,13 @@ QString KPACKAGE::getFileName(const KURL & url, QString &cacheName ) fname = url.path(); } else { - QString tmpd = cacheObj::PDir(); + TQString tmpd = cacheObj::PDir(); if (!tmpd.isEmpty()) { - QString cacheFile = tmpd + url.fileName(); + TQString cacheFile = tmpd + url.fileName(); cacheName = cacheFile; - QFileInfo f(cacheFile); + TQFileInfo f(cacheFile); if (f.exists() && (opts->DCache != Opts::NEVER)) { fname = cacheFile; } @@ -612,9 +612,9 @@ QString KPACKAGE::getFileName(const KURL & url, QString &cacheName ) bool KPACKAGE::isFileLocal( const KURL & url ) { - QString cf; + TQString cf; - QString f = getFileName(url, cf); + TQString f = getFileName(url, cf); if (cf.isEmpty()) { return false; @@ -627,12 +627,12 @@ bool KPACKAGE::isFileLocal( const KURL & url ) } } -QString KPACKAGE::fetchNetFile( const KURL & url ) +TQString KPACKAGE::fetchNetFile( const KURL & url ) { - QString cf; + TQString cf; - QString f = getFileName(url, cf); + TQString f = getFileName(url, cf); if (cf.isEmpty()) { return ""; @@ -649,9 +649,9 @@ QString KPACKAGE::fetchNetFile( const KURL & url ) if (kio.download(url, cf)) { setStatus(i18n("KIO finished")); - QFileInfo fi(cf); + TQFileInfo fi(cf); if (!(fi.exists() && fi.size() > 0)) { - unlink(QFile::encodeName(cf)); + unlink(TQFile::encodeName(cf)); return ""; } else { CacheList cl(fi.dirPath()); @@ -672,7 +672,7 @@ void KPACKAGE::fileOpenUrl(){ bool ok; - QString url = KInputDialog::getText( QString::null, + TQString url = KInputDialog::getText( TQString::null, i18n( "Open location:" ), save_url.prettyURL(), &ok, this ); if ( ok ) @@ -696,15 +696,15 @@ void KPACKAGE::findf(){ findialog = new FindF(this); } -KFileDialog* KPACKAGE::getFileDialog(const QString &captiontext) +KFileDialog* KPACKAGE::getFileDialog(const TQString &captiontext) { if(!file_dialog) { - file_dialog = new KFileDialog(QDir::currentDirPath(), "", + file_dialog = new KFileDialog(TQDir::currentDirPath(), "", this,"file_dialog",TRUE); } - QString pat; + TQString pat; for (int i = 0; i < kpinterfaceN; i++) { if (kpinterface[i] && opts->handlePackage[i]) { pat += kpinterface[i]->packagePattern; @@ -718,12 +718,12 @@ KFileDialog* KPACKAGE::getFileDialog(const QString &captiontext) return file_dialog; } -void KPACKAGE::dragEnterEvent(QDragEnterEvent* e) +void KPACKAGE::dragEnterEvent(TQDragEnterEvent* e) { e->accept(KURLDrag::canDecode(e)); } -void KPACKAGE::dropEvent(QDropEvent *de) // something has been dropped +void KPACKAGE::dropEvent(TQDropEvent *de) // something has been dropped { KURL::List list; if (!KURLDrag::decode(de, list) || list.isEmpty()) @@ -732,13 +732,13 @@ void KPACKAGE::dropEvent(QDropEvent *de) // something has been dropped openNetFiles(list.toStringList()); } -void KPACKAGE::setStatus(const QString &s) // set the text in the status bar +void KPACKAGE::setStatus(const TQString &s) // set the text in the status bar { status->setText(s); kapp->processEvents(); // refresh the screen } -QString KPACKAGE::getStatus() // get the text in the status bar +TQString KPACKAGE::getStatus() // get the text in the status bar { if(status) return status->text(); diff --git a/kpackage/kpackage.h b/kpackage/kpackage.h index 07d22da..8e13643 100644 --- a/kpackage/kpackage.h +++ b/kpackage/kpackage.h @@ -66,7 +66,7 @@ class KPACKAGE : public QWidget ///////////// METHODS ------------------------------------------------------ public: - KPACKAGE(KConfig *_config, QWidget *parent); + KPACKAGE(KConfig *_config, TQWidget *parent); // Constructor ~KPACKAGE(); @@ -76,13 +76,13 @@ public: OPEN_READONLY = 2, OPEN_INSERT = 4 }; - void setStatus(const QString &s); + void setStatus(const TQString &s); // this sets the status bar's string to s void setPercent(int x); // this set the status bar's progress to x - QString getStatus(); + TQString getStatus(); // this gets the current status string on the status bar // void setMode(int newmode, pkgInterface *type, int refresh); @@ -90,33 +90,33 @@ public: void setup(); - pkgInterface *pkType(const QString &fname); + pkgInterface *pkType(const TQString &fname); // find type of package int typeIndex(pkgInterface *); // convert interface pointer to index - void openNetFiles(const QStringList &urls, bool install=TRUE); + void openNetFiles(const TQStringList &urls, bool install=TRUE); void openNetFile(const KURL & url, bool install=TRUE); // open a file given a URL - QString fetchNetFile(const KURL & url); + TQString fetchNetFile(const KURL & url); // fetch a file given a URL - static QString getFileName(const KURL & url, QString &cacheName); + static TQString getFileName(const KURL & url, TQString &cacheName); // return file name, if not local file cachename is name for cache entry static bool isFileLocal( const KURL & url ); // true if URL refers to local or cached file protected: - void resizeEvent(QResizeEvent *re); + void resizeEvent(TQResizeEvent *re); // This is called when the widget is resized - void dropEvent(QDropEvent *); + void dropEvent(TQDropEvent *); // This is called when a URL has been dropped in the drop zone - void dragEnterEvent(QDragEnterEvent* e); + void dragEnterEvent(TQDragEnterEvent* e); private: @@ -133,7 +133,7 @@ private: // This arranges the widgets in the window (should be called after a // resize event) - KFileDialog* getFileDialog(const QString &captiontext); + KFileDialog* getFileDialog(const TQString &captiontext); ///////////// SLOTS -------------------------------------------------------- public slots: @@ -199,13 +199,13 @@ private: // Menu item identifiers - QFrame *statusbar; + TQFrame *statusbar; // the status bar KProgress *processProgress; // Progress bar for showing progress - QLabel *status; + TQLabel *status; // The actual status KFileDialog *file_dialog; @@ -238,7 +238,7 @@ public: KPKG(KConfig *_config); // Constructor - void add_recent_file(const QString &newfile); + void add_recent_file(const TQString &newfile); // keep list of files accessed void writeSettings(); @@ -273,7 +273,7 @@ private: void setupMenu(); // This sets up the menubar - QStrList recent_files; + TQStrList recent_files; KAction *pack_open; KAction *pack_find; @@ -326,11 +326,11 @@ extern kpPty *kpty; extern kpRun *kprun; extern kpRun *kpstart; -extern QString hostName; +extern TQString hostName; extern pkgInterface *kpinterface[]; -void KpMsg(const QString &lab, const QString &msg, bool stop); -void KpMsgE(const QString &msg, bool stop = FALSE); +void KpMsg(const TQString &lab, const TQString &msg, bool stop); +void KpMsgE(const TQString &msg, bool stop = FALSE); #endif diff --git a/kpackage/kplview.cpp b/kpackage/kplview.cpp index 1889150..5b7d76c 100644 --- a/kpackage/kplview.cpp +++ b/kpackage/kplview.cpp @@ -25,9 +25,9 @@ */ #include "../config.h" -#include <qpixmap.h> -#include <qptrstack.h> -#include <qheader.h> +#include <tqpixmap.h> +#include <tqptrstack.h> +#include <tqheader.h> #include <kdebug.h> #include <klocale.h> @@ -43,30 +43,30 @@ #define MPOS 1 -KpTreeList::KpTreeList( QWidget *parent ) : +KpTreeList::KpTreeList( TQWidget *parent ) : KListView (parent) { markPkg = 0; setShowSortIndicator(true); - QPtrStack<QString> stack(); + TQPtrStack<TQString> stack(); readTreeType(); - setFrameStyle(QFrame::Panel|QFrame::Sunken); + setFrameStyle(TQFrame::Panel|TQFrame::Sunken); setLineWidth(2); setItemMargin(2); addColumn(i18n("Package")); - setColumnWidthMode(0,QListView::Manual); + setColumnWidthMode(0,TQListView::Manual); addColumn(i18n("Mark")); - setColumnWidthMode(1,QListView::Manual); + setColumnWidthMode(1,TQListView::Manual); addColumn(i18n("Summary")); - setColumnWidthMode(2,QListView::Manual); + setColumnWidthMode(2,TQListView::Manual); addColumn(i18n("Size")); - setColumnWidthMode(3,QListView::Manual); + setColumnWidthMode(3,TQListView::Manual); addColumn(i18n("Version")); - setColumnWidthMode(4,QListView::Manual); + setColumnWidthMode(4,TQListView::Manual); addColumn(i18n("Old Version")); - setColumnWidthMode(5,QListView::Manual); + setColumnWidthMode(5,TQListView::Manual); // setAllColumnsShowFocus(TRUE); setRootIsDecorated(TRUE); @@ -93,13 +93,13 @@ KpTreeListItem *KpTreeList::currentItem() return (KpTreeListItem *)KListView::currentItem(); } -void KpTreeList::contentsMousePressEvent ( QMouseEvent * e ) +void KpTreeList::contentsMousePressEvent ( TQMouseEvent * e ) { bool markUpdate = false; if (e->button() == LeftButton) { if (inMark(e->x())) { - QPoint vp = contentsToViewport(e->pos()); + TQPoint vp = contentsToViewport(e->pos()); KpTreeListItem *i = ( KpTreeListItem *)itemAt( vp ); if (i && i->childCount() == 0) { if (e->state() == ShiftButton) { @@ -151,7 +151,7 @@ bool KpTreeList::inMark(int x) { int i; - QHeader* const thisHeader = header(); + TQHeader* const thisHeader = header(); int mpos = thisHeader->mapToIndex(MPOS); for (i = 0; i < mpos; i++) @@ -259,7 +259,7 @@ void KpTreeList::markAll(KpTreeListItem *item) } } -void KpTreeList::findMarked(KpTreeListItem *item, QPtrList<KpTreeListItem> &selList) +void KpTreeList::findMarked(KpTreeListItem *item, TQPtrList<KpTreeListItem> &selList) { while (item) { if (item->childCount() > 0) { @@ -348,7 +348,7 @@ void KpTreeList::collapseTree(KpTreeListItem *pitem) /////////////////////////////////////////////////////////////////////////// // A package has been highlighted in the list tree -void KpTreeList::packageHighlighted(QListViewItem *item, packageDisplayWidget *packageDisplay) +void KpTreeList::packageHighlighted(TQListViewItem *item, packageDisplayWidget *packageDisplay) { KpTreeListItem *sel = (KpTreeListItem *)item; @@ -382,7 +382,7 @@ void KpTreeList::packageHighlighted(QListViewItem *item, packageDisplayWidget *p notPress = false; } -KpTreeListItem *KpTreeList::search(const QString &str, const QString &head, +KpTreeListItem *KpTreeList::search(const TQString &str, const TQString &head, KpTreeListItem *start) { KpTreeListItem *item = firstChild(); @@ -403,7 +403,7 @@ KpTreeListItem *KpTreeList::search(const QString &str, const QString &head, return 0; } -KpTreeListItem *KpTreeList::search(const QString &str, bool subStr, bool wrap, +KpTreeListItem *KpTreeList::search(const TQString &str, bool subStr, bool wrap, bool start=FALSE) { if (!firstChild()) @@ -427,7 +427,7 @@ bool KpTreeList::searchChild(KpTreeListItem *it) { do { if (!searchSkip) { - QString s = it->text(0); + TQString s = it->text(0); // kdDebug() << "s='" << s << "'='" << searchStr << "\n"; if ((it->childCount() == 0) && (it->info->display(treeType)) && (searchSubstr ? s.contains(searchStr,FALSE) : s == searchStr)) { @@ -455,7 +455,7 @@ bool KpTreeList::searchChild(KpTreeListItem *it) KpTreeListItem *KpTreeList::changePack(KpTreeListItem *searchResult, bool push) { if (searchResult) { - QListViewItem *i; + TQListViewItem *i; i = searchResult; while ((i = i->parent())) { @@ -560,7 +560,7 @@ void KpTreeList::readTreeConfig() int i,n; int num[] = {185,37,180,54,95,95}; - QString colpos; + TQString colpos; for (i = 0; i < 6; i++) { colpos.setNum(i); n = config->readNumEntry(colpos,num[i]); @@ -571,14 +571,14 @@ void KpTreeList::readTreeConfig() ////////////////////////////////////////////////////////////////////////////// -KpTreeListItem::KpTreeListItem( QListViewItem *parent, packageInfo* pinfo, - const QPixmap& thePixmap, - QString label1, QString label2 , - QString label3 , QString label4 , - QString label5 , QString label6 , - QString label7 , QString label8 +KpTreeListItem::KpTreeListItem( TQListViewItem *parent, packageInfo* pinfo, + const TQPixmap& thePixmap, + TQString label1, TQString label2 , + TQString label3 , TQString label4 , + TQString label5 , TQString label6 , + TQString label7 , TQString label8 -) : QListViewItem(parent, label1, label2, label3, label4, label5, +) : TQListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) { info = pinfo; @@ -589,12 +589,12 @@ KpTreeListItem::KpTreeListItem( QListViewItem *parent, packageInfo* pinfo, } KpTreeListItem::KpTreeListItem( KListView *parent, packageInfo* pinfo, - const QPixmap& thePixmap, - QString label1, QString label2 , - QString label3 , QString label4 , - QString label5 , QString label6 , - QString label7 , QString label8 -) : QListViewItem(parent, label1, label2, label3, label4, label5, + const TQPixmap& thePixmap, + TQString label1, TQString label2 , + TQString label3 , TQString label4 , + TQString label5 , TQString label6 , + TQString label7 , TQString label8 +) : TQListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) { info = pinfo; @@ -606,12 +606,12 @@ KpTreeListItem::KpTreeListItem( KListView *parent, packageInfo* pinfo, KpTreeListItem *KpTreeListItem::firstChild() { - return (KpTreeListItem *)QListViewItem::firstChild(); + return (KpTreeListItem *)TQListViewItem::firstChild(); } KpTreeListItem *KpTreeListItem::nextSibling() { - return (KpTreeListItem *)QListViewItem::nextSibling(); + return (KpTreeListItem *)TQListViewItem::nextSibling(); } void KpTreeListItem::toggleMark() @@ -644,10 +644,10 @@ void KpTreeListItem::show() setup(); } -int KpTreeListItem::compare( QListViewItem *i, int col, bool ascending ) const +int KpTreeListItem::compare( TQListViewItem *i, int col, bool ascending ) const { // Make sorting more certain if (col == 3) { // size column - QString k, j; + TQString k, j; j = key( col, ascending ); j = j.replace(' ','0'); @@ -660,7 +660,7 @@ int KpTreeListItem::compare( QListViewItem *i, int col, bool ascending ) const // kdDebug() << k <<"=" << j << "\n"; return j.compare(k); } else { - return QListViewItem::compare(i, col, ascending); + return TQListViewItem::compare(i, col, ascending); } } diff --git a/kpackage/kplview.h b/kpackage/kplview.h index 7931c99..1bbd08f 100644 --- a/kpackage/kplview.h +++ b/kpackage/kplview.h @@ -32,11 +32,11 @@ // Standard Headers // Qt Headers -#include <qframe.h> -#include <qpushbutton.h> -#include <qptrlist.h> -#include <qstring.h> -#include <qlayout.h> +#include <tqframe.h> +#include <tqpushbutton.h> +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqlayout.h> // KDE headers #include "klistview.h" @@ -52,9 +52,9 @@ class KpTreeList: public KListView Q_OBJECT public: - KpTreeList ( QWidget * parent = 0); + KpTreeList ( TQWidget * parent = 0); - void contentsMousePressEvent ( QMouseEvent * e ); + void contentsMousePressEvent ( TQMouseEvent * e ); bool inMark(int x); @@ -64,7 +64,7 @@ public: KpTreeListItem *markPkg; - QPtrList<KpTreeListItem> stack; + TQPtrList<KpTreeListItem> stack; // Stack of jumped to packages void sweep(bool init); @@ -72,7 +72,7 @@ public: void expand(); // sweep tree expanding everything - void findMarked(KpTreeListItem *item, QPtrList<KpTreeListItem> &selList); + void findMarked(KpTreeListItem *item, TQPtrList<KpTreeListItem> &selList); // generate list of marked tree items void clearMarked(KpTreeListItem *item); // unmark marked tree items @@ -95,12 +95,12 @@ public: void countMarked(KpTreeListItem *, int &cntInstall, int &cntUnInstall); // Count marked packages that can be installed/uninstalled - void packageHighlighted(QListViewItem *item, packageDisplayWidget *packageDisplay); + void packageHighlighted(TQListViewItem *item, packageDisplayWidget *packageDisplay); // A package has been highlighted in the list tree - KpTreeListItem *search(const QString &str, const QString &head, + KpTreeListItem *search(const TQString &str, const TQString &head, KpTreeListItem *start = 0); - KpTreeListItem *search(const QString &str, bool subStr, bool wrap, bool start); + KpTreeListItem *search(const TQString &str, bool subStr, bool wrap, bool start); // search for a package in tree KpTreeListItem *changePack(KpTreeListItem *searchResult, bool push = true); // Change to other package @@ -137,7 +137,7 @@ private: KpTreeListItem *searchCitem; bool searchSkip, searchSubstr; - QString searchStr; + TQString searchStr; KpTreeListItem *searchResult; // globals used by searchChild for start from current position, // skip to current item before search flag, substring search flag, @@ -155,20 +155,20 @@ signals: class KpTreeListItem : public QListViewItem { public: - KpTreeListItem( QListViewItem *parent, packageInfo* pinfo, - const QPixmap& thePixmap, - QString label1 = 0, QString label2 = 0, - QString label3 = 0, QString label4 = 0, - QString label5 = 0, QString label6 = 0, - QString label7 = 0, QString label8 = 0); + KpTreeListItem( TQListViewItem *parent, packageInfo* pinfo, + const TQPixmap& thePixmap, + TQString label1 = 0, TQString label2 = 0, + TQString label3 = 0, TQString label4 = 0, + TQString label5 = 0, TQString label6 = 0, + TQString label7 = 0, TQString label8 = 0); KpTreeListItem( KListView *parent, packageInfo* pinfo, - const QPixmap& thePixmap, - QString label1 = 0, QString label2 = 0, - QString label3 = 0, QString label4 = 0, - QString label5 = 0, QString label6 = 0, - QString label7 = 0, QString label8 = 0); + const TQPixmap& thePixmap, + TQString label1 = 0, TQString label2 = 0, + TQString label3 = 0, TQString label4 = 0, + TQString label5 = 0, TQString label6 = 0, + TQString label7 = 0, TQString label8 = 0); KpTreeListItem *firstChild(); @@ -181,7 +181,7 @@ public: void hide(); void show(); - virtual int compare( QListViewItem *i, int col, bool ascending ) const; + virtual int compare( TQListViewItem *i, int col, bool ascending ) const; packageInfo *info; bool marked; diff --git a/kpackage/main.cpp b/kpackage/main.cpp index 781d741..3ee47cd 100644 --- a/kpackage/main.cpp +++ b/kpackage/main.cpp @@ -33,7 +33,7 @@ #include "../config.h" #include "kpackage.h" -#include <qfile.h> +#include <tqfile.h> #include <kapplication.h> #include <kglobal.h> @@ -74,7 +74,7 @@ kpRun *kprun; kpRun *kpstart; Opts *opts; -QString hostName; +TQString hostName; pkgInterface *kpinterface[kpinterfaceN]; @@ -93,12 +93,12 @@ int main(int argc, char **argv) int j = 0; // Make sure PATH has the right directories in it - QCString path = getenv("PATH"); + TQCString path = getenv("PATH"); path = "PATH=" + path + ":/sbin:/usr/sbin:/usr/local/bin"; putenv(strdup(path.data())); KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); - QString remoteHost = args->getOption("remote"); + TQString remoteHost = args->getOption("remote"); if (remoteHost.isEmpty() || remoteHost == "localhost") { hostName = ""; @@ -140,7 +140,7 @@ int main(int argc, char **argv) kpkg->setCaption(hostName); if (args->count()) { // an argument has been given - QStringList files; + TQStringList files; for(int i = 0; i < args->count(); i++) { files.append(args->url(i).url()); } diff --git a/kpackage/managementWidget.cpp b/kpackage/managementWidget.cpp index 50cda53..e8dbcb6 100644 --- a/kpackage/managementWidget.cpp +++ b/kpackage/managementWidget.cpp @@ -29,8 +29,8 @@ */ -#include <qsplitter.h> -#include <qtoolbutton.h> +#include <tqsplitter.h> +#include <tqtoolbutton.h> #include <klocale.h> #include <kdebug.h> @@ -52,7 +52,7 @@ extern Opts *opts; -KpListViewSearchLine::KpListViewSearchLine(QWidget *parent, KpTreeList *listView) +KpListViewSearchLine::KpListViewSearchLine(TQWidget *parent, KpTreeList *listView) :KListViewSearchLine(parent, listView) { list = listView; @@ -62,7 +62,7 @@ KpListViewSearchLine::~KpListViewSearchLine() { } -void KpListViewSearchLine::updateSearch(const QString &s) +void KpListViewSearchLine::updateSearch(const TQString &s) { list->expand(); KListViewSearchLine::updateSearch(s); @@ -72,27 +72,27 @@ void KpListViewSearchLine::updateSearch(const QString &s) // constructor -- initialise variables -managementWidget::managementWidget(QWidget *parent) - : QFrame(parent) +managementWidget::managementWidget(TQWidget *parent) + : TQFrame(parent) { install_action = 0; uninstall_action = 0; - allPackages = new QPtrList<packageInfo>; + allPackages = new TQPtrList<packageInfo>; tType[0] = i18n("Installed"); tType[1] = i18n("Updated"); tType[2] = i18n("New"); tType[3] = i18n("All"); - dirInstPackages = new QDict<packageInfo>(7717); - dirUninstPackages = new QDict<packageInfo>(7717); - dirInfoPackages = new QDict<packageInfo>(7717); + dirInstPackages = new TQDict<packageInfo>(7717); + dirUninstPackages = new TQDict<packageInfo>(7717); + dirInfoPackages = new TQDict<packageInfo>(7717); setupWidgets(); - connect(treeList,SIGNAL(updateMarked()), - this, SLOT( checkMarked())); + connect(treeList,TQT_SIGNAL(updateMarked()), + this, TQT_SLOT( checkMarked())); } managementWidget::~managementWidget() @@ -103,7 +103,7 @@ managementWidget::~managementWidget() // delete dirUninstPackages; } -void managementWidget::resizeEvent(QResizeEvent *) +void managementWidget::resizeEvent(TQResizeEvent *) { arrangeWidgets(); } @@ -111,46 +111,46 @@ void managementWidget::resizeEvent(QResizeEvent *) void managementWidget::setupWidgets() { - QTab t; + TQTab t; - top = new QBoxLayout(this,QBoxLayout::TopToBottom); - vPan = new QSplitter(QSplitter::Horizontal, this); + top = new TQBoxLayout(this,TQBoxLayout::TopToBottom); + vPan = new TQSplitter(TQSplitter::Horizontal, this); top->addWidget(vPan); // the left panel - leftpanel = new QFrame(vPan); - leftbox = new QBoxLayout(leftpanel,QBoxLayout::TopToBottom); + leftpanel = new TQFrame(vPan); + leftbox = new TQBoxLayout(leftpanel,TQBoxLayout::TopToBottom); - QTabBar *ltab = new QTabBar(leftpanel); + TQTabBar *ltab = new TQTabBar(leftpanel); treeList = new KpTreeList(leftpanel); for (int i = 0; i < 4; i++) { - QTab *t = new QTab(); + TQTab *t = new TQTab(); t->setText( tType[i] ); ltab->addTab(t); } // Quick Search Bar searchToolBar = new KToolBar( leftpanel, "search toolbar"); - QToolButton *clearSearch = new QToolButton(searchToolBar); + TQToolButton *clearSearch = new TQToolButton(searchToolBar); clearSearch->setTextLabel(i18n("Clear Search"), true); - clearSearch->setIconSet(SmallIconSet(QApplication::reverseLayout() ? "clear_left" + clearSearch->setIconSet(SmallIconSet(TQApplication::reverseLayout() ? "clear_left" : "locationbar_erase")); - (void) new QLabel(i18n("Search: "),searchToolBar); + (void) new TQLabel(i18n("Search: "),searchToolBar); searchLine = new KpListViewSearchLine(searchToolBar, treeList); // searchLine->setKeepParentsVisible(false); - connect( clearSearch, SIGNAL( pressed() ), searchLine, SLOT( clear() )); + connect( clearSearch, TQT_SIGNAL( pressed() ), searchLine, TQT_SLOT( clear() )); - QValueList<int> clist; clist.append(0); clist.append(2); + TQValueList<int> clist; clist.append(0); clist.append(2); searchLine->setSearchColumns(clist); searchToolBar->setStretchableWidget( searchLine ); - connect( treeList, SIGNAL( cleared() ), searchLine, SLOT( clear() )); + connect( treeList, TQT_SIGNAL( cleared() ), searchLine, TQT_SLOT( clear() )); - connect(ltab,SIGNAL(selected (int)),SLOT(tabChanged(int))); + connect(ltab,TQT_SIGNAL(selected (int)),TQT_SLOT(tabChanged(int))); ltab->setCurrentTab(treeList->treeType); leftbox->addWidget(ltab,10); @@ -159,16 +159,16 @@ void managementWidget::setupWidgets() leftbox->addStretch(); - lbuttons = new QBoxLayout(QBoxLayout::LeftToRight); + lbuttons = new TQBoxLayout(TQBoxLayout::LeftToRight); - luinstButton = new QPushButton(i18n("Uninstall Marked"),leftpanel); + luinstButton = new TQPushButton(i18n("Uninstall Marked"),leftpanel); luinstButton->setEnabled(FALSE); - connect(luinstButton,SIGNAL(clicked()), - SLOT(uninstallMultClicked())); - linstButton = new QPushButton(i18n("Install Marked"),leftpanel); + connect(luinstButton,TQT_SIGNAL(clicked()), + TQT_SLOT(uninstallMultClicked())); + linstButton = new TQPushButton(i18n("Install Marked"),leftpanel); linstButton->setEnabled(FALSE); - connect(linstButton,SIGNAL(clicked()), - SLOT(installMultClicked())); + connect(linstButton,TQT_SIGNAL(clicked()), + TQT_SLOT(installMultClicked())); leftbox->addLayout(lbuttons,0); // top level layout as child @@ -177,27 +177,27 @@ void managementWidget::setupWidgets() lbuttons->addWidget(luinstButton,1,AlignBottom); lbuttons->addStretch(1); - connect(treeList, SIGNAL(selectionChanged(QListViewItem *)), - SLOT(packageHighlighted(QListViewItem *))); + connect(treeList, TQT_SIGNAL(selectionChanged(TQListViewItem *)), + TQT_SLOT(packageHighlighted(TQListViewItem *))); // the right panel - rightpanel = new QFrame(vPan); - rightbox = new QBoxLayout(rightpanel,QBoxLayout::TopToBottom); + rightpanel = new TQFrame(vPan); + rightbox = new TQBoxLayout(rightpanel,TQBoxLayout::TopToBottom); packageDisplay = new packageDisplayWidget(rightpanel); - // connect(this, SIGNAL(changePackage(packageInfo *)), - // packageDisplay, SLOT(changePackage(packageInfo *))); + // connect(this, TQT_SIGNAL(changePackage(packageInfo *)), + // packageDisplay, TQT_SLOT(changePackage(packageInfo *))); - rbuttons = new QBoxLayout(QBoxLayout::LeftToRight); + rbuttons = new TQBoxLayout(TQBoxLayout::LeftToRight); - uinstButton = new QPushButton(i18n("Uninstall"),rightpanel); + uinstButton = new TQPushButton(i18n("Uninstall"),rightpanel); uinstButton->setEnabled(FALSE); - connect(uinstButton,SIGNAL(clicked()), - SLOT(uninstallSingleClicked())); - instButton = new QPushButton(i18n("Install"),rightpanel); + connect(uinstButton,TQT_SIGNAL(clicked()), + TQT_SLOT(uninstallSingleClicked())); + instButton = new TQPushButton(i18n("Install"),rightpanel); instButton->setEnabled(FALSE); - connect(instButton,SIGNAL(clicked()), - SLOT(installSingleClicked())); + connect(instButton,TQT_SIGNAL(clicked()), + TQT_SLOT(installSingleClicked())); // Setup the `right panel' layout @@ -235,7 +235,7 @@ void managementWidget::readPSeparator() int w1 = config->readNumEntry("panel1Width",200); int w2 = config->readNumEntry("panel2Width",200); - QValueList<int> size; + TQValueList<int> size; size << w1 << w2; vPan->setSizes(size); } @@ -309,15 +309,15 @@ void managementWidget::collectData(bool refresh) return; // if refresh not required already initialised } - QApplication::setOverrideCursor( waitCursor ); + TQApplication::setOverrideCursor( waitCursor ); // stop clear() sending selectionChanged signal - disconnect(treeList, SIGNAL(selectionChanged(QListViewItem *)), - this, SLOT(packageHighlighted(QListViewItem *))); + disconnect(treeList, TQT_SIGNAL(selectionChanged(TQListViewItem *)), + this, TQT_SLOT(packageHighlighted(TQListViewItem *))); treeList->hide(); // hide list tree treeList->clear(); // empty it - connect(treeList, SIGNAL(selectionChanged(QListViewItem *)), - SLOT(packageHighlighted(QListViewItem *))); + connect(treeList, TQT_SIGNAL(selectionChanged(TQListViewItem *)), + TQT_SLOT(packageHighlighted(TQListViewItem *))); packageDisplay->changePackage(0); @@ -326,7 +326,7 @@ void managementWidget::collectData(bool refresh) delete allPackages; } - allPackages = new QPtrList<packageInfo>; + allPackages = new TQPtrList<packageInfo>; allPackages->setAutoDelete(TRUE); dirInstPackages->clear(); @@ -343,7 +343,7 @@ void managementWidget::collectData(bool refresh) // Rebuild the list tree rebuildListTree(); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } // Rebuild the list tree @@ -384,7 +384,7 @@ void managementWidget::rebuildListTree() } // A package has been highlighted in the list tree -void managementWidget::packageHighlighted(QListViewItem *item) +void managementWidget::packageHighlighted(TQListViewItem *item) { treeList->packageHighlighted(item, packageDisplay); @@ -399,12 +399,12 @@ void managementWidget::packageHighlighted(QListViewItem *item) void managementWidget::installSingleClicked() { int result; - QPtrList<packageInfo> plist; + TQPtrList<packageInfo> plist; packageInfo *package = packageDisplay->package; if (package) { - QString filename = package->getFilename(); + TQString filename = package->getFilename(); kdDebug() << "File=" << filename <<"\n"; pkgInterface *interface = package->interface; if (interface->noFetch || !filename.isEmpty()) { @@ -414,7 +414,7 @@ void managementWidget::installSingleClicked() } result = interface->installation->exec(); - if (interface->installation->result() == QDialog::Accepted || + if (interface->installation->result() == TQDialog::Accepted || interface->installation->modified) { // it was accepted, so the package has been installed packageInfo *inf; @@ -433,9 +433,9 @@ void managementWidget::installSingleClicked() // kdDebug() << "Result=" << result <<"\n"; } else { - QString url = package->getUrl(); + TQString url = package->getUrl(); if (!url.isEmpty()) { - QString s = kpackage->fetchNetFile(url); + TQString s = kpackage->fetchNetFile(url); if (!s.isEmpty()) { packageDisplay->changePackage(package); setupInstButton(); @@ -457,14 +457,14 @@ void managementWidget::installMultClicked() int i; KpTreeListItem *it; packageInfo *inf; - QPtrList<packageInfo> **lst = new QPtrList<packageInfo>*[kpinterfaceN]; + TQPtrList<packageInfo> **lst = new TQPtrList<packageInfo>*[kpinterfaceN]; selList.clear(); treeList->findMarked(treeList->firstChild(), selList); for (i = 0; i < kpinterfaceN; i++) { if (kpinterface[i]) { - lst[i] = new QPtrList<packageInfo>; + lst[i] = new TQPtrList<packageInfo>; for (it = selList.first(); it != 0; it = selList.next()) { if (it->info->interface == kpinterface[i] && it->childCount() == 0 && @@ -505,7 +505,7 @@ void managementWidget::installMultClicked() void managementWidget::uninstallSingleClicked() { int result; - QPtrList<packageInfo> plist; + TQPtrList<packageInfo> plist; packageInfo *package = packageDisplay->package; @@ -517,7 +517,7 @@ void managementWidget::uninstallSingleClicked() } result = interface->uninstallation->exec(); - if(result == QDialog::Accepted || + if(result == TQDialog::Accepted || interface->installation->modified) { packageInfo *inf; for (inf = plist.first(); inf != 0; inf = plist.next()) { @@ -545,13 +545,13 @@ void managementWidget::uninstallMultClicked() int i; KpTreeListItem *it; packageInfo *inf; - QPtrList<packageInfo> **lst = new QPtrList<packageInfo>*[kpinterfaceN]; + TQPtrList<packageInfo> **lst = new TQPtrList<packageInfo>*[kpinterfaceN]; selList.clear(); treeList->findMarked(treeList->firstChild(), selList); for (i = 0; i < kpinterfaceN; i++) { if (kpinterface[i]) { - lst[i] = new QPtrList<packageInfo>; + lst[i] = new TQPtrList<packageInfo>; for (it = selList.first(); it != 0; it = selList.next()) { if (it->info->interface == kpinterface[i] && it->childCount() == 0 && @@ -596,7 +596,7 @@ void managementWidget::doChangePackage(packageInfo *p) /////////////////////////////////////////////////////////////////////////// -KpTreeListItem *managementWidget::search(QString str, bool subStr, bool wrap, +KpTreeListItem *managementWidget::search(TQString str, bool subStr, bool wrap, bool start) { return treeList->search(str, subStr, wrap, start); @@ -606,11 +606,11 @@ KpTreeListItem *managementWidget::search(QString str, bool subStr, bool wrap, /////////////////////////////////////////////////////////////////////////// KpTreeListItem *managementWidget::updatePackage(packageInfo *pki, bool install) { - QString version; + TQString version; KpTreeListItem *q; if (allPackages) { - QString name(pki->getProperty("name")); + TQString name(pki->getProperty("name")); if (pki->hasProperty("version")) version = pki->getProperty("version"); else @@ -618,7 +618,7 @@ KpTreeListItem *managementWidget::updatePackage(packageInfo *pki, bool install) pkgInterface *interface = pki->interface; packageInfo *pnew = interface->getPackageInfo('i', name, version); packageInfo *ptree; - QString pkgId = name + interface->typeID; + TQString pkgId = name + interface->typeID; if (install) { if (pnew) { diff --git a/kpackage/managementWidget.h b/kpackage/managementWidget.h index bf1c6d1..eefc4c7 100644 --- a/kpackage/managementWidget.h +++ b/kpackage/managementWidget.h @@ -43,14 +43,14 @@ // Standard Headers // Qt Headers -#include <qframe.h> -#include <qpushbutton.h> -#include <qptrlist.h> -#include <qstring.h> -#include <qlayout.h> -#include <qtabwidget.h> -#include <qlabel.h> -#include <qhbox.h> +#include <tqframe.h> +#include <tqpushbutton.h> +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqlayout.h> +#include <tqtabwidget.h> +#include <tqlabel.h> +#include <tqhbox.h> // KDE headers #include <kaction.h> @@ -74,12 +74,12 @@ class KpListViewSearchLine : public KListViewSearchLine public: - KpListViewSearchLine(QWidget *parent, KpTreeList *listView); + KpListViewSearchLine(TQWidget *parent, KpTreeList *listView); ~KpListViewSearchLine(); - void updateSearch(const QString &s = QString::null); + void updateSearch(const TQString &s = TQString::null); private: KpTreeList *list; @@ -92,7 +92,7 @@ class managementWidget : public QFrame ///////////// METHODS ------------------------------------------------------ public: - managementWidget(QWidget *parent); + managementWidget(TQWidget *parent); // Constructor ~managementWidget(); @@ -108,10 +108,10 @@ public: void doChangePackage(packageInfo *p); // emit change package - KpTreeListItem *search(QString str, bool subStr, bool wrap, + KpTreeListItem *search(TQString str, bool subStr, bool wrap, bool start=FALSE); protected: - void resizeEvent(QResizeEvent *re); + void resizeEvent(TQResizeEvent *re); // This is called when the widget is resized private: @@ -157,7 +157,7 @@ private: void setInstallAction(KAction *a) { install_action = a; } void setUninstallAction(KAction *a) { uninstall_action = a; } - void packageHighlighted(QListViewItem *); + void packageHighlighted(TQListViewItem *); // This is called when a package has been highlighted in the list tree void tabChanged(int); @@ -172,43 +172,43 @@ private: ///////////// DATA --------------------------------------------------------- private: - QPushButton *linstButton,*luinstButton,*instButton,*uinstButton; + TQPushButton *linstButton,*luinstButton,*instButton,*uinstButton; // This button is used to (un)install the selected package packageDisplayWidget *packageDisplay; // This widget displays the package info / file-list - QBoxLayout *top, *leftbox, *rightbox, *lbuttons, *rbuttons; + TQBoxLayout *top, *leftbox, *rightbox, *lbuttons, *rbuttons; // These are the geometry managers - QFrame *leftpanel, *rightpanel; + TQFrame *leftpanel, *rightpanel; // frame to put QBox in - QTabWidget *ltab; + TQTabWidget *ltab; // tab between various treelist displays - QSplitter *vPan; + TQSplitter *vPan; // veritcal panner between panels KToolBar *searchToolBar; - QPtrList<KpTreeListItem> selList; + TQPtrList<KpTreeListItem> selList; // list for selected packages - QString tType[4]; + TQString tType[4]; // identifiers for tree display public: - QPtrList<packageInfo> *allPackages; + TQPtrList<packageInfo> *allPackages; // The list of packages - QDict<packageInfo> *dirInstPackages; + TQDict<packageInfo> *dirInstPackages; // maps installed package name to package - QDict<packageInfo> *dirUninstPackages; + TQDict<packageInfo> *dirUninstPackages; // maps uninstalled package name to package - QDict<packageInfo> *dirInfoPackages; + TQDict<packageInfo> *dirInfoPackages; // maps Info package name to package KpTreeList *treeList; diff --git a/kpackage/options.cpp b/kpackage/options.cpp index d2c2c20..8d86470 100644 --- a/kpackage/options.cpp +++ b/kpackage/options.cpp @@ -32,19 +32,19 @@ #include "options.h" #include "cache.h" -#include <qvbox.h> -#include <qcheckbox.h> +#include <tqvbox.h> +#include <tqcheckbox.h> #include <klocale.h> #include <kdebug.h> #include <kurlrequester.h> -#include <qframe.h> -#include <qlabel.h> -#include <qgroupbox.h> -#include <qlayout.h> -#include <qlineedit.h> -#include <qbuttongroup.h> -#include <qradiobutton.h> -#include <qtabdialog.h> +#include <tqframe.h> +#include <tqlabel.h> +#include <tqgroupbox.h> +#include <tqlayout.h> +#include <tqlineedit.h> +#include <tqbuttongroup.h> +#include <tqradiobutton.h> +#include <tqtabdialog.h> #include <kcombobox.h> #include <klineedit.h> @@ -53,7 +53,7 @@ extern Opts *opts; ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -Options::Options(QWidget *parent) +Options::Options(TQWidget *parent) : KDialogBase(Tabbed, i18n("Options"), Ok | Cancel, Ok, parent, 0, false){ fRemote = false; @@ -70,25 +70,25 @@ Options::Options(QWidget *parent) } { - QVBox *page = addVBoxPage(i18n("&Types")); + TQVBox *page = addVBoxPage(i18n("&Types")); - framet = new QGroupBox(1,Qt::Horizontal,i18n("Handle Package Type"), page); + framet = new TQGroupBox(1,Qt::Horizontal,i18n("Handle Package Type"), page); - hh = new QGroupBox(1,Qt::Horizontal,i18n("Remote Host"),framet); - huse = new QCheckBox(i18n("Use remote host (Debian APT only):"),hh); - connect(huse, SIGNAL(clicked()), this, SLOT(useRemote())); + hh = new TQGroupBox(1,Qt::Horizontal,i18n("Remote Host"),framet); + huse = new TQCheckBox(i18n("Use remote host (Debian APT only):"),hh); + connect(huse, TQT_SIGNAL(clicked()), this, TQT_SLOT(useRemote())); hosts = new KComboBox( true, hh, "combo" ); KCompletion *comp = hosts->completionObject(); - connect(hosts,SIGNAL(returnPressed(const QString&)),comp,SLOT(addItem(const QString&))); - connect(hosts,SIGNAL(returnPressed()),this,SLOT(insHosts())); + connect(hosts,TQT_SIGNAL(returnPressed(const TQString&)),comp,TQT_SLOT(addItem(const TQString&))); + connect(hosts,TQT_SIGNAL(returnPressed()),this,TQT_SLOT(insHosts())); hosts->setMaxCount(20); hosts->setDuplicatesEnabled(false); - hosts->setInsertionPolicy(QComboBox::AtTop); - // hosts->setInsertionPolicy(QComboBox::NoInsertion); + hosts->setInsertionPolicy(TQComboBox::AtTop); + // hosts->setInsertionPolicy(TQComboBox::NoInsertion); hosts->setTrapReturnKey(true); int i; - QString msgStr; + TQString msgStr; for (i = 0; i < kpinterfaceN; i++) { if (kpinterface[i]) { if (kpinterface[i]->hasProgram) { @@ -99,11 +99,11 @@ Options::Options(QWidget *parent) .arg(kpinterface[i]->name) .arg(kpinterface[i]->errExe); } - packageBox[i] = new QGroupBox(2,Qt::Horizontal,msgStr, framet, "box"); - packageHandle[i] = new QCheckBox(i18n("Enable"), packageBox[i]); - connect(packageHandle[i], SIGNAL(clicked()), this, SLOT(scanLocates())); - locate[i] = new QPushButton(i18n("Location of Packages"),packageBox[i]); - connect(locate[i], SIGNAL(clicked()), kpinterface[i], SLOT(setLocation())); + packageBox[i] = new TQGroupBox(2,Qt::Horizontal,msgStr, framet, "box"); + packageHandle[i] = new TQCheckBox(i18n("Enable"), packageBox[i]); + connect(packageHandle[i], TQT_SIGNAL(clicked()), this, TQT_SLOT(scanLocates())); + locate[i] = new TQPushButton(i18n("Location of Packages"),packageBox[i]); + connect(locate[i], TQT_SIGNAL(clicked()), kpinterface[i], TQT_SLOT(setLocation())); } else { packageHandle[i] = 0; } @@ -111,81 +111,81 @@ Options::Options(QWidget *parent) } { - QVBox *page = addVBoxPage(i18n("Cac&he")); + TQVBox *page = addVBoxPage(i18n("Cac&he")); - bc = new QButtonGroup(page); + bc = new TQButtonGroup(page); bc->setTitle(i18n("Cache Remote Package Folders")); - connect( bc, SIGNAL(clicked(int)), SLOT(PDCache(int)) ); + connect( bc, TQT_SIGNAL(clicked(int)), TQT_SLOT(PDCache(int)) ); - QVBoxLayout* vc = new QVBoxLayout( bc, 15, 10, "vc"); + TQVBoxLayout* vc = new TQVBoxLayout( bc, 15, 10, "vc"); vc->addSpacing( bc->fontMetrics().height() ); - dcache[0] = new QRadioButton(i18n("Always"),bc); + dcache[0] = new TQRadioButton(i18n("Always"),bc); vc->addWidget(dcache[0]); - dcache[1] = new QRadioButton(i18n("During a session"),bc); + dcache[1] = new TQRadioButton(i18n("During a session"),bc); vc->addWidget(dcache[1]); - dcache[2] = new QRadioButton(i18n("Never"),bc); + dcache[2] = new TQRadioButton(i18n("Never"),bc); vc->addWidget(dcache[2]); - bp = new QButtonGroup(page); + bp = new TQButtonGroup(page); bp->setTitle(i18n("Cache Remote Package Files")); - connect( bp, SIGNAL(clicked(int)), SLOT(PPCache(int)) ); + connect( bp, TQT_SIGNAL(clicked(int)), TQT_SLOT(PPCache(int)) ); - QVBoxLayout* vp = new QVBoxLayout( bp, 15, 10, "vp"); + TQVBoxLayout* vp = new TQVBoxLayout( bp, 15, 10, "vp"); vp->addSpacing( bp->fontMetrics().height() ); - pcache[0] = new QRadioButton(i18n("Always"),bp); + pcache[0] = new TQRadioButton(i18n("Always"),bp); vp->addWidget(pcache[0]); - pcache[1] = new QRadioButton(i18n("During a session"),bp); + pcache[1] = new TQRadioButton(i18n("During a session"),bp); vp->addWidget(pcache[1]); - pcache[2] = new QRadioButton(i18n("Never"),bp); + pcache[2] = new TQRadioButton(i18n("Never"),bp); vp->addWidget(pcache[2]); - QGroupBox* cd = new QGroupBox (1, Qt::Horizontal, i18n("Cache Folder"), page) ; - cd->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Fixed) ; + TQGroupBox* cd = new TQGroupBox (1, Qt::Horizontal, i18n("Cache Folder"), page) ; + cd->setSizePolicy (TQSizePolicy::Expanding, TQSizePolicy::Fixed) ; cachedir = new KURLRequester("", cd, "cachedir"); } { - QWidget *page = addVBoxPage(i18n("&Misc")); - QVBoxLayout *vf = new QVBoxLayout(page); + TQWidget *page = addVBoxPage(i18n("&Misc")); + TQVBoxLayout *vf = new TQVBoxLayout(page); // vf->setSpacing(KDialog::spacingHint()); vf->setMargin(0); - bs = new QButtonGroup(page); + bs = new TQButtonGroup(page); bs->setTitle(i18n("Execute Privileged Commands Using")); - connect( bs, SIGNAL(clicked(int)), SLOT(PPrivs(int)) ); + connect( bs, TQT_SIGNAL(clicked(int)), TQT_SLOT(PPrivs(int)) ); - QVBoxLayout* vs = new QVBoxLayout( bs, 15, 10, "bs"); + TQVBoxLayout* vs = new TQVBoxLayout( bs, 15, 10, "bs"); vs->addSpacing( bs->fontMetrics().height() ); - privs[0] = new QRadioButton(i18n("su command"),bs); + privs[0] = new TQRadioButton(i18n("su command"),bs); vs->addWidget(privs[0]); - privs[1] = new QRadioButton(i18n("sudo command"),bs); + privs[1] = new TQRadioButton(i18n("sudo command"),bs); vs->addWidget(privs[1]); - privs[2] = new QRadioButton(i18n("ssh command"),bs); + privs[2] = new TQRadioButton(i18n("ssh command"),bs); vs->addWidget(privs[2]); - valid = new QCheckBox(i18n("Verify file list"), page, "valid"); + valid = new TQCheckBox(i18n("Verify file list"), page, "valid"); vf->addWidget(valid,0,AlignLeft); - pkgRead = new QCheckBox(i18n("Read information from all local package files"), page, "pkgr"); + pkgRead = new TQCheckBox(i18n("Read information from all local package files"), page, "pkgr"); vf->addWidget(pkgRead,0,AlignLeft); vf->addSpacing(100); } - connect( this, SIGNAL(okClicked()), SLOT(apply_slot()) ); - connect( this, SIGNAL(closeClicked()), SLOT(cancel_slot()) ); - connect( this, SIGNAL(cancelClicked()), SLOT(cancel_slot()) ); + connect( this, TQT_SIGNAL(okClicked()), TQT_SLOT(apply_slot()) ); + connect( this, TQT_SIGNAL(closeClicked()), TQT_SLOT(cancel_slot()) ); + connect( this, TQT_SIGNAL(cancelClicked()), TQT_SLOT(cancel_slot()) ); setValues(); @@ -195,7 +195,7 @@ Options::Options(QWidget *parent) void Options::insHosts() { // kdDebug() << "insHosts " << "\n"; bool found = false; - QString s = hosts->currentText(); + TQString s = hosts->currentText(); int i; for (i = 0; i < hosts->count(); i++) { @@ -309,7 +309,7 @@ void Options::apply_slot() insHosts(); opts->hostList.clear(); int i; - QString prev; + TQString prev; for (i = 0; i < hosts->count(); i++) { // kdDebug() << "=" << prev << "=" << hosts->text(i) << "=\n"; if (prev != hosts->text(i)) @@ -317,7 +317,7 @@ void Options::apply_slot() prev = hosts->text(i); } - QString remoteHost = hosts->currentText(); + TQString remoteHost = hosts->currentText(); if ((fRemote != huse->isChecked()) || huse->isChecked() && (remoteHost != hostName)) { newHost = true; @@ -333,7 +333,7 @@ void Options::apply_slot() opts->DCache = dc; opts->PCache = pc; opts->privCmd = prc; - cachedir->lineEdit()->setText (QDir(cachedir->lineEdit()->text()).path().append("/")) ; // make sure that cache directory ends with "/" + cachedir->lineEdit()->setText (TQDir(cachedir->lineEdit()->text()).path().append("/")) ; // make sure that cache directory ends with "/" opts->CacheDir = cachedir->lineEdit()->text() ; for (i = 0; i < kpinterfaceN; i++) { @@ -377,7 +377,7 @@ void Options::PPrivs(int r) ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -Opts::Opts(const QString &initHost) +Opts::Opts(const TQString &initHost) { readSettings(initHost); } @@ -386,7 +386,7 @@ Opts::~Opts() { } -void Opts::readSettings(const QString &initHost) +void Opts::readSettings(const TQString &initHost) { KConfig *config = kapp->config(); @@ -409,7 +409,7 @@ void Opts::readSettings(const QString &initHost) if (PCache >2) { PCache = 0; } - CacheDir = config->readPathEntry("Cache_Directory", QDir::homeDirPath() + "/.kpackage/"); + CacheDir = config->readPathEntry("Cache_Directory", TQDir::homeDirPath() + "/.kpackage/"); // Backward compatability bool useSSH = config->readNumEntry("Use_SSH",0); diff --git a/kpackage/options.h b/kpackage/options.h index 4f8b1e7..c1aa840 100644 --- a/kpackage/options.h +++ b/kpackage/options.h @@ -35,10 +35,10 @@ #include <stdio.h> // Qt Headers -#include <qdir.h> -#include <qwidget.h> -#include <qfiledialog.h> -#include <qgroupbox.h> +#include <tqdir.h> +#include <tqwidget.h> +#include <tqfiledialog.h> +#include <tqgroupbox.h> // KDE headers #include <kapplication.h> @@ -65,7 +65,7 @@ class Options : public KDialogBase public: - Options ( QWidget *parent = 0); + Options ( TQWidget *parent = 0); ~Options(); void restore(); @@ -80,45 +80,45 @@ private: bool PkgRead; bool fRemote; int DCache, dc, PCache, pc, privCmd, prc; - QString CacheDir; + TQString CacheDir; - QVBoxLayout* vl; + TQVBoxLayout* vl; - QVBoxLayout* vt; - QGroupBox *framet; - QGroupBox *packageBox[kpinterfaceN]; - QCheckBox *packageHandle[kpinterfaceN]; - QPushButton *locate[kpinterfaceN]; + TQVBoxLayout* vt; + TQGroupBox *framet; + TQGroupBox *packageBox[kpinterfaceN]; + TQCheckBox *packageHandle[kpinterfaceN]; + TQPushButton *locate[kpinterfaceN]; - QGroupBox *hh; - QCheckBox *huse; + TQGroupBox *hh; + TQCheckBox *huse; KComboBox *hosts; - QVBoxLayout* vb; - QButtonGroup *bg; - QRadioButton *disp[4]; + TQVBoxLayout* vb; + TQButtonGroup *bg; + TQRadioButton *disp[4]; - QVBoxLayout* vc; - QButtonGroup *bc; - QRadioButton *dcache[3]; + TQVBoxLayout* vc; + TQButtonGroup *bc; + TQRadioButton *dcache[3]; - QVBoxLayout* vp; - QButtonGroup *bp; - QRadioButton *pcache[3]; + TQVBoxLayout* vp; + TQButtonGroup *bp; + TQRadioButton *pcache[3]; - QVBoxLayout* vs; - QButtonGroup *bs; - QRadioButton *privs[3]; + TQVBoxLayout* vs; + TQButtonGroup *bs; + TQRadioButton *privs[3]; KURLRequester *cachedir; - QVBoxLayout* vr; - QGroupBox *framer; - QCheckBox *pkgRead; + TQVBoxLayout* vr; + TQGroupBox *framer; + TQCheckBox *pkgRead; - QVBoxLayout* vf; - QGroupBox *framem; - QCheckBox *valid; + TQVBoxLayout* vf; + TQGroupBox *framem; + TQCheckBox *valid; public slots: @@ -140,13 +140,13 @@ private slots: class Opts { public: - void readSettings(const QString &initHost = ""); + void readSettings(const TQString &initHost = ""); void writeSettings(); void readLaterSettings(); // options to be setup after package interfaces setup - QStringList hostList; + TQStringList hostList; // list of hosts to choose from bool VerifyFL; @@ -170,10 +170,10 @@ public: // which command to use to execute priveliged commands enum {SUcmd=0, SUDOcmd=1, SSHcmd=2}; - QString CacheDir; + TQString CacheDir; // cache directory - Opts(const QString &initHost); + Opts(const TQString &initHost); ~Opts(); }; ////////////////////////////////////////////////////////////////////////////// diff --git a/kpackage/packageDisplay.cpp b/kpackage/packageDisplay.cpp index 67b0754..6eabc9d 100644 --- a/kpackage/packageDisplay.cpp +++ b/kpackage/packageDisplay.cpp @@ -33,9 +33,9 @@ // Qt headers -#include <qapplication.h> -#include <qfileinfo.h> -#include <qtextedit.h> +#include <tqapplication.h> +#include <tqfileinfo.h> +#include <tqtextedit.h> #include <kdebug.h> #include <kiconloader.h> @@ -55,8 +55,8 @@ extern Opts *opts; // constructor -packageDisplayWidget::packageDisplayWidget(QWidget *parent) - : QTabWidget(parent) +packageDisplayWidget::packageDisplayWidget(TQWidget *parent) + : TQTabWidget(parent) { // Initially we're not dealing with any package package=NULL; @@ -68,7 +68,7 @@ packageDisplayWidget::packageDisplayWidget(QWidget *parent) tick = UserIcon("ptick"); cross = UserIcon("cross"); question = UserIcon("question"); - blank = new QPixmap(); + blank = new TQPixmap(); } @@ -79,20 +79,20 @@ packageDisplayWidget::~packageDisplayWidget() void packageDisplayWidget::setupWidgets() { - proptab = new QVBox( this); + proptab = new TQVBox( this); curTab = proptab; - fltab = new QVBox( this); - cltab = new QVBox( this); + fltab = new TQVBox( this); + cltab = new TQVBox( this); packageProperties = new packagePropertiesWidget(proptab); fileList = new kpFileList(fltab, this); - connect(fileList, SIGNAL(executed(QListViewItem *)), - this, SLOT( openBinding(QListViewItem *)) ); - connect(fileList, SIGNAL(returnPressed(QListViewItem *)), - this, SLOT( openBinding(QListViewItem *)) ); + connect(fileList, TQT_SIGNAL(executed(TQListViewItem *)), + this, TQT_SLOT( openBinding(TQListViewItem *)) ); + connect(fileList, TQT_SIGNAL(returnPressed(TQListViewItem *)), + this, TQT_SLOT( openBinding(TQListViewItem *)) ); - changeLog = new QTextEdit(cltab); + changeLog = new TQTextEdit(cltab); addTab(proptab, i18n("Properties")); addTab(fltab, i18n("File List")); @@ -105,18 +105,18 @@ void packageDisplayWidget::setupWidgets() if (isTabEnabled(proptab)) setTabEnabled(proptab,false); - connect(this,SIGNAL(currentChanged(QWidget *)), this, SLOT(tabSelected(QWidget *))); + connect(this,TQT_SIGNAL(currentChanged(TQWidget *)), this, TQT_SLOT(tabSelected(TQWidget *))); } -void packageDisplayWidget::tabSelected(QWidget *tab) +void packageDisplayWidget::tabSelected(TQWidget *tab) { curTab = tab; tabSet(tab); } -void packageDisplayWidget::tabSet(QWidget *tab) +void packageDisplayWidget::tabSet(TQWidget *tab) { - disconnect(this,SIGNAL(currentChanged(QWidget *)), this, SLOT(tabSelected(QWidget *))); + disconnect(this,TQT_SIGNAL(currentChanged(TQWidget *)), this, TQT_SLOT(tabSelected(TQWidget *))); if(tab == proptab) { packageProperties->show(); fileList->hide(); @@ -146,12 +146,12 @@ void packageDisplayWidget::tabSet(QWidget *tab) } setCurrentPage(2); } - connect(this,SIGNAL(currentChanged(QWidget *)), this, SLOT(tabSelected(QWidget *))); + connect(this,TQT_SIGNAL(currentChanged(TQWidget *)), this, TQT_SLOT(tabSelected(TQWidget *))); } void packageDisplayWidget::noPackage() { - disconnect(this,SIGNAL(currentChanged(QWidget *)), this, SLOT(tabSelected(QWidget *))); + disconnect(this,TQT_SIGNAL(currentChanged(TQWidget *)), this, TQT_SLOT(tabSelected(TQWidget *))); if (isTabEnabled(fltab)) { fileList->setColumnText(0,""); @@ -168,7 +168,7 @@ void packageDisplayWidget::noPackage() fileList->clear(); changeLog->setText(""); - connect(this,SIGNAL(currentChanged(QWidget *)), this, SLOT(tabSelected(QWidget *))); + connect(this,TQT_SIGNAL(currentChanged(TQWidget *)), this, TQT_SLOT(tabSelected(TQWidget *))); } // Change packages @@ -177,12 +177,12 @@ void packageDisplayWidget::changePackage(packageInfo *p) // This is to stop selectionChanged firing off here - disconnect(fileList, SIGNAL(executed(QListViewItem *)), - this, SLOT( openBinding(QListViewItem *)) ); - disconnect(fileList, SIGNAL(returnPressed(QListViewItem *)), - this, SLOT( openBinding(QListViewItem *)) ); - disconnect(fileList, SIGNAL(contextMenu(KListView *, QListViewItem *, const QPoint &)), - fileList, SLOT( openContext(KListView *, QListViewItem *, const QPoint &)) ); + disconnect(fileList, TQT_SIGNAL(executed(TQListViewItem *)), + this, TQT_SLOT( openBinding(TQListViewItem *)) ); + disconnect(fileList, TQT_SIGNAL(returnPressed(TQListViewItem *)), + this, TQT_SLOT( openBinding(TQListViewItem *)) ); + disconnect(fileList, TQT_SIGNAL(contextMenu(KListView *, TQListViewItem *, const TQPoint &)), + fileList, TQT_SLOT( openContext(KListView *, TQListViewItem *, const TQPoint &)) ); if (package && package != p) { @@ -196,12 +196,12 @@ void packageDisplayWidget::changePackage(packageInfo *p) if (!p) { // change to no package noPackage(); } else { - QString u = package->getFilename(); + TQString u = package->getFilename(); if (!package->updated && !u.isEmpty()) { packageInfo *np = package->interface->getPackageInfo('u', u, 0); if (np) { - QMap<QString, QString>::Iterator it; // update info entries in p + TQMap<TQString, TQString>::Iterator it; // update info entries in p for ( it = np->info.begin(); it != np->info.end(); ++it ) { package->info.replace(it.key(),it.data()); } @@ -230,12 +230,12 @@ void packageDisplayWidget::changePackage(packageInfo *p) } - connect(fileList, SIGNAL(executed(QListViewItem *)), - this, SLOT( openBinding(QListViewItem *)) ); - connect(fileList, SIGNAL(returnPressed(QListViewItem *)), - this, SLOT( openBinding(QListViewItem *)) ); - connect(fileList, SIGNAL(contextMenu(KListView *, QListViewItem *, const QPoint &)), - fileList, SLOT( openContext(KListView *, QListViewItem *, const QPoint &)) ); + connect(fileList, TQT_SIGNAL(executed(TQListViewItem *)), + this, TQT_SLOT( openBinding(TQListViewItem *)) ); + connect(fileList, TQT_SIGNAL(returnPressed(TQListViewItem *)), + this, TQT_SLOT( openBinding(TQListViewItem *)) ); + connect(fileList, TQT_SIGNAL(contextMenu(KListView *, TQListViewItem *, const TQPoint &)), + fileList, TQT_SLOT( openContext(KListView *, TQListViewItem *, const TQPoint &)) ); } @@ -244,8 +244,8 @@ void packageDisplayWidget::updateChangeLog() if (!package) return; - QStringList lines; - QString stmp; + TQStringList lines; + TQString stmp; lines = package->interface->getChangeLog(package); @@ -253,7 +253,7 @@ void packageDisplayWidget::updateChangeLog() changeLog->hide(); if (lines.count() > 1) { changeLog->setText(""); - for (QStringList::ConstIterator it = lines.begin(); + for (TQStringList::ConstIterator it = lines.begin(); (it != lines.end()); it++) { if (! (*it).isEmpty()) @@ -276,8 +276,8 @@ void packageDisplayWidget::updateFileList() return; // Get a list of files in the package - QStringList files; - QStringList errorfiles; + TQStringList files; + TQStringList errorfiles; // set the status kpackage->setStatus(i18n("Updating File List")); @@ -311,7 +311,7 @@ void packageDisplayWidget::updateFileList() uint c=0, p=0; uint step = (files.count() / 100) + 1; - QString ftmp; + TQString ftmp; ftmp.setNum(files.count()); ftmp += i18n(" Files"); @@ -319,10 +319,10 @@ void packageDisplayWidget::updateFileList() fileList->hide(); fileList->setSorting(-1); - QListViewItem *q; + TQListViewItem *q; // Go through all the files - for (QStringList::ConstIterator it = files.begin(); (it != files.end()); ) { + for (TQStringList::ConstIterator it = files.begin(); (it != files.end()); ) { // Update the status progress c++; if(c > step) { @@ -333,14 +333,14 @@ void packageDisplayWidget::updateFileList() int error=0; - QString cur = *it; + TQString cur = *it; it++; - QPixmap pixmap; + TQPixmap pixmap; if (installed) { // see if file failed verification, if ( errorfiles.count() > 0) { - for( QStringList::ConstIterator itError = errorfiles.begin(); + for( TQStringList::ConstIterator itError = errorfiles.begin(); (itError != errorfiles.end()); (itError++) ) { if (cur == *itError) { @@ -363,16 +363,16 @@ void packageDisplayWidget::updateFileList() kpackage->setPercent(100); } - kpFileList::kpFileList(QWidget* parent, packageDisplayWidget* parent2) : KListView(parent) + kpFileList::kpFileList(TQWidget* parent, packageDisplayWidget* parent2) : KListView(parent) { hide(); addColumn("name"); setRootIsDecorated(TRUE); - connect(this, SIGNAL(contextMenu(KListView *, QListViewItem *, const QPoint &)), - this, SLOT( openContext(KListView *, QListViewItem *, const QPoint &)) ); + connect(this, TQT_SIGNAL(contextMenu(KListView *, TQListViewItem *, const TQPoint &)), + this, TQT_SLOT( openContext(KListView *, TQListViewItem *, const TQPoint &)) ); FileListMenu = new KPopupMenu(); - openwith = FileListMenu->insertItem(i18n("&Open With..."),parent2,SLOT(__openBindingWith())); + openwith = FileListMenu->insertItem(i18n("&Open With..."),parent2,TQT_SLOT(__openBindingWith())); pkDisplay = parent2; } @@ -383,7 +383,7 @@ void packageDisplayWidget::updateFileList() openBindingWith(fileList->selectedItem()); } - void packageDisplayWidget::openBindingWith(QListViewItem *index) + void packageDisplayWidget::openBindingWith(TQListViewItem *index) { if ( !index ) return; KURL url; @@ -394,7 +394,7 @@ void packageDisplayWidget::updateFileList() } - void kpFileList::openContext(KListView *, QListViewItem *, const QPoint &p) + void kpFileList::openContext(KListView *, TQListViewItem *, const TQPoint &p) { FileListMenu->setItemEnabled(openwith, (selectedItem() && pkDisplay->package && pkDisplay->package->getFilename().isEmpty()) ? TRUE : FALSE); @@ -407,25 +407,25 @@ void packageDisplayWidget::updateFileList() KListView::clear(); } - QString kpFileList::item2Path(QListViewItem *it) + TQString kpFileList::item2Path(TQListViewItem *it) { - QString res; + TQString res; res = it ? it->text(0) : NULL; return res; } - QListViewItem* kpFileList::insert(const QString &cur, const QPixmap &pixmap) + TQListViewItem* kpFileList::insert(const TQString &cur, const TQPixmap &pixmap) { - QListViewItem* q; + TQListViewItem* q; - q = new QListViewItem(this, cur); + q = new TQListViewItem(this, cur); if (q) q->setPixmap(0,pixmap); return q; } - void packageDisplayWidget::openBinding(QListViewItem *index) + void packageDisplayWidget::openBinding(TQListViewItem *index) { if ( !index ) return; KURL url; diff --git a/kpackage/packageDisplay.h b/kpackage/packageDisplay.h index 5631925..c85ff52 100644 --- a/kpackage/packageDisplay.h +++ b/kpackage/packageDisplay.h @@ -9,7 +9,7 @@ // // The file list will be displayed using a tree list. // -// The widget is mainly a QTabDialog with two tabs: Info and FileList. +// The widget is mainly a TQTabDialog with two tabs: Info and FileList. // The Info tab is the default one. */ @@ -42,10 +42,10 @@ #include "../config.h" // Qt Headers -#include <qframe.h> -#include <qtabbar.h> -#include <qtabwidget.h> -#include <qvbox.h> +#include <tqframe.h> +#include <tqtabbar.h> +#include <tqtabwidget.h> +#include <tqvbox.h> #include <kpopupmenu.h> #include <klistview.h> @@ -60,18 +60,18 @@ class kpFileList : public KListView public: - kpFileList(QWidget* parent, packageDisplayWidget* parent2); + kpFileList(TQWidget* parent, packageDisplayWidget* parent2); - QString item2Path(QListViewItem *it); + TQString item2Path(TQListViewItem *it); public slots: - void openContext(KListView *, QListViewItem *, const QPoint &); + void openContext(KListView *, TQListViewItem *, const TQPoint &); virtual void clear(); - QListViewItem* insert(const QString &cur, const QPixmap &pixmap); + TQListViewItem* insert(const TQString &cur, const TQPixmap &pixmap); private: @@ -89,7 +89,7 @@ class packageDisplayWidget : public QTabWidget friend class kpFileList; ///////////// METHODS ------------------------------------------------------ public: - packageDisplayWidget(QWidget *parent=0); + packageDisplayWidget(TQWidget *parent=0); // Constructor ~packageDisplayWidget(); @@ -113,17 +113,17 @@ private: // This updates the change log to match that found with the currently // selected package - void tabSet(QWidget *); + void tabSet(TQWidget *); // Set display for corresponding tab ///////////// SLOTS -------------------------------------------------------- public slots: - void tabSelected(QWidget *); + void tabSelected(TQWidget *); - void openBinding(QListViewItem *); + void openBinding(TQListViewItem *); - void openBindingWith(QListViewItem *); + void openBindingWith(TQListViewItem *); void __openBindingWith(); @@ -137,21 +137,21 @@ public: private: - QTabWidget *tabbar; + TQTabWidget *tabbar; // The tab bar - QVBox *proptab, *fltab, *cltab; + TQVBox *proptab, *fltab, *cltab; - QWidget *curTab; + TQWidget *curTab; // current active tab kpFileList *fileList; // This holds the file list (and is used as a page on the tab dialog) - QTextEdit *changeLog; + TQTextEdit *changeLog; // Holds changelog - QPixmap tick, cross, question, *blank; + TQPixmap tick, cross, question, *blank; // The pixmaps for the filelist packagePropertiesWidget *packageProperties; 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", diff --git a/kpackage/packageInfo.h b/kpackage/packageInfo.h index be0dbb3..1ce24a3 100644 --- a/kpackage/packageInfo.h +++ b/kpackage/packageInfo.h @@ -45,12 +45,12 @@ #define PACKAGEINFO_H #include "../config.h" -#include <qmap.h> -#include <qdict.h> -#include <qstring.h> -#include <qpixmap.h> -#include <qptrlist.h> -#include <qlistview.h> +#include <tqmap.h> +#include <tqdict.h> +#include <tqstring.h> +#include <tqpixmap.h> +#include <tqptrlist.h> +#include <tqlistview.h> class pkgInterface; class KpTreeListItem; @@ -61,11 +61,11 @@ class KpTreeList; class packageInfo { public: - packageInfo(QMap<QString, QString> _info, pkgInterface *type); + packageInfo(TQMap<TQString, TQString> _info, pkgInterface *type); // Constructor: create a packageInfo object using the property // dictionary from _info - packageInfo(QMap<QString, QString> _info, const QString &_filename); + packageInfo(TQMap<TQString, TQString> _info, const TQString &_filename); // Constructor: same as above, but also sets filename to _filename. // This is used in the case that the package info was obtained from // an uninstalled package. @@ -76,12 +76,12 @@ public: /** * Look ups the property `property' from the dictionary */ - QString getProperty(const QString &property); + TQString getProperty(const TQString &property); /** * Checks whether the property `property' is defined in the dictionary */ - bool hasProperty(const QString &property); + bool hasProperty(const TQString &property); void fixup(); // Initialize fields if missing @@ -94,9 +94,9 @@ public: // returns the treelist item object for this package or // NULL if the object hasn't been placed - void setFilename(const QString &f); + void setFilename(const TQString &f); - QString getUrl(); + TQString getUrl(); // return URL of package file bool isFileLocal(); @@ -108,22 +108,22 @@ public: bool isFetchable(); // True if package needs to be fetched - QString getFilename(); + TQString getFilename(); - QString fetchFilename(); + TQString fetchFilename(); // gets the filename, fetching package if necessary int newer(packageInfo *p); // if package p is newer - void pkgFileIns(const QString &fileName); + void pkgFileIns(const TQString &fileName); // Insert a package from a file into package tree - bool pkgInsert(QPtrList<packageInfo> *pki, const QString &exp, bool installed, + bool pkgInsert(TQPtrList<packageInfo> *pki, const TQString &exp, bool installed, bool infoPackage = FALSE); // insert packgeInfo either installed or not installed - QMap<QString, QString> info; + TQMap<TQString, TQString> info; // This stores the property dictionary of the package KpTreeListItem *item; @@ -133,7 +133,7 @@ public: pkgInterface *interface; // interface points to the class of the package (deb, rpm etc) - bool smerge( const QString &exp); + bool smerge( const TQString &exp); // merge with already existing NOLIST package info bool display(int treeType); @@ -146,14 +146,14 @@ public: bool updated; private: - int getDigElement(const QString &s, int *pos); - QString getNdigElement(const QString &s, int *pos); + int getDigElement(const TQString &s, int *pos); + TQString getNdigElement(const TQString &s, int *pos); // break up version string - int pnewer(const QString &s, const QString &sp); + int pnewer(const TQString &s, const TQString &sp); // compare parts of a version string - QString url; + TQString url; // This stores the filename of the package the info was obtained from. // If it is empty then the info was obtained from an installed package. diff --git a/kpackage/packageProperties.cpp b/kpackage/packageProperties.cpp index b05a00c..2e1aca7 100644 --- a/kpackage/packageProperties.cpp +++ b/kpackage/packageProperties.cpp @@ -37,16 +37,16 @@ #include "managementWidget.h" packagePropertiesWidget::packagePropertiesWidget - (QWidget *parent) + (TQWidget *parent) : KTextBrowser(parent) { - QDict<QString> trl(53); - QStringList pList(); - QStringList cList(); + TQDict<TQString> trl(53); + TQStringList pList(); + TQStringList cList(); // hide(); package=NULL; - QColorGroup cg = colorGroup(); + TQColorGroup cg = colorGroup(); setBackgroundColor(cg.base()); initTranslate(); } @@ -55,9 +55,9 @@ packagePropertiesWidget::~packagePropertiesWidget() { } -void packagePropertiesWidget::iList(const QString &txt, const QString &itxt) +void packagePropertiesWidget::iList(const TQString &txt, const TQString &itxt) { - trl.insert(txt, new QString(itxt)); + trl.insert(txt, new TQString(itxt)); pList.append(txt); } @@ -115,7 +115,7 @@ void packagePropertiesWidget::changePackage(packageInfo *p) cList.clear(); if (p) { // append properties in ordered list to current list - for ( QStringList::Iterator s = pList.begin(); + for ( TQStringList::Iterator s = pList.begin(); s != pList.end(); ++s) { @@ -124,7 +124,7 @@ void packagePropertiesWidget::changePackage(packageInfo *p) } } // append other properties to end - QMap<QString, QString>::Iterator it; + TQMap<TQString, TQString>::Iterator it; for ( it = p->info.begin(); it != p->info.end(); ++it ) { if (!trl.find(it.key())) { if (!it.data().isEmpty()) @@ -138,11 +138,11 @@ void packagePropertiesWidget::changePackage(packageInfo *p) stmp += p->getProperty("name"); stmp += "</h1><hr/>"; stmp += "<table style='width: 100%; border: none; border-spacing: 4px;>"; - for ( QStringList::Iterator s = cList.begin(); + for ( TQStringList::Iterator s = cList.begin(); s != cList.end(); ++s) { - QString *pr = trl[*s]; - QString propName; + TQString *pr = trl[*s]; + TQString propName; if(pr) { propName = *pr; } else { @@ -152,10 +152,10 @@ void packagePropertiesWidget::changePackage(packageInfo *p) stmp += "<td style='vertical-align: top; font-weight: bold'>"; stmp += propName; stmp += "</td><td>"; - QString f = p->getProperty(*s); + TQString f = p->getProperty(*s); if (*s == "maintainer" || *s == "packager") { - f.replace(QRegExp("<"),"<"); - f.replace(QRegExp(">"),">"); + f.replace(TQRegExp("<"),"<"); + f.replace(TQRegExp(">"),">"); } if (*s == "filename") { int p = f.findRev("/"); @@ -186,40 +186,40 @@ void packagePropertiesWidget::changePackage(packageInfo *p) update(); } -void packagePropertiesWidget::depends(const QString &f) { +void packagePropertiesWidget::depends(const TQString &f) { // printf("d=%s\n",f.data()); int i = 0; - QStringList list = QStringList::split(',',f); - for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { + TQStringList list = TQStringList::split(',',f); + for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { if (i++ > 0) stmp += ","; dor((*it)); } } -void packagePropertiesWidget::dor(const QString &f) { +void packagePropertiesWidget::dor(const TQString &f) { // printf("o=%s\n",f.data()); int i = 0; - QStringList list = QStringList::split('|',f); - for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { + TQStringList list = TQStringList::split('|',f); + for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { if (i++ > 0) stmp += "|"; delement((*it)); } } -void packagePropertiesWidget::delement(const QString &f) { +void packagePropertiesWidget::delement(const TQString &f) { int n = f.find("("); if (n < 0) { n = f.length(); } - QString u = f.left(n); - QString uf = package->interface->provMap(u.stripWhiteSpace()); + TQString u = f.left(n); + TQString uf = package->interface->provMap(u.stripWhiteSpace()); - QString us = uf + package->interface->typeID; + TQString us = uf + package->interface->typeID; bool inst = false, uninst = false; if (kpackage->management->dirInstPackages->find(us)) { @@ -242,11 +242,11 @@ void packagePropertiesWidget::delement(const QString &f) { if (uninst) stmp += "</i>"; if (n < (signed)f.length()) - stmp += f.mid(n).replace(QRegExp("<"),"<"); + stmp += f.mid(n).replace(TQRegExp("<"),"<"); } -void packagePropertiesWidget::setSource(const QString &name) { - QString s = name; +void packagePropertiesWidget::setSource(const TQString &name) { + TQString s = name; if (s.startsWith("http:") || s.startsWith("ftp:")) { @@ -261,7 +261,7 @@ void packagePropertiesWidget::setSource(const QString &name) { s = s.mid(1); } - QString ind = s + package->interface->typeID; + TQString ind = s + package->interface->typeID; packageInfo *p = kpackage->management->dirInstPackages->find(ind); if (p) { kpackage->management->treeList->changePack(p->getItem(), package->getItem() != 0); diff --git a/kpackage/packageProperties.h b/kpackage/packageProperties.h index 0b7e035..e5532f3 100644 --- a/kpackage/packageProperties.h +++ b/kpackage/packageProperties.h @@ -36,9 +36,9 @@ // Standard Headers // Qt Headers -#include <qpainter.h> -#include <qstringlist.h> -#include <qregexp.h> +#include <tqpainter.h> +#include <tqstringlist.h> +#include <tqregexp.h> // KDE Headers #include <klocale.h> @@ -55,7 +55,7 @@ class packagePropertiesWidget : public KTextBrowser ///////////// METHODS ------------------------------------------------------ public: - packagePropertiesWidget(QWidget *parent=0); + packagePropertiesWidget(TQWidget *parent=0); // constructor ~packagePropertiesWidget(); @@ -63,7 +63,7 @@ public: void changePackage(packageInfo *p); - void setSource( const QString & name ); + void setSource( const TQString & name ); // url selected protected: @@ -75,27 +75,27 @@ private: packageInfo *package; void initTranslate(); - void iList(const QString &txt, const QString &itxt); + void iList(const TQString &txt, const TQString &itxt); - QDict<QString> trl ; + TQDict<TQString> trl ; // allow for translation of labels - QStringList pList; + TQStringList pList; // list specifying order of property distplay - QStringList cList; + TQStringList cList; // list giving order of currently displayed properties - QString stmp; + TQString stmp; // text accumulation buffer - void depends(const QString &f); + void depends(const TQString &f); // translate depends string - void dor(const QString &f); + void dor(const TQString &f); // translate depends string - void delement(const QString &f); + void delement(const TQString &f); // translate depends element }; diff --git a/kpackage/pkgInterface.cpp b/kpackage/pkgInterface.cpp index eeb6f74..7382ff5 100644 --- a/kpackage/pkgInterface.cpp +++ b/kpackage/pkgInterface.cpp @@ -39,7 +39,7 @@ extern Opts *opts; ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -param::param(const QString &nameP, bool initP, bool invertP, const QString &flagP) +param::param(const TQString &nameP, bool initP, bool invertP, const TQString &flagP) { name = nameP; init = initP; @@ -48,7 +48,7 @@ param::param(const QString &nameP, bool initP, bool invertP, const QString &fla flagA = ""; } -param::param(const QString &nameP, bool initP, bool invertP, const QString &flagP, const QString &flagAP ) +param::param(const TQString &nameP, bool initP, bool invertP, const TQString &flagP, const TQString &flagAP ) { name = nameP; init = initP; @@ -64,7 +64,7 @@ param::~param() ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -pkgInterface::pkgInterface( ) : QObject(), new_pict(), updated_pict() +pkgInterface::pkgInterface( ) : TQObject(), new_pict(), updated_pict() { packageLoc = 0; @@ -100,14 +100,14 @@ void pkgInterface::setMenu(KActionCollection*, bool ) } ////////////////////////////////////////////////////////////////////////////// -QStringList pkgInterface::depends(const QString &, int ) {return 0;} +TQStringList pkgInterface::depends(const TQString &, int ) {return 0;} -QString pkgInterface::doUninstall(int, const QString &, bool &) {return 0;} -QString pkgInterface::doInstall(int, const QString &, bool &) {return 0;} +TQString pkgInterface::doUninstall(int, const TQString &, bool &) {return 0;} +TQString pkgInterface::doInstall(int, const TQString &, bool &) {return 0;} //////////////////////////////////////////////////////////////////////////// -bool pkgInterface::ifExe(QString exe) { +bool pkgInterface::ifExe(TQString exe) { if (!KGlobal::dirs()->findExe( exe ).isNull()) { return TRUE; } else { @@ -118,12 +118,12 @@ bool pkgInterface::ifExe(QString exe) { } -void pkgInterface::listPackages(QPtrList<packageInfo> *pki) +void pkgInterface::listPackages(TQPtrList<packageInfo> *pki) { listInstalledPackages(pki); if (packageLoc) { for (cacheObj *cp = packageLoc->first(); cp != 0; cp = packageLoc->next()) { - QString s = getDir(cp); + TQString s = getDir(cp); if (!s.isEmpty()) listDir(pki, s, cp->location, cp->subdirs); } @@ -133,20 +133,20 @@ void pkgInterface::listPackages(QPtrList<packageInfo> *pki) void pkgInterface::smerge(packageInfo *) { } -void pkgInterface::listDir(QPtrList<packageInfo> *pki, const QString &fname, const QString &dir, bool subdirs) +void pkgInterface::listDir(TQPtrList<packageInfo> *pki, const TQString &fname, const TQString &dir, bool subdirs) { // fname - path to directory or cached remote infromation file // dir - url of directory - QString name, size, rfile; + TQString name, size, rfile; packageInfo *p; - QString sline( queryMsg + fname ); + TQString sline( queryMsg + fname ); kpackage->setStatus(sline); kdDebug() << "listDir fn=" << fname << " dir=" << dir << endl; - QDir d(fname,packagePattern); + TQDir d(fname,packagePattern); if (subdirs) d.setMatchAllDirs( TRUE ); // list contains subdirs @@ -155,16 +155,16 @@ void pkgInterface::listDir(QPtrList<packageInfo> *pki, const QString &fname, con if (d.exists()) { if ( d.isReadable() ) { - QString pn; + TQString pn; const QFileInfoList *list = d.entryInfoList(); QFileInfoListIterator it( *list ); // create list iterator - QFileInfo *fi; // pointer for traversing + TQFileInfo *fi; // pointer for traversing while ( (fi=it.current()) ) { // for each entry... if ( fi->isDir() ) { // entry is a subdir - if ( fi->fileName() != QString::fromLatin1(".") && - fi->fileName() != QString::fromLatin1("..") ) + if ( fi->fileName() != TQString::fromLatin1(".") && + fi->fileName() != TQString::fromLatin1("..") ) { // not current dir and not parent dir // -> recursive call: @@ -197,13 +197,13 @@ void pkgInterface::listDir(QPtrList<packageInfo> *pki, const QString &fname, con } } else { // directory is not readable - kdDebug() << QString("WARNING: directory '%1' not readable (will be ignored) !\n").arg(d.absPath() ) << endl; + kdDebug() << TQString("WARNING: directory '%1' not readable (will be ignored) !\n").arg(d.absPath() ) << endl; } } else { - QFile f(fname); + TQFile f(fname); if ( f.open(IO_ReadOnly) ) { - QTextStream t( &f ); - QString name; + TQTextStream t( &f ); + TQString name; while ( !t.eof() ) { name = t.readLine(); if (!t.eof() ) { @@ -222,13 +222,13 @@ void pkgInterface::listDir(QPtrList<packageInfo> *pki, const QString &fname, con } } -packageInfo *pkgInterface::collectDir(const QString &name, const QString &size, const QString &dir) +packageInfo *pkgInterface::collectDir(const TQString &name, const TQString &size, const TQString &dir) { kdDebug() << "collectDir " << name << " " << size << " " << dir << endl; - QString n,v; + TQString n,v; if (parseName(name, &n, &v)) { - QMap<QString, QString> a; + TQMap<TQString, TQString> a; a.insert("group", "NEW"); a.insert("name", n); @@ -245,17 +245,17 @@ packageInfo *pkgInterface::collectDir(const QString &name, const QString &size, return 0; } -QString pkgInterface::getPackList(cacheObj *cp) +TQString pkgInterface::getPackList(cacheObj *cp) { - QString tmpf; + TQString tmpf; int res; - QString url = cp->location; + TQString url = cp->location; kdDebug() << "pkgInterface::getPackList " << url << " " << cp->cacheFile << "\n"; if ((res = cacheObj::newDCache(url, cp->cacheFile, tmpf))) { if (res < 0) return 0; - unlink(QFile::encodeName(tmpf)); + unlink(TQFile::encodeName(tmpf)); if (kpkg) kpackage->setStatus(i18n("Starting Kio")); @@ -263,9 +263,9 @@ QString pkgInterface::getPackList(cacheObj *cp) if (kio.download(url, tmpf)) { if (kpkg) kpackage->setStatus(i18n("Kio finished")); - QFileInfo f(tmpf); + TQFileInfo f(tmpf); if (!(f.exists() && f.size() > 0)) { - unlink(QFile::encodeName(tmpf)); + unlink(TQFile::encodeName(tmpf)); return ""; } else { return tmpf; @@ -280,18 +280,18 @@ QString pkgInterface::getPackList(cacheObj *cp) } } -QString pkgInterface::getDir(cacheObj *cp) { +TQString pkgInterface::getDir(cacheObj *cp) { int res; - QString tmpDir; - QString url = cp->location; + TQString tmpDir; + TQString url = cp->location; if ((res = cacheObj::newDCache(url, cp->cacheFile, tmpDir))) { if (res < 0) - return QString::null; + return TQString::null; Kiod kiod; if (kiod.listDir(url,tmpDir, cp->subdirs)) { - QFileInfo fi (tmpDir); + TQFileInfo fi (tmpDir); CacheList cl (fi.dirPath()); cl.append (fi.fileName()); cl.write(); @@ -299,7 +299,7 @@ QString pkgInterface::getDir(cacheObj *cp) { } else { KpMsgE(i18n("Cannot read folder %1").arg(url),FALSE); unlink(tmpDir.ascii()); - return QString::null; + return TQString::null; } } else { return tmpDir; @@ -309,19 +309,19 @@ QString pkgInterface::getDir(cacheObj *cp) { ////////////////////////////////////////////////////////////////////////////// -QString pkgInterface::provMap(const QString &p) +TQString pkgInterface::provMap(const TQString &p) { // kdDebug() << "provMap=>" << p << endl; return p; } ////////////////////////////////////////////////////////////////////////////// -QStringList pkgInterface::verify(packageInfo *, const QStringList &files) +TQStringList pkgInterface::verify(packageInfo *, const TQStringList &files) { int p = 0; uint c = 0; - QStringList errorlist; - QDir d; + TQStringList errorlist; + TQDir d; if (hostName.isEmpty()) { @@ -330,7 +330,7 @@ QStringList pkgInterface::verify(packageInfo *, const QStringList &files) kpackage->setStatus(i18n("Verifying")); kpackage->setPercent(0); - for( QStringList::ConstIterator it = files.begin(); + for( TQStringList::ConstIterator it = files.begin(); it != files.end(); it++) { @@ -352,17 +352,17 @@ QStringList pkgInterface::verify(packageInfo *, const QStringList &files) } ////////////////////////////////////////////////////////////////////////////// -QString pkgInterface::uninstall(int uninstallFlags, packageInfo *p, bool &test) +TQString pkgInterface::uninstall(int uninstallFlags, packageInfo *p, bool &test) { - QString packs( p->getProperty("name")); + TQString packs( p->getProperty("name")); return doUninstall(uninstallFlags, packs, test); } ////////////////////////////////////////////////////////////////////////////// -QString pkgInterface::uninstall(int uninstallFlags, QPtrList<packageInfo> *p, bool &test) +TQString pkgInterface::uninstall(int uninstallFlags, TQPtrList<packageInfo> *p, bool &test) { - QString packs; + TQString packs; packageInfo *i; for (i = p->first(); i!= 0; i = p->next()) { @@ -373,21 +373,21 @@ QString pkgInterface::uninstall(int uninstallFlags, QPtrList<packageInfo> *p, bo } ////////////////////////////////////////////////////////////////////////////// -QString pkgInterface::install(int installFlags, packageInfo *p, bool &test) +TQString pkgInterface::install(int installFlags, packageInfo *p, bool &test) { - QString fname = p->fetchFilename(); + TQString fname = p->fetchFilename(); return doInstall(installFlags, fname, test); } ////////////////////////////////////////////////////////////////////////////// -QString pkgInterface::install(int installFlags, QPtrList<packageInfo> *p, bool &test) +TQString pkgInterface::install(int installFlags, TQPtrList<packageInfo> *p, bool &test) { - QString packs = ""; + TQString packs = ""; packageInfo *i; for (i = p->first(); i!= 0; i = p->next()) { - QString fname = i->fetchFilename(); + TQString fname = i->fetchFilename(); if (!fname.isEmpty()) { packs += fname; packs += " "; @@ -397,7 +397,7 @@ QString pkgInterface::install(int installFlags, QPtrList<packageInfo> *p, bool & } ////////////////////////////////////////////////////////////////////////////// -QStringList pkgInterface::listInstalls(const QStringList &packs, bool , bool &cancel) +TQStringList pkgInterface::listInstalls(const TQStringList &packs, bool , bool &cancel) { cancel = FALSE; return packs; @@ -405,10 +405,10 @@ QStringList pkgInterface::listInstalls(const QStringList &packs, bool , bool &c ////////////////////////////////////////////////////////////////////////////// -QString pkgInterface::setOptions(int flags, QPtrList<param> ¶ms) +TQString pkgInterface::setOptions(int flags, TQPtrList<param> ¶ms) { int i; - QString s; + TQString s; param *p; i = 0; @@ -423,12 +423,12 @@ QString pkgInterface::setOptions(int flags, QPtrList<param> ¶ms) return s; } - QStringList pkgInterface::readApt() + TQStringList pkgInterface::readApt() { return 0; } - void pkgInterface::writeApt(const QStringList &) + void pkgInterface::writeApt(const TQStringList &) { } diff --git a/kpackage/pkgInterface.h b/kpackage/pkgInterface.h index 3094af8..839ada2 100644 --- a/kpackage/pkgInterface.h +++ b/kpackage/pkgInterface.h @@ -29,9 +29,9 @@ #define PKG_IFACE_H #include "../config.h" -#include <qptrlist.h> -#include <qstring.h> -#include <qstringlist.h> +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqstringlist.h> #include <kglobal.h> #include <kstandarddirs.h> @@ -53,15 +53,15 @@ class KActionCollection; class param { public: - param(const QString &nameP, bool initP, bool invertP, const QString &flagP); - param(const QString &nameP, bool initP, bool invertP, const QString &flagP, const QString &flagAP); + param(const TQString &nameP, bool initP, bool invertP, const TQString &flagP); + param(const TQString &nameP, bool initP, bool invertP, const TQString &flagP, const TQString &flagAP); ~param(); - QString name; // Name of flag + TQString name; // Name of flag bool init; // Initial value bool invert; // Whether it needs to be inverted - QString flag; // text flag on command - QString flagA; // text flag on command + TQString flag; // text flag on command + TQString flagA; // text flag on command }; ////////////////////////////////////////////////////////////////////////////// @@ -74,33 +74,33 @@ public: pkgInterface(); virtual ~pkgInterface(); - virtual bool isType(char *buf, const QString &fname) = 0; + virtual bool isType(char *buf, const TQString &fname) = 0; // looks at start of file to check that package is correct type virtual void makeMenu(KActionCollection* act); virtual void setMenu(KActionCollection* act, bool enable); - bool ifExe(QString exe); + bool ifExe(TQString exe); // Check if this executable exists - virtual packageInfo *getPackageInfo(char mode, const QString &name, - const QString &version) = 0; + virtual packageInfo *getPackageInfo(char mode, const TQString &name, + const TQString &version) = 0; // get info on installed or uninstalled package. version is only set if // mode is 'i' (ie, if the package is already installed). - virtual QStringList getFileList(packageInfo *p) = 0; + virtual TQStringList getFileList(packageInfo *p) = 0; // get list of files in the package - virtual QStringList depends(const QString &name, int src); + virtual TQStringList depends(const TQString &name, int src); // check dependencies for package - virtual QStringList verify(packageInfo *p, const QStringList &files); + virtual TQStringList verify(packageInfo *p, const TQStringList &files); // check the installed files in a package - virtual QStringList FindFile(const QString &name, bool seachAll=false) = 0; + virtual TQStringList FindFile(const TQString &name, bool seachAll=false) = 0; // search for packages containg a file - virtual QStringList getChangeLog(packageInfo *p) = 0; + virtual TQStringList getChangeLog(packageInfo *p) = 0; // Get change log virtual bool filesTab(packageInfo *p) = 0; @@ -109,68 +109,68 @@ public: virtual bool changeTab(packageInfo *p) = 0; // If change log tab is to be enabled - virtual bool parseName(const QString &name, QString *n, QString *v) = 0; + virtual bool parseName(const TQString &name, TQString *n, TQString *v) = 0; // breakup file name into package name and version - virtual void listPackages(QPtrList<packageInfo> *pki); + virtual void listPackages(TQPtrList<packageInfo> *pki); // scan various locations for list of packages - virtual void listInstalledPackages(QPtrList<packageInfo> *pki) = 0; + virtual void listInstalledPackages(TQPtrList<packageInfo> *pki) = 0; // produce list of currently installed packages - virtual QStringList listInstalls(const QStringList &packs, bool install, bool &cancel); + virtual TQStringList listInstalls(const TQStringList &packs, bool install, bool &cancel); // Convert list of packages requested to install to list of all packages to install virtual void smerge(packageInfo *p); // merge in package info entry - QString getDir(cacheObj *cp); + TQString getDir(cacheObj *cp); // list directory local or remote - void listDir(QPtrList<packageInfo> *pki, const QString &fname, const QString &dir, bool subdirs = FALSE); + void listDir(TQPtrList<packageInfo> *pki, const TQString &fname, const TQString &dir, bool subdirs = FALSE); // list the packages in a directory - packageInfo *collectDir(const QString &name, const QString &size, const QString &dir); + packageInfo *collectDir(const TQString &name, const TQString &size, const TQString &dir); // build packageInfo object from directory entry - QString getPackList(cacheObj *cp); + TQString getPackList(cacheObj *cp); // get packages information file - virtual QString provMap(const QString &p); + virtual TQString provMap(const TQString &p); // convert from package depends to package - QString setOptions(int flags, QPtrList<param> ¶ms); + TQString setOptions(int flags, TQPtrList<param> ¶ms); // convert un/install flags to text - virtual QString doUninstall(int uninstallFlags, const QString &packs, bool &test); - virtual QString doInstall(int installFlags, const QString &packs, bool &test); - virtual QString uninstall(int uninstallFlags, QPtrList<packageInfo> *p, + virtual TQString doUninstall(int uninstallFlags, const TQString &packs, bool &test); + virtual TQString doInstall(int installFlags, const TQString &packs, bool &test); + virtual TQString uninstall(int uninstallFlags, TQPtrList<packageInfo> *p, bool &test); - virtual QString uninstall(int uninstallFlags, packageInfo *p, + virtual TQString uninstall(int uninstallFlags, packageInfo *p, bool &test); - virtual QString install(int installFlags, QPtrList<packageInfo> *p, + virtual TQString install(int installFlags, TQPtrList<packageInfo> *p, bool &test); - virtual QString install(int installFlags, packageInfo *p, + virtual TQString install(int installFlags, packageInfo *p, bool &test); - virtual QStringList readApt(); - virtual void writeApt(const QStringList &list); + virtual TQStringList readApt(); + virtual void writeApt(const TQStringList &list); ///////////// DATA /////////////////////// pkgOptions *uninstallation, *installation; - QString icon; + TQString icon; // name icon file - QString head; + TQString head; // capitalized name of package type - QString name; + TQString name; // More descriptive name - QPixmap pict, bad_pict, new_pict, updated_pict; + TQPixmap pict, bad_pict, new_pict, updated_pict; // icons for package states - QPixmap folder; + TQPixmap folder; // icon for package group - QPixmap markInst; - QPixmap markUnInst; + TQPixmap markInst; + TQPixmap markUnInst; // icon indicating mark for install/uninstall Locations *locatedialog; @@ -181,13 +181,13 @@ public: bool dirOK; // variables related to reading packages from directories - QString packagePattern; - QString queryMsg; - QString typeID; + TQString packagePattern; + TQString queryMsg; + TQString typeID; // Parameters for reading packages from directories - QPtrList<param> paramsInst; - QPtrList<param> paramsUninst; + TQPtrList<param> paramsInst; + TQPtrList<param> paramsUninst; bool noFetch; // kpackage doesn't fetch this type of package itself @@ -195,13 +195,13 @@ public: bool defaultHandle; // This package type defaults to on - QString errExe; + TQString errExe; // The name of an executable that wasn't found - QString procMsg; + TQString procMsg; // for running processes - QString DELMSG; + TQString DELMSG; bool hasRemote; // can access on remote host diff --git a/kpackage/pkgOptions.cpp b/kpackage/pkgOptions.cpp index 19a3c5e..bf3975e 100644 --- a/kpackage/pkgOptions.cpp +++ b/kpackage/pkgOptions.cpp @@ -27,7 +27,7 @@ #include "../config.h" // qt headers -#include <qlabel.h> +#include <tqlabel.h> #include <klocale.h> #include <kglobal.h> @@ -47,10 +47,10 @@ /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// -pkgOptions::pkgOptions(pkgInterface *pki, QWidget *parent, const QString &caption) +pkgOptions::pkgOptions(pkgInterface *pki, TQWidget *parent, const TQString &caption) : KDialog(parent,0,TRUE) { - // setFrameStyle(QFrame::Raised | QFrame::Panel); + // setFrameStyle(TQFrame::Raised | TQFrame::Panel); pkgInt = pki; @@ -69,55 +69,55 @@ pkgOptions::~pkgOptions() } // Set up the sub-widgets -void pkgOptions::setupWidgets(QPtrList<param> &pars) +void pkgOptions::setupWidgets(TQPtrList<param> &pars) { int i; // Create widgets - title = new QLabel("", this); - QFont f( KGlobalSettings::generalFont()); + title = new TQLabel("", this); + TQFont f( KGlobalSettings::generalFont()); f.setBold(true); f.setPointSize(f.pointSize()+6); title->setFont(f); // title->setAutoResize(TRUE); // title->update(); - installButton = new QPushButton(insType,this); + installButton = new TQPushButton(insType,this); cancelButton = new KPushButton(KStdGuiItem::cancel(),this); // count number of buttons bnumber = pars.count(); - Boxs = new QCheckBox *[bnumber]; + Boxs = new TQCheckBox *[bnumber]; param *p; i = 0; for ( p=pars.first(); p != 0; p=pars.next(), i++ ) { - Boxs[i] = new QCheckBox(p->name, this); + Boxs[i] = new TQCheckBox(p->name, this); Boxs[i]->setChecked(p->init); } - Keep = new QCheckBox(i18n("Keep this window"), this); + Keep = new TQCheckBox(i18n("Keep this window"), this); // Connections - connect(installButton,SIGNAL(clicked()),SLOT(pkginstallButtonClicked())); - connect(cancelButton,SIGNAL(clicked()),SLOT(cancelButtonClicked())); - connect(Keep, SIGNAL(toggled(bool)), SLOT(keepToggle(bool))); + connect(installButton,TQT_SIGNAL(clicked()),TQT_SLOT(pkginstallButtonClicked())); + connect(cancelButton,TQT_SIGNAL(clicked()),TQT_SLOT(cancelButtonClicked())); + connect(Keep, TQT_SIGNAL(toggled(bool)), TQT_SLOT(keepToggle(bool))); // Do the layout - vlayout = new QBoxLayout(this, QBoxLayout::TopToBottom, marginHint(), spacingHint()); + vlayout = new TQBoxLayout(this, TQBoxLayout::TopToBottom, marginHint(), spacingHint()); vlayout->addWidget(title,0); { - hlayout = new QBoxLayout(vlayout,QBoxLayout::LeftToRight, spacingHint()); + hlayout = new TQBoxLayout(vlayout,TQBoxLayout::LeftToRight, spacingHint()); { - layout = new QBoxLayout(hlayout,QBoxLayout::TopToBottom, spacingHint()); + layout = new TQBoxLayout(hlayout,TQBoxLayout::TopToBottom, spacingHint()); packages = new KListView(this); layout->addWidget(packages,20); packages->addColumn(i18n("PACKAGES"),200); - connect(packages, SIGNAL(selectionChanged ( QListViewItem * )), - this, SLOT(slotSearch( QListViewItem * ))); + connect(packages, TQT_SIGNAL(selectionChanged ( TQListViewItem * )), + this, TQT_SLOT(slotSearch( TQListViewItem * ))); layout->addStretch(1); for (i = 0; i < bnumber; i++) { @@ -125,14 +125,14 @@ void pkgOptions::setupWidgets(QPtrList<param> &pars) } layout->addWidget(new KSeparator(KSeparator::HLine, this), 2); - QBoxLayout *slayout = new QBoxLayout(layout, QBoxLayout::LeftToRight); + TQBoxLayout *slayout = new TQBoxLayout(layout, TQBoxLayout::LeftToRight); slayout->addStretch(1); slayout->addWidget(Keep, 1); slayout->addStretch(1); layout->addWidget(new KSeparator(KSeparator::HLine, this), 2); - QBoxLayout *buttons = new QBoxLayout(QBoxLayout::LeftToRight); + TQBoxLayout *buttons = new TQBoxLayout(TQBoxLayout::LeftToRight); layout->addLayout(buttons); buttons->addWidget(installButton,2); @@ -147,15 +147,15 @@ void pkgOptions::setupWidgets(QPtrList<param> &pars) resize(800, 400); } -void pkgOptions::setup(packageInfo *p, const QString &type) { - QPtrList<packageInfo> *pl = new QPtrList<packageInfo>; +void pkgOptions::setup(packageInfo *p, const TQString &type) { + TQPtrList<packageInfo> *pl = new TQPtrList<packageInfo>; pl->append(p); setup(pl,type); } -bool pkgOptions::setup(QPtrList<packageInfo> *pl, const QString &) +bool pkgOptions::setup(TQPtrList<packageInfo> *pl, const TQString &) { - QString s; + TQString s; modified = FALSE; packList = pl; @@ -163,11 +163,11 @@ bool pkgOptions::setup(QPtrList<packageInfo> *pl, const QString &) packages->clear(); packageInfo *p; - QStringList plist, rlist, clist; - QDict<QString> dict; - QString mark("x"); + TQStringList plist, rlist, clist; + TQDict<TQString> dict; + TQString mark("x"); for ( p = pl->first(); p != 0; p = pl->next() ) { - QString file = p->getFilename(); + TQString file = p->getFilename(); plist += p->getProperty("name"); if (file.isEmpty()) { clist += p->getProperty("name"); @@ -183,10 +183,10 @@ bool pkgOptions::setup(QPtrList<packageInfo> *pl, const QString &) reject(); return false; } - for ( QStringList::Iterator it = rlist.begin(); it != rlist.end(); ++it ) { + for ( TQStringList::Iterator it = rlist.begin(); it != rlist.end(); ++it ) { if (!dict[*it]) { plist.append(*it); - QString dirIndex = *it + pkgInt->typeID; + TQString dirIndex = *it + pkgInt->typeID; if (installer) { pk = kpackage->management->dirUninstPackages->find(dirIndex); } else { @@ -205,9 +205,9 @@ bool pkgOptions::setup(QPtrList<packageInfo> *pl, const QString &) s = i18n("%1: 1 %2 Package","%1: %n %2 Packages",plist.count()).arg(insType,pkgInt->name); title->setText(s); - for (QStringList::Iterator pit = plist.begin(); pit != plist.end(); ++pit ) { + for (TQStringList::Iterator pit = plist.begin(); pit != plist.end(); ++pit ) { // kdDebug() << "P=" << *pit << "\n"; - new QListViewItem(packages, *pit); + new TQListViewItem(packages, *pit); } cancelButton->setGuiItem(KStdGuiItem::cancel()); return TRUE; @@ -217,7 +217,7 @@ bool pkgOptions::setup(QPtrList<packageInfo> *pl, const QString &) void pkgOptions::pkginstallButtonClicked() { int i; - QStringList r; + TQStringList r; modified = TRUE; // Collect data from check boxes @@ -228,7 +228,7 @@ void pkgOptions::pkginstallButtonClicked() } test = FALSE; - QString s = doPackages(installFlags, packList, test); + TQString s = doPackages(installFlags, packList, test); // A "0=" or "1=" indicates it was actually (un)installed by the doPackages // routine instead of just returning a command to execute @@ -238,8 +238,8 @@ void pkgOptions::pkginstallButtonClicked() } else if (s.left(2) == "1=") { term->textIn(s.mid(2), true); } else { - connect(term,SIGNAL(result(QStringList &, int)), - this,SLOT(slotResult(QStringList &, int))); + connect(term,TQT_SIGNAL(result(TQStringList &, int)), + this,TQT_SLOT(slotResult(TQStringList &, int))); installButton->setEnabled(FALSE); @@ -252,9 +252,9 @@ void pkgOptions::pkginstallButtonClicked() } } -void pkgOptions::slotSearch(QListViewItem *item) +void pkgOptions::slotSearch(TQListViewItem *item) { - QString s = item->text(0); + TQString s = item->text(0); kdDebug() << "searchI=" << s << "h=" << pkgInt->head <<"\n"; packageInfo *p; @@ -269,12 +269,12 @@ void pkgOptions::slotSearch(QListViewItem *item) void pkgOptions::reset() { installButton->setEnabled(TRUE); cancelButton->setGuiItem(KGuiItem(i18n("Done"))); //clear icon - disconnect(term,SIGNAL(result(QStringList &, int)), - this,SLOT(slotResult(QStringList &, int))); + disconnect(term,TQT_SIGNAL(result(TQStringList &, int)), + this,TQT_SLOT(slotResult(TQStringList &, int))); running = FALSE; } -void pkgOptions::slotResult(QStringList &, int ret) +void pkgOptions::slotResult(TQStringList &, int ret) { reset(); if (ret == 0 && !test && !keep) { @@ -301,21 +301,21 @@ void pkgOptions::cancelButtonClicked() accept(); } -void pkgOptions::closeEvent ( QCloseEvent * e ) { +void pkgOptions::closeEvent ( TQCloseEvent * e ) { kdDebug() << "pkgOptions::QCloseEvent\n"; terminate(); - QWidget::closeEvent (e); + TQWidget::closeEvent (e); } -void pkgOptions::showEvent ( QShowEvent *e ) { +void pkgOptions::showEvent ( TQShowEvent *e ) { // kdDebug() << "pkgOptions::showEvent\n"; getKeep(); modified = FALSE; running = FALSE; - QWidget::showEvent(e); + TQWidget::showEvent(e); } void pkgOptions::keepToggle(bool kp) @@ -342,7 +342,7 @@ void pkgOptions::getKeep() /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// -pkgOptionsI::pkgOptionsI(pkgInterface *pkg, QWidget *parent): +pkgOptionsI::pkgOptionsI(pkgInterface *pkg, TQWidget *parent): pkgOptions(pkg, parent, i18n("Install")) { insType = i18n("Install"); @@ -350,14 +350,14 @@ pkgOptionsI::pkgOptionsI(pkgInterface *pkg, QWidget *parent): setupWidgets(pkg->paramsInst); } -QString pkgOptionsI::doPackages(int installFlags, QPtrList<packageInfo> *p, bool &test) +TQString pkgOptionsI::doPackages(int installFlags, TQPtrList<packageInfo> *p, bool &test) { return pkgInt->install(installFlags, p, test); } /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// -pkgOptionsU::pkgOptionsU(pkgInterface *pkg, QWidget *parent): +pkgOptionsU::pkgOptionsU(pkgInterface *pkg, TQWidget *parent): pkgOptions(pkg, parent, i18n("Uninstall")) { insType = i18n("Uninstall"); @@ -365,7 +365,7 @@ pkgOptionsU::pkgOptionsU(pkgInterface *pkg, QWidget *parent): setupWidgets(pkg->paramsUninst); } -QString pkgOptionsU::doPackages(int installFlags, QPtrList<packageInfo> *p, bool &test) +TQString pkgOptionsU::doPackages(int installFlags, TQPtrList<packageInfo> *p, bool &test) { return pkgInt->uninstall(installFlags, p, test); } diff --git a/kpackage/pkgOptions.h b/kpackage/pkgOptions.h index 707c340..1cf8d94 100644 --- a/kpackage/pkgOptions.h +++ b/kpackage/pkgOptions.h @@ -33,11 +33,11 @@ #include "../config.h" // Qt headers -#include <qframe.h> -#include <qlayout.h> -#include <qpushbutton.h> -#include <qlabel.h> -#include <qcheckbox.h> +#include <tqframe.h> +#include <tqlayout.h> +#include <tqpushbutton.h> +#include <tqlabel.h> +#include <tqcheckbox.h> #include <kdialog.h> @@ -53,20 +53,20 @@ class pkgOptions : public KDialog { Q_OBJECT public: - pkgOptions( pkgInterface *pki, QWidget *parent=0, const QString &caption=QString::null); + pkgOptions( pkgInterface *pki, TQWidget *parent=0, const TQString &caption=TQString::null); ~pkgOptions(); - bool setup(QPtrList<packageInfo> *pl, const QString &type); - void setup(packageInfo *p, const QString &type); + bool setup(TQPtrList<packageInfo> *pl, const TQString &type); + void setup(packageInfo *p, const TQString &type); void reset(); - virtual QString doPackages(int installFlags, QPtrList<packageInfo> *p, + virtual TQString doPackages(int installFlags, TQPtrList<packageInfo> *p, bool &test) = 0; - QCheckBox **Boxs; + TQCheckBox **Boxs; // options buttons - QCheckBox *Keep; + TQCheckBox *Keep; // keep window KListView *packages; @@ -74,7 +74,7 @@ public: int bnumber; // number of option buttons - QLabel *title; + TQLabel *title; // Widget title kpTerm *term; @@ -87,16 +87,16 @@ public: protected: // This sets up the sub-widgets - void setupWidgets(QPtrList<param> &pars); + void setupWidgets(TQPtrList<param> &pars); private slots: virtual void pkginstallButtonClicked(); virtual void cancelButtonClicked(); - void slotSearch(QListViewItem *item); + void slotSearch(TQListViewItem *item); void keepToggle(bool); public slots: - void slotResult(QStringList &rlist, int ret); + void slotResult(TQStringList &rlist, int ret); signals: // This signal indicates that the widget has finished. @@ -104,25 +104,25 @@ signals: protected: // The layout managers - QBoxLayout *layout, *hlayout, *vlayout; + TQBoxLayout *layout, *hlayout, *vlayout; // Sub widgets - QPushButton *installButton; + TQPushButton *installButton; KPushButton *cancelButton; - QString insType; + TQString insType; bool installer; // install or uninstall bool keep; // keep the window - QPtrList<packageInfo> *packList; + TQPtrList<packageInfo> *packList; void getKeep(); - void showEvent (QShowEvent *); - void closeEvent (QCloseEvent * e ); + void showEvent (TQShowEvent *); + void closeEvent (TQCloseEvent * e ); void terminate(); }; @@ -134,8 +134,8 @@ class pkgOptionsI: public pkgOptions { Q_OBJECT public: - pkgOptionsI(pkgInterface *pkg, QWidget *parent = 0); - QString doPackages(int installFlags, QPtrList<packageInfo> *p, bool &test); + pkgOptionsI(pkgInterface *pkg, TQWidget *parent = 0); + TQString doPackages(int installFlags, TQPtrList<packageInfo> *p, bool &test); }; /////////////////////////////////////////////////////////////////////////// @@ -144,8 +144,8 @@ class pkgOptionsU: public pkgOptions { Q_OBJECT public: - pkgOptionsU(pkgInterface *pkg, QWidget *parent = 0); - QString doPackages(int installFlags, QPtrList<packageInfo> *p, bool &test); + pkgOptionsU(pkgInterface *pkg, TQWidget *parent = 0); + TQString doPackages(int installFlags, TQPtrList<packageInfo> *p, bool &test); }; #endif diff --git a/kpackage/procbuf.cpp b/kpackage/procbuf.cpp index c994d70..568e651 100644 --- a/kpackage/procbuf.cpp +++ b/kpackage/procbuf.cpp @@ -29,13 +29,13 @@ #include <kprocess.h> #include "kpackage.h" #include <klocale.h> -#include <qlabel.h> +#include <tqlabel.h> #include <kdebug.h> -Modal::Modal(QString msg, QWidget *parent, const char * name ) +Modal::Modal(TQString msg, TQWidget *parent, const char * name ) : KDialog( parent, name, TRUE ) { - QLabel *line1 = new QLabel(msg,this); + TQLabel *line1 = new TQLabel(msg,this); line1->setAlignment(AlignCenter); line1->setAutoResize(true); @@ -49,24 +49,24 @@ void Modal::terminate() procbuf::procbuf() { m = NULL; - tm = new QTimer(this); - connect(tm, SIGNAL(timeout()), this, SLOT(slotTimeout())); + tm = new TQTimer(this); + connect(tm, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotTimeout())); } procbuf::~procbuf() { } -void procbuf::setup(QString cmd) +void procbuf::setup(TQString cmd) { buf.truncate(0); proc = new KProcess(); - connect(proc, SIGNAL( receivedStdout(KProcess *, char *, int)), - this, SLOT(slotReadInfo(KProcess *, char *, int))); - connect(proc, SIGNAL( receivedStderr(KProcess *, char *, int)), - this, SLOT(slotReadInfo(KProcess *, char *, int))); - connect(proc, SIGNAL( processExited(KProcess *)), - this, SLOT(slotExited(KProcess *))); + connect(proc, TQT_SIGNAL( receivedStdout(KProcess *, char *, int)), + this, TQT_SLOT(slotReadInfo(KProcess *, char *, int))); + connect(proc, TQT_SIGNAL( receivedStderr(KProcess *, char *, int)), + this, TQT_SLOT(slotReadInfo(KProcess *, char *, int))); + connect(proc, TQT_SIGNAL( processExited(KProcess *)), + this, TQT_SLOT(slotExited(KProcess *))); proc->clearArguments(); *proc << cmd; command = cmd; @@ -107,8 +107,8 @@ void procbuf::slotTimeout() // kdDebug() << "TTT\n"; } -int procbuf::start (QString msg, bool errorDlg, - int timeout, QString timeMsg ) +int procbuf::start (TQString msg, bool errorDlg, + int timeout, TQString timeMsg ) { if (timeout) { tm->start(timeout*1000, TRUE); diff --git a/kpackage/procbuf.h b/kpackage/procbuf.h index 8463810..be5bad3 100644 --- a/kpackage/procbuf.h +++ b/kpackage/procbuf.h @@ -29,8 +29,8 @@ #include "../config.h" #include <kprocess.h> #include <kdialog.h> -#include <qobject.h> -#include <qtimer.h> +#include <tqobject.h> +#include <tqtimer.h> #ifndef PROCBUF #define PROCBUF @@ -38,7 +38,7 @@ class Modal : public KDialog { Q_OBJECT public: - Modal(QString msg, QWidget *parent, const char * name ); + Modal(TQString msg, TQWidget *parent, const char * name ); void terminate(); }; @@ -49,16 +49,16 @@ class procbuf: public QObject public: procbuf(); ~procbuf(); - void setup(QString); - int start(QString msg, bool errorDlg = TRUE, - int timeout=0, QString timeMsg = ""); + void setup(TQString); + int start(TQString msg, bool errorDlg = TRUE, + int timeout=0, TQString timeMsg = ""); - QString buf; + TQString buf; KProcess *proc; Modal *m; - QString command; + TQString command; bool timed; - QTimer *tm; + TQTimer *tm; public slots: void slotReadInfo(KProcess *, char *, int); diff --git a/kpackage/rpmInterface.cpp b/kpackage/rpmInterface.cpp index 655e6b8..8096a78 100644 --- a/kpackage/rpmInterface.cpp +++ b/kpackage/rpmInterface.cpp @@ -59,8 +59,8 @@ RPM::RPM():pkgInterface() locatedialog->dLocations(7,6, this, i18n("Folder","F"), "Rpm","*.rpm", i18n("Location of Folders Containing RPM Packages")); - connect(locatedialog,SIGNAL(returnVal(LcacheObj *)), - this,SLOT(setAvail(LcacheObj *))); + connect(locatedialog,TQT_SIGNAL(returnVal(LcacheObj *)), + this,TQT_SLOT(setAvail(LcacheObj *))); locatedialog->apply_slot(); paramsInst.append(new param(i18n("Upgrade"),TRUE,FALSE,"-U","-i")); @@ -77,7 +77,7 @@ RPM::RPM():pkgInterface() queryMsg = i18n("Querying RPM package list: "); - QDict<QString> provides(1433,false); + TQDict<TQString> provides(1433,false); infoList.append("name/%{NAME}"); infoList.append("version/%{VERSION}"); @@ -101,7 +101,7 @@ RPM::RPM():pkgInterface() RPM::~RPM(){} -bool RPM::isType(char *buf, const QString & /* fname */) +bool RPM::isType(char *buf, const TQString & /* fname */) { if (hasProgram) { if ((unsigned char)buf[0] == 0355 && (unsigned char)buf[1] == 0253 && @@ -114,7 +114,7 @@ bool RPM::isType(char *buf, const QString & /* fname */) } } -bool RPM::parseName(const QString &name, QString *n, QString *v) +bool RPM::parseName(const TQString &name, TQString *n, TQString *v) { int d1, d2, s1, s2; @@ -136,10 +136,10 @@ bool RPM::parseName(const QString &name, QString *n, QString *v) return FALSE; } -QString RPM::packageQuery() { - QString cmd = " --queryformat '"; - for ( QStringList::Iterator it = infoList.begin(); it != infoList.end(); ++it ) { - QStringList s = QStringList::split("/",*it); +TQString RPM::packageQuery() { + TQString cmd = " --queryformat '"; + for ( TQStringList::Iterator it = infoList.begin(); it != infoList.end(); ++it ) { + TQStringList s = TQStringList::split("/",*it); cmd += "=="; cmd += s[0]; cmd += "\\n"; @@ -150,20 +150,20 @@ QString RPM::packageQuery() { return cmd; } -void RPM::listInstalledPackages(QPtrList<packageInfo> *pki) +void RPM::listInstalledPackages(TQPtrList<packageInfo> *pki) { int NLINES = 70000; packageInfo *p; - QStringList plist; + TQStringList plist; - QString cmd = "rpm -q -a"; + TQString cmd = "rpm -q -a"; cmd += packageQuery(); kpackage->setStatus(i18n("Querying RPM package list")); kpackage->setPercent(0); - QStringList list = kpty->run(cmd); + TQStringList list = kpty->run(cmd); kpackage->setStatus(i18n("Processing RPM package list")); // kdDebug() << "P=" << list.count() <<"\n"; kpackage->setPercent(50); @@ -171,11 +171,11 @@ void RPM::listInstalledPackages(QPtrList<packageInfo> *pki) if (list.count() > 0) { - QString s; + TQString s; kpackage->setPercent(0 ); int cnt = 0; - for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { + for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { cnt++; if (cnt % (NLINES/20) == 0) { kpackage->setPercent((cnt * 100)/ NLINES ); @@ -201,14 +201,14 @@ void RPM::listInstalledPackages(QPtrList<packageInfo> *pki) kpackage->setPercent(100); } -packageInfo* RPM::collectInfo(QStringList &ln) { +packageInfo* RPM::collectInfo(TQStringList &ln) { bool haveName = FALSE; - QMap<QString, QString> a; + TQMap<TQString, TQString> a; - QString name, value; + TQString name, value; - for ( QStringList::Iterator it = ln.begin(); it != ln.end(); ++it ) { + for ( TQStringList::Iterator it = ln.begin(); it != ln.end(); ++it ) { if ((*it).left(2) == "==" && (*it).length() >= 2) { name = (*it).right((*it).length() - 2); } @@ -231,8 +231,8 @@ packageInfo* RPM::collectInfo(QStringList &ln) { } else if (name == "buildtime") { a.insert("build-time", value); } else if (name == "requires") { - value = value.replace(QRegExp("\\(\\)"),""); - value = value.replace(QRegExp("\\( \\)"),""); + value = value.replace(TQRegExp("\\(\\)"),""); + value = value.replace(TQRegExp("\\( \\)"),""); value = value.stripWhiteSpace(); if (value.endsWith(",")) { value.truncate(value.length()-1); @@ -240,20 +240,20 @@ packageInfo* RPM::collectInfo(QStringList &ln) { a.insert("depends", value); } else if (name == "provides") { int s = 0, n; - QString t; + TQString t; if (!(*a.find("name")).isEmpty()) { while ((n = value.find(",",s)) > 0) { t = value.mid(s,n-s); t = t.stripWhiteSpace(); if (!t.isEmpty()) - provides.insert(t,new QString(*a.find("name"))); + provides.insert(t,new TQString(*a.find("name"))); s = n+1; } t = value.mid(s); t = t.stripWhiteSpace(); if (!t.isEmpty()) - provides.insert(t,new QString(*a.find("name"))); + provides.insert(t,new TQString(*a.find("name"))); value = value.stripWhiteSpace(); if (value.endsWith(",")) { @@ -268,8 +268,8 @@ packageInfo* RPM::collectInfo(QStringList &ln) { } - QString vers = a["version"]; - QString rel = a["release"]; + TQString vers = a["version"]; + TQString rel = a["release"]; if (!vers.isEmpty() && !rel.isEmpty()) { vers += "-"; vers += rel; @@ -289,10 +289,10 @@ packageInfo* RPM::collectInfo(QStringList &ln) { ////////////////////////////////////////////////////////////////////////////// -QStringList RPM::getChangeLog(packageInfo *p) +TQStringList RPM::getChangeLog(packageInfo *p) { - QStringList clog; - QString fn( p->getFilename()); + TQStringList clog; + TQString fn( p->getFilename()); if(!fn.isEmpty()) return getUChangeLog(fn); @@ -304,26 +304,26 @@ QStringList RPM::getChangeLog(packageInfo *p) // query an installed package -QStringList RPM::getIChangeLog(packageInfo *p) +TQStringList RPM::getIChangeLog(packageInfo *p) { - QString name = p->getProperty("name"); + TQString name = p->getProperty("name"); - QString cmd = "rpm -q --changelog "; + TQString cmd = "rpm -q --changelog "; cmd += name; - QStringList filelist = kpty->run(cmd); + TQStringList filelist = kpty->run(cmd); return filelist; } // query an uninstalled package -QStringList RPM::getUChangeLog(const QString &fn) +TQStringList RPM::getUChangeLog(const TQString &fn) { - QString cmd = "rpm -q --changelog -p "; + TQString cmd = "rpm -q --changelog -p "; cmd += quotePath(fn); - QStringList filelist = kpty->run(cmd); + TQStringList filelist = kpty->run(cmd); return filelist; } @@ -350,10 +350,10 @@ bool RPM::changeTab(packageInfo *p) { ////////////////////////////////////////////////////////////////////////////// -QStringList RPM::getFileList(packageInfo *p) +TQStringList RPM::getFileList(packageInfo *p) { - QStringList filelist; - QString fn( p->getFilename()); + TQStringList filelist; + TQString fn( p->getFilename()); if(!fn.isEmpty()) return getUFileList(fn); @@ -366,32 +366,32 @@ QStringList RPM::getFileList(packageInfo *p) // query an installed package -QStringList RPM::getIFileList(packageInfo *p) +TQStringList RPM::getIFileList(packageInfo *p) { - QString name = p->getProperty("name"); + TQString name = p->getProperty("name"); - QString cmd = "rpm -q -l "; + TQString cmd = "rpm -q -l "; cmd += name; - QStringList filelist = kpty->run(cmd); + TQStringList filelist = kpty->run(cmd); return filelist; } // query an uninstalled package -QStringList RPM::getUFileList(const QString &fn) +TQStringList RPM::getUFileList(const TQString &fn) { - QString cmd = "rpm -q -l -p "; + TQString cmd = "rpm -q -l -p "; cmd += quotePath(fn); - QStringList filelist = kpty->run(cmd); + TQStringList filelist = kpty->run(cmd); return filelist; } ////////////////////////////////////////////////////////////////////////////// -packageInfo *RPM::getPackageInfo(char mode, const QString &name, const QString &) +packageInfo *RPM::getPackageInfo(char mode, const TQString &name, const TQString &) { if (mode == 'i') { return getIPackageInfo(name); @@ -399,15 +399,15 @@ packageInfo *RPM::getPackageInfo(char mode, const QString &name, const QString & return getUPackageInfo(name); } -packageInfo *RPM::getIPackageInfo( const QString &name ) +packageInfo *RPM::getIPackageInfo( const TQString &name ) { // query an installed package! - QString cmd = "rpm -q"; + TQString cmd = "rpm -q"; cmd += packageQuery(); cmd += " "; cmd += name; - QStringList infoList = kpty->run(cmd); + TQStringList infoList = kpty->run(cmd); packageInfo *pki = collectInfo(infoList); if (pki) { pki->packageState = packageInfo::INSTALLED; @@ -416,15 +416,15 @@ packageInfo *RPM::getIPackageInfo( const QString &name ) return pki; } -packageInfo *RPM::getUPackageInfo( const QString &name ) +packageInfo *RPM::getUPackageInfo( const TQString &name ) { // query an uninstalled package - QString cmd = "rpm -q"; + TQString cmd = "rpm -q"; cmd += packageQuery(); cmd += " -p "; cmd += quotePath(name); - QStringList infoList = kpty->run(cmd); + TQStringList infoList = kpty->run(cmd); packageInfo *pki = collectInfo(infoList); if (pki) { pki->updated = TRUE; @@ -437,11 +437,11 @@ packageInfo *RPM::getUPackageInfo( const QString &name ) return pki; } -QString RPM::provMap( const QString &p ) +TQString RPM::provMap( const TQString &p ) { - QString *r = provides[p]; + TQString *r = provides[p]; if (r) { - QString s = *r; + TQString s = *r; // printf("%s=>%s\n",p.data(),s.data()); return s; } else { @@ -451,22 +451,22 @@ QString RPM::provMap( const QString &p ) ////////////////////////////////////////////////////////////////////////////// -void RPM::collectDepends(packageInfo *p, const QString &name, int src) +void RPM::collectDepends(packageInfo *p, const TQString &name, int src) { - QString cmd = "rpm -V --nofiles "; + TQString cmd = "rpm -V --nofiles "; if (src) { cmd += "-p "; } cmd += quotePath(name); // cmd = "cat /home/toivo/rpm.deps"; - QStringList list = kpty->run(cmd); + TQStringList list = kpty->run(cmd); if (list.count() > 0) { - QStringList::Iterator it = list.begin(); + TQStringList::Iterator it = list.begin(); int pt = (*it).find(":"); if (pt > 0) { - QString s = (*it).mid(pt+1); + TQString s = (*it).mid(pt+1); if (!s.isEmpty()) { // kdDebug() << "S=" << s << "\n"; p->info.insert("unsatisfied dependencies", s); @@ -491,9 +491,9 @@ void RPM::setAvail(LcacheObj *slist) ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -QString RPM::uninstall(int uninstallFlags, QPtrList<packageInfo> *plist, bool &test) +TQString RPM::uninstall(int uninstallFlags, TQPtrList<packageInfo> *plist, bool &test) { - QStringList files; + TQStringList files; packageInfo *pk; for (pk = plist->first(); pk != 0; pk = plist->next()) { @@ -507,9 +507,9 @@ QString RPM::uninstall(int uninstallFlags, QPtrList<packageInfo> *plist, bool &t } } -QString RPM::uninstall(int uninstallFlags, packageInfo *p, bool &test) +TQString RPM::uninstall(int uninstallFlags, packageInfo *p, bool &test) { - QStringList files; + TQStringList files; files.append( p->getProperty("name") ); if (getuid() == 0) { @@ -519,12 +519,12 @@ QString RPM::uninstall(int uninstallFlags, packageInfo *p, bool &test) } } -QString RPM::doUninstP(int uninstallFlags, const QStringList &files, bool &test) +TQString RPM::doUninstP(int uninstallFlags, const TQStringList &files, bool &test) { - QString s = "rpm -e "; + TQString s = "rpm -e "; s += setOptions(uninstallFlags, paramsUninst); - for (QStringList::ConstIterator it = files.begin(); it != files.end(); ++it ) { + for (TQStringList::ConstIterator it = files.begin(); it != files.end(); ++it ) { s += " "; s += *it; } @@ -541,12 +541,12 @@ QString RPM::doUninstP(int uninstallFlags, const QStringList &files, bool &test) ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -QString RPM::install(int installFlags, QPtrList<packageInfo> *plist, bool &test) +TQString RPM::install(int installFlags, TQPtrList<packageInfo> *plist, bool &test) { - QStringList files; + TQStringList files; for (packageInfo *pk = plist->first(); pk != 0; pk = plist->next()) { - QString fname( pk->fetchFilename() ); + TQString fname( pk->fetchFilename() ); if (!fname.isEmpty()) { files.append(quotePath(fname)); } @@ -559,9 +559,9 @@ QString RPM::install(int installFlags, QPtrList<packageInfo> *plist, bool &test) } } -QString RPM::install(int installFlags, packageInfo *p, bool &test) +TQString RPM::install(int installFlags, packageInfo *p, bool &test) { - QStringList files; + TQStringList files; files.append(quotePath(p->fetchFilename())); if (getuid() == 0) { return doinstP(installFlags,files,test); @@ -571,12 +571,12 @@ QString RPM::install(int installFlags, packageInfo *p, bool &test) } -QString RPM::doinstP(int installFlags, const QStringList &files, bool &test) +TQString RPM::doinstP(int installFlags, const TQStringList &files, bool &test) { - QString s = "rpm "; + TQString s = "rpm "; s += setOptions(installFlags, paramsInst); - for (QStringList::ConstIterator it = files.begin(); it != files.end(); ++it ) { + for (TQStringList::ConstIterator it = files.begin(); it != files.end(); ++it ) { s += " "; s += *it; } @@ -589,19 +589,19 @@ QString RPM::doinstP(int installFlags, const QStringList &files, bool &test) return s; } - QStringList RPM::verify(packageInfo *p, const QStringList &files){ + TQStringList RPM::verify(packageInfo *p, const TQStringList &files){ return pkgInterface::verify(p,files);} ////////////////////////////////////////////////////////////////////////////// -QStringList RPM::FindFile(const QString &name, bool) { - QString cmd = "rpm -q -a --filesbypkg"; +TQStringList RPM::FindFile(const TQString &name, bool) { + TQString cmd = "rpm -q -a --filesbypkg"; - QStringList list = kpty->run(cmd); - QStringList retlist; + TQStringList list = kpty->run(cmd); + TQStringList retlist; if (kpty->Result > 0) { list.clear(); } else { - for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { + for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { int p = (*it).find(" "); int nm = (*it).find(name,p); if (nm >= 0) { @@ -615,17 +615,17 @@ QStringList RPM::FindFile(const QString &name, bool) { } ////////////////////////////////////////////////////////////////////////////// -QString RPM::quotePath( const QString &path) { - QString s = path; +TQString RPM::quotePath( const TQString &path) { + TQString s = path; s = s.replace(" ","\\ "); return ( "'" + s + "'" ); } ////////////////////////////////////////////////////////////////////////////// - QStringList RPM::depends(const QString &, int){return 0;} + TQStringList RPM::depends(const TQString &, int){return 0;} - QString RPM::doUninst(int, const QStringList &, bool &){return "0=";} - QString RPM::doinst(int, const QStringList &, bool &){return "0=";} + TQString RPM::doUninst(int, const TQStringList &, bool &){return "0=";} + TQString RPM::doinst(int, const TQStringList &, bool &){return "0=";} #include "rpmInterface.moc" diff --git a/kpackage/rpmInterface.h b/kpackage/rpmInterface.h index a1357ef..a7db803 100644 --- a/kpackage/rpmInterface.h +++ b/kpackage/rpmInterface.h @@ -30,7 +30,7 @@ #include "../config.h" -#include <qptrlist.h> +#include <tqptrlist.h> #include "packageInfo.h" #include "pkgInterface.h" @@ -46,11 +46,11 @@ public: RPM(); ~RPM(); - bool isType(char *buf, const QString &fname); + bool isType(char *buf, const TQString &fname); - packageInfo *getPackageInfo(char mode, const QString &name, const QString &version); - QStringList getFileList(packageInfo *p); - QStringList getChangeLog(packageInfo *p); + packageInfo *getPackageInfo(char mode, const TQString &name, const TQString &version); + TQStringList getFileList(packageInfo *p); + TQStringList getChangeLog(packageInfo *p); bool filesTab(packageInfo *p); // If files tab is to be enabled @@ -58,50 +58,50 @@ public: bool changeTab(packageInfo *p); // If change log tab is to be enabled - QStringList depends(const QString &name, int src); - QStringList verify(packageInfo *p, const QStringList &files); + TQStringList depends(const TQString &name, int src); + TQStringList verify(packageInfo *p, const TQStringList &files); - QString uninstall(int uninstallFlags, QPtrList<packageInfo> *p, bool &test); - QString uninstall(int uninstallFlags, packageInfo *p, bool &test); - QString doUninst(int uninstallFlags, const QStringList &files, bool &test); - QString doUninstP(int uninstallFlags, const QStringList &files, bool &test); + TQString uninstall(int uninstallFlags, TQPtrList<packageInfo> *p, bool &test); + TQString uninstall(int uninstallFlags, packageInfo *p, bool &test); + TQString doUninst(int uninstallFlags, const TQStringList &files, bool &test); + TQString doUninstP(int uninstallFlags, const TQStringList &files, bool &test); - QString install(int installFlags, QPtrList<packageInfo> *p, bool &test); - QString install(int installFlags, packageInfo *p, bool &test); - QString doinst(int installFlags, const QStringList &files, bool &test); - QString doinstP(int installFlags, const QStringList &files, bool &test); + TQString install(int installFlags, TQPtrList<packageInfo> *p, bool &test); + TQString install(int installFlags, packageInfo *p, bool &test); + TQString doinst(int installFlags, const TQStringList &files, bool &test); + TQString doinstP(int installFlags, const TQStringList &files, bool &test); - QStringList FindFile(const QString &name, bool seachAll=false); - void collectDepends(packageInfo *p, const QString &name, int src); - bool parseName(const QString &name, QString *n, QString *v); + TQStringList FindFile(const TQString &name, bool seachAll=false); + void collectDepends(packageInfo *p, const TQString &name, int src); + bool parseName(const TQString &name, TQString *n, TQString *v); - QString provMap(const QString &p); + TQString provMap(const TQString &p); public slots: void setLocation(); void setAvail(LcacheObj *); private: - packageInfo* collectInfo(QStringList &ln); + packageInfo* collectInfo(TQStringList &ln); - void listInstalledPackages(QPtrList<packageInfo> *pki); + void listInstalledPackages(TQPtrList<packageInfo> *pki); - QDict<QString> provides; + TQDict<TQString> provides; bool rpmSetup; - QStringList infoList; + TQStringList infoList; - QString packageQuery(); + TQString packageQuery(); - QStringList getIFileList( packageInfo *p ); - QStringList getUFileList( const QString &fn ); + TQStringList getIFileList( packageInfo *p ); + TQStringList getUFileList( const TQString &fn ); - QStringList getIChangeLog( packageInfo *p ); - QStringList getUChangeLog( const QString &fn ); + TQStringList getIChangeLog( packageInfo *p ); + TQStringList getUChangeLog( const TQString &fn ); - packageInfo *getIPackageInfo( const QString &name); - packageInfo *getUPackageInfo( const QString &name); + packageInfo *getIPackageInfo( const TQString &name); + packageInfo *getUPackageInfo( const TQString &name); - QString quotePath( const QString &path); + TQString quotePath( const TQString &path); }; diff --git a/kpackage/search.cpp b/kpackage/search.cpp index e4254f4..2f774bf 100644 --- a/kpackage/search.cpp +++ b/kpackage/search.cpp @@ -30,52 +30,52 @@ #include "managementWidget.h" #include "search.h" #include <klocale.h> -#include <qlineedit.h> -#include <qcheckbox.h> -#include <qframe.h> -#include <qgroupbox.h> +#include <tqlineedit.h> +#include <tqcheckbox.h> +#include <tqframe.h> +#include <tqgroupbox.h> -Search::Search(QWidget *parent, const char * name) +Search::Search(TQWidget *parent, const char * name) : KDialogBase(parent, name, false, i18n("Find Package"), User1 | Close, User1, true, KGuiItem( i18n("&Find"), "find")) { - QFrame *page = makeMainWidget(); + TQFrame *page = makeMainWidget(); - setFocusPolicy(QWidget::StrongFocus); + setFocusPolicy(TQWidget::StrongFocus); - QVBoxLayout* vtop = new QVBoxLayout( page, 10, 10, "vtop"); + TQVBoxLayout* vtop = new TQVBoxLayout( page, 10, 10, "vtop"); - QFrame *frame1 = new QGroupBox(i18n("Find Package"), page, "frame1"); + TQFrame *frame1 = new TQGroupBox(i18n("Find Package"), page, "frame1"); vtop->addWidget(frame1,1); - QVBoxLayout* vf = new QVBoxLayout( frame1, 20, 10, "vf"); + TQVBoxLayout* vf = new TQVBoxLayout( frame1, 20, 10, "vf"); - value = new QLineEdit( frame1, "v"); + value = new TQLineEdit( frame1, "v"); vf->addWidget(value,0); value->setFocus(); value->setFixedHeight(value->sizeHint().height()); value->setMinimumWidth(250); - connect(value, SIGNAL(textChanged(const QString &)),this, SLOT(textChanged(const QString &))); + connect(value, TQT_SIGNAL(textChanged(const TQString &)),this, TQT_SLOT(textChanged(const TQString &))); - QHBoxLayout* hc = new QHBoxLayout( ); + TQHBoxLayout* hc = new TQHBoxLayout( ); vf->addLayout(hc,0); - substr = new QCheckBox(i18n("Sub string"), frame1, "substr"); + substr = new TQCheckBox(i18n("Sub string"), frame1, "substr"); substr->setChecked(TRUE); hc->addWidget(substr,1,AlignLeft); substr->setFixedSize(substr->sizeHint()); hc->addStretch(1); - wrap = new QCheckBox(i18n("Wrap search"), frame1, "wrap"); + wrap = new TQCheckBox(i18n("Wrap search"), frame1, "wrap"); wrap->setChecked(TRUE); hc->addWidget(wrap,1,AlignRight); wrap->setFixedSize(wrap->sizeHint()); enableButton( User1, false ); - connect(this, SIGNAL(user1Clicked()), this, SLOT(ok_slot())); - connect(this, SIGNAL(closeClicked()), this, SLOT(done_slot())); + connect(this, TQT_SIGNAL(user1Clicked()), this, TQT_SLOT(ok_slot())); + connect(this, TQT_SIGNAL(closeClicked()), this, TQT_SLOT(done_slot())); show(); } @@ -84,16 +84,16 @@ Search::~Search() { } -void Search::textChanged(const QString &text) +void Search::textChanged(const TQString &text) { enableButton( User1, !text.isEmpty() ); } void Search::ok_slot() { - QListViewItem *pkg; + TQListViewItem *pkg; - QString to_find = value->text(); + TQString to_find = value->text(); to_find = to_find.stripWhiteSpace(); pkg = kpackage->management->search(to_find, diff --git a/kpackage/search.h b/kpackage/search.h index e5ae2cd..51987d0 100644 --- a/kpackage/search.h +++ b/kpackage/search.h @@ -49,13 +49,13 @@ class Search : public KDialogBase public: - Search ( QWidget *parent = 0, const char * name=0); + Search ( TQWidget *parent = 0, const char * name=0); ~Search(); private: - QCheckBox *substr; - QCheckBox *wrap; - QLineEdit *value; + TQCheckBox *substr; + TQCheckBox *wrap; + TQLineEdit *value; signals: void search_signal(); @@ -64,6 +64,6 @@ signals: public slots: void done_slot(); void ok_slot(); - void textChanged(const QString &); + void textChanged(const TQString &); }; #endif diff --git a/kpackage/slackInterface.cpp b/kpackage/slackInterface.cpp index 8b80f2d..6e6d993 100644 --- a/kpackage/slackInterface.cpp +++ b/kpackage/slackInterface.cpp @@ -34,9 +34,9 @@ #include <setjmp.h> -#include <qdir.h> -#include <qfileinfo.h> -#include <qregexp.h> +#include <tqdir.h> +#include <tqfileinfo.h> +#include <tqregexp.h> #include <kurl.h> #include <kglobal.h> @@ -92,8 +92,8 @@ SLACK::SLACK():pkgInterface() "Slackware", "*.tgz *.tar.gz", i18n("Location of Folders Containing Slackware Packages")); - connect(locatedialog,SIGNAL(returnVal(LcacheObj *)), - this,SLOT(setAvail(LcacheObj *))); + connect(locatedialog,TQT_SIGNAL(returnVal(LcacheObj *)), + this,TQT_SLOT(setAvail(LcacheObj *))); locatedialog->apply_slot(); paramsInst.append(new param(i18n("Test (do not install)"),FALSE,FALSE,"-warn")); @@ -114,26 +114,26 @@ SLACK::~SLACK() ////////////////////////////////////////////////////////////////////////////// void SLACK::initTranslate() { - trl = new QDict<QString>(53); - - trl->insert("a",new QString(i18n("Base System"))); - trl->insert("ap",new QString(i18n("Linux Applications"))); - trl->insert("d",new QString(i18n("Program Development"))); - trl->insert("e",new QString(i18n("GNU EMacs"))); - trl->insert("f",new QString(i18n("FAQs"))); - trl->insert("k",new QString(i18n("Kernel Source"))); - trl->insert("n",new QString(i18n("Networking"))); - trl->insert("t",new QString(i18n("TeX Distribution"))); - trl->insert("tcl",new QString(i18n("TCL Script Language"))); - trl->insert("x",new QString(i18n("X Window System"))); - trl->insert("xap",new QString(i18n("X Applications"))); - trl->insert("xd",new QString(i18n("X Development Tools"))); - trl->insert("xv",new QString(i18n("XView and OpenLook"))); - trl->insert("y",new QString(i18n("Games"))); + trl = new TQDict<TQString>(53); + + trl->insert("a",new TQString(i18n("Base System"))); + trl->insert("ap",new TQString(i18n("Linux Applications"))); + trl->insert("d",new TQString(i18n("Program Development"))); + trl->insert("e",new TQString(i18n("GNU EMacs"))); + trl->insert("f",new TQString(i18n("FAQs"))); + trl->insert("k",new TQString(i18n("Kernel Source"))); + trl->insert("n",new TQString(i18n("Networking"))); + trl->insert("t",new TQString(i18n("TeX Distribution"))); + trl->insert("tcl",new TQString(i18n("TCL Script Language"))); + trl->insert("x",new TQString(i18n("X Window System"))); + trl->insert("xap",new TQString(i18n("X Applications"))); + trl->insert("xd",new TQString(i18n("X Development Tools"))); + trl->insert("xv",new TQString(i18n("XView and OpenLook"))); + trl->insert("y",new TQString(i18n("Games"))); } // check if slack file -bool SLACK::isType(char *buf, const QString &) +bool SLACK::isType(char *buf, const TQString &) { if (hasProgram) { if ((unsigned char)buf[0] == 037 && (unsigned char)buf[1] == 0213 ) { @@ -145,21 +145,21 @@ bool SLACK::isType(char *buf, const QString &) } } -bool SLACK::parseName(const QString &name, QString *n, QString *v) +bool SLACK::parseName(const TQString &name, TQString *n, TQString *v) { int s1; s1 = name.findRev('.'); if (s1 > 0) { *n = name.left(s1); - v = new QString(""); + v = new TQString(""); return TRUE; } return FALSE; } -void SLACK::listPackages(QPtrList<packageInfo> *pki) +void SLACK::listPackages(TQPtrList<packageInfo> *pki) { - QString s; + TQString s; cacheObj *cp; if (packageLoc) { @@ -195,23 +195,23 @@ void SLACK::listPackages(QPtrList<packageInfo> *pki) } } -void SLACK::listInstalledPackages(QPtrList<packageInfo> *pki) +void SLACK::listInstalledPackages(TQPtrList<packageInfo> *pki) { FILE *file; char linebuf[1024]; - QString vb; + TQString vb; packageInfo *p; - QString fn, dr = DIR; + TQString fn, dr = DIR; - QDir d(DIR); + TQDir d(DIR); if (d.exists()) { - QString sline = i18n("Querying SLACK package list: "); + TQString sline = i18n("Querying SLACK package list: "); kpackage->setStatus(sline); const QFileInfoList *list = d.entryInfoList(); int count = list->count(); QFileInfoListIterator it( *list ); // create list iterator - QFileInfo *fi; // pointer for traversing + TQFileInfo *fi; // pointer for traversing kpackage->setPercent(0); int cnt = 0; @@ -222,9 +222,9 @@ void SLACK::listInstalledPackages(QPtrList<packageInfo> *pki) if (!fi->isDir() && fi->isReadable()) { fn = dr + fi->fileName(); - file = fopen(QFile::encodeName(fn),"r"); + file = fopen(TQFile::encodeName(fn),"r"); if (file) { - vb = QString::null; + vb = TQString::null; while (fgets(linebuf,sizeof(linebuf),file)) { if (strcmp(linebuf,FILELIST)) { vb += linebuf; @@ -249,22 +249,22 @@ void SLACK::listInstalledPackages(QPtrList<packageInfo> *pki) } ////////////////////////////////////////////////////////////////////////////// -void SLACK::listPackList(QPtrList<packageInfo> *pki, const QString &s, cacheObj *cp, int insState) +void SLACK::listPackList(TQPtrList<packageInfo> *pki, const TQString &s, cacheObj *cp, int insState) { int np; - QString vb; + TQString vb; char linebuf[1024]; FILE *file; packageInfo *p; - QString sline = i18n("Querying SLACK package list: "); + TQString sline = i18n("Querying SLACK package list: "); sline += cp->location; kpackage->setStatus(sline); kpackage->setPercent(0); np = 0; - file= fopen(QFile::encodeName(s), "r"); + file= fopen(TQFile::encodeName(s), "r"); vb = ""; if (file) { @@ -303,12 +303,12 @@ void SLACK::listPackList(QPtrList<packageInfo> *pki, const QString &s, cacheObj ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// // mode: i = query installed u = query uninstalled -packageInfo *SLACK::getPackageInfo(char mode, const QString &name, const QString &) +packageInfo *SLACK::getPackageInfo(char mode, const TQString &name, const TQString &) { char linebuf[1024]; packageInfo *pki = 0; - QString vb, search, fn; - QString n,v; + TQString vb, search, fn; + TQString n,v; FILE *file; switch(mode) { @@ -316,9 +316,9 @@ packageInfo *SLACK::getPackageInfo(char mode, const QString &name, const QString // query an installed package! case 'i': fn = DIR + name; - file = fopen(QFile::encodeName(fn),"r"); + file = fopen(TQFile::encodeName(fn),"r"); if (file) { - vb = QString::null; + vb = TQString::null; while (fgets(linebuf,sizeof(linebuf),file)) { if (strcmp(linebuf,FILELIST)) { vb += linebuf; @@ -337,17 +337,17 @@ packageInfo *SLACK::getPackageInfo(char mode, const QString &name, const QString //////////////////////////////////////////////////////////////////// // query an uninstalled package case 'u': - QFile f(name); + TQFile f(name); if (f.exists()) { - QMap<QString, QString> a; + TQMap<TQString, TQString> a; a.insert("group", i18n("OTHER")); a.insert("filename", name); - QFileInfo f(name); + TQFileInfo f(name); a.insert("name", f.baseName()); - QString st; + TQString st; st.setNum(f.size()); a.insert("file-size", st); @@ -367,11 +367,11 @@ packageInfo *SLACK::getPackageInfo(char mode, const QString &name, const QString ////////////////////////////////////////////////////////////////////////////// packageInfo *SLACK::collectInfo(const char *_inp, int insState) { - QString stmp, fn = ""; - QMap<QString, QString> a; + TQString stmp, fn = ""; + TQMap<TQString, TQString> a; char *str, *xstr; - QString qstr; + TQString qstr; char *inp = qstrdup(_inp); str = strtok(inp,"\n"); @@ -397,14 +397,14 @@ packageInfo *SLACK::collectInfo(const char *_inp, int insState) if (!strcmp("package name",str)) { fn = xstr; - QString st = xstr; + TQString st = xstr; if (st.right(4) == ".tgz") a.insert("name", st.left(st.length() - 4)); else a.insert("name", st); } else if (!strcmp("package description",str)) { int i = 0; - QString qstr = ""; + TQString qstr = ""; while ((str = strtok(NULL,"\n"))) { xstr = strchr(str,':'); @@ -430,15 +430,15 @@ packageInfo *SLACK::collectInfo(const char *_inp, int insState) } a.insert("description", qstr); } else if (!strcmp("package location",str)) { - QString sl = xstr; + TQString sl = xstr; if (insState != INSTALLED) { int sls = sl.findRev("/"); if (sls >= 0) { - QRegExp num("[0-9][0-9]*"); + TQRegExp num("[0-9][0-9]*"); int slf = sl.find(num,sls); if (slf >= 0) { sls++; - QString gt = sl.mid(sls,slf-sls); + TQString gt = sl.mid(sls,slf-sls); if (trl->find(gt)) { gt = *trl->find(gt); } @@ -456,13 +456,13 @@ packageInfo *SLACK::collectInfo(const char *_inp, int insState) a.insert("group", xstr); } else if (!strcmp("compressed package size",str) || !strcmp("package size (compressed)",str)) { - QString stmp = xstr; + TQString stmp = xstr; stmp.truncate(stmp.length() - 2); stmp += "000"; a.insert("file-size", stmp); } else if (!strcmp("uncompressed package size",str) || !strcmp("package size (uncompressed)",str)) { - QString stmp = xstr; + TQString stmp = xstr; stmp.truncate(stmp.length() - 2); stmp += "000"; a.insert("size", stmp); @@ -488,7 +488,7 @@ packageInfo *SLACK::collectInfo(const char *_inp, int insState) ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -QStringList SLACK::getChangeLog(packageInfo *) { +TQStringList SLACK::getChangeLog(packageInfo *) { return 0; } @@ -502,12 +502,12 @@ bool SLACK::changeTab(packageInfo *) { ////////////////////////////////////////////////////////////////////////////// -QStringList SLACK::getFileList(packageInfo *p) +TQStringList SLACK::getFileList(packageInfo *p) { char linebuf[1024]; - QString st, fn; + TQString st, fn; FILE *file; - QString name; + TQString name; char mode; fn = p->getFilename(); @@ -516,7 +516,7 @@ QStringList SLACK::getFileList(packageInfo *p) else mode = 'i'; - QStringList filelist; + TQStringList filelist; switch(mode) { //////////////////////////////////////////////////////////////////////// @@ -525,7 +525,7 @@ QStringList SLACK::getFileList(packageInfo *p) name = p->getProperty("name"); fn = DIR + name; - file = fopen(QFile::encodeName(fn),"r"); + file = fopen(TQFile::encodeName(fn),"r"); if (file) { while (fgets(linebuf,sizeof(linebuf),file)) { if (!strcmp(linebuf,FILELIST)) { @@ -549,7 +549,7 @@ QStringList SLACK::getFileList(packageInfo *p) case 'u': name = fn; - QString s = "sh -c 'cat "; + TQString s = "sh -c 'cat "; s += fn; s += "|gunzip |tar -t -f -'"; @@ -564,9 +564,9 @@ QStringList SLACK::getFileList(packageInfo *p) // Call the script to uninstall packages setting parameters // to slack dependent on flags, returning whether everyting worked ////////////////////////////////////////////////////////////////////////////// -QString SLACK::doUninstall(int uninstallFlags, const QString &packs, bool &) +TQString SLACK::doUninstall(int uninstallFlags, const TQString &packs, bool &) { - QString s = "removepkg "; + TQString s = "removepkg "; s += setOptions(uninstallFlags, paramsUninst); s += packs; @@ -579,13 +579,13 @@ QString SLACK::doUninstall(int uninstallFlags, const QString &packs, bool &) // Call the script to install packages setting parameters // to slack dependent on flags, returning whether everyting worked ////////////////////////////////////////////////////////////////////////////// -QString SLACK::install(int installFlags, QPtrList<packageInfo> *plist, bool &test) +TQString SLACK::install(int installFlags, TQPtrList<packageInfo> *plist, bool &test) { packageInfo *pk; int i = 0; - QString packs = ""; + TQString packs = ""; for (pk = plist->first(); pk != 0; pk = plist->next()) { - QString fname = pk->fetchFilename(); + TQString fname = pk->fetchFilename(); if ( !fname.isEmpty() ) { packs += fname + " "; i++; @@ -594,10 +594,10 @@ QString SLACK::install(int installFlags, QPtrList<packageInfo> *plist, bool &tes return doInstall(installFlags, packs, test); } -QString SLACK::doInstall(int installFlags, const QString &packs, bool &) +TQString SLACK::doInstall(int installFlags, const TQString &packs, bool &) { - QString s = "installpkg "; + TQString s = "installpkg "; s += setOptions(installFlags, paramsInst); s += packs; @@ -608,23 +608,23 @@ QString SLACK::doInstall(int installFlags, const QString &packs, bool &) ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -QStringList SLACK::FindFile(const QString &name, bool) +TQStringList SLACK::FindFile(const TQString &name, bool) { FILE *file; char linebuf[1024]; - QString buf, st; - QString fn, dr = DIR; - QStringList filelist; + TQString buf, st; + TQString fn, dr = DIR; + TQStringList filelist; - QDir d(DIR); + TQDir d(DIR); if (d.exists()) { - QString sline = i18n("Querying SLACK package list: "); + TQString sline = i18n("Querying SLACK package list: "); kpackage->setStatus(sline); const QFileInfoList *list = d.entryInfoList(); int count = list->count(); QFileInfoListIterator it( *list ); // create list iterator - QFileInfo *fi; // pointer for traversing + TQFileInfo *fi; // pointer for traversing kpackage->setPercent(0); int cnt = 0; @@ -635,7 +635,7 @@ QStringList SLACK::FindFile(const QString &name, bool) if (!fi->isDir() && fi->isReadable()) { fn = dr + fi->fileName(); - file = fopen(QFile::encodeName(fn),"r"); + file = fopen(TQFile::encodeName(fn),"r"); if (file) { while (fgets(linebuf,sizeof(linebuf),file)) { if (!strcmp(linebuf,FILELIST)) { @@ -643,12 +643,12 @@ QStringList SLACK::FindFile(const QString &name, bool) } } while (fgets(linebuf,sizeof(linebuf),file)) { - if (QString::fromLocal8Bit(linebuf).find(name) != -1) { + if (TQString::fromLocal8Bit(linebuf).find(name) != -1) { st = "/"; st += linebuf; st.truncate(st.length() -1); if (st.left(8) != "/install") { - QString s = fi->fileName(); + TQString s = fi->fileName(); s += "\t"; s += st; filelist.append(s); diff --git a/kpackage/slackInterface.h b/kpackage/slackInterface.h index c11a7c2..f6ed3fc 100644 --- a/kpackage/slackInterface.h +++ b/kpackage/slackInterface.h @@ -29,7 +29,7 @@ #include "../config.h" -#include <qptrlist.h> +#include <tqptrlist.h> #include <kprocess.h> #include "pkgInterface.h" @@ -46,12 +46,12 @@ public: SLACK(); ~SLACK(); - bool isType(char *buf, const QString &fname); + bool isType(char *buf, const TQString &fname); - packageInfo *getPackageInfo(char mode, const QString &name, - const QString &version); - QStringList getFileList(packageInfo *p); - QStringList getChangeLog(packageInfo *p); + packageInfo *getPackageInfo(char mode, const TQString &name, + const TQString &version); + TQStringList getFileList(packageInfo *p); + TQStringList getChangeLog(packageInfo *p); bool filesTab(packageInfo *p); // If files tab is to be enabled @@ -59,10 +59,10 @@ public: bool changeTab(packageInfo *p); // If change log tab is to be enabled - QStringList FindFile(const QString &name, bool seachAll=false); - bool parseName(const QString& name, QString *n, QString *v); + TQStringList FindFile(const TQString &name, bool seachAll=false); + bool parseName(const TQString& name, TQString *n, TQString *v); - QString install(int installFlags, QPtrList<packageInfo> *plist, bool &test); + TQString install(int installFlags, TQPtrList<packageInfo> *plist, bool &test); public slots: void setLocation(); @@ -70,20 +70,20 @@ public slots: private: packageInfo* collectInfo(const char *inp, int insState); - void listInstalledPackages(QPtrList<packageInfo> *pki); + void listInstalledPackages(TQPtrList<packageInfo> *pki); - QString doUninstall(int installFlags, const QString &packs, bool &test); - QString doInstall(int installFlags, const QString &packs, bool &test); + TQString doUninstall(int installFlags, const TQString &packs, bool &test); + TQString doInstall(int installFlags, const TQString &packs, bool &test); - void listPackages(QPtrList<packageInfo> *pki); - void listPackList(QPtrList<packageInfo> *pki, const QString &s, + void listPackages(TQPtrList<packageInfo> *pki); + void listPackList(TQPtrList<packageInfo> *pki, const TQString &s, cacheObj *cp, int insState); void initTranslate(); void smerge(packageInfo *p); - QDict<QString> *trl; + TQDict<TQString> *trl; }; #endif diff --git a/kpackage/updateLoc.cpp b/kpackage/updateLoc.cpp index cf4e582..60e43e4 100644 --- a/kpackage/updateLoc.cpp +++ b/kpackage/updateLoc.cpp @@ -32,26 +32,26 @@ #include "options.h" #include "cache.h" -#include <qvbox.h> -#include <qscrollview.h> +#include <tqvbox.h> +#include <tqscrollview.h> #include <klocale.h> #include <kmessagebox.h> #include <kcombobox.h> ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -apanel::apanel( QWidget *parent, +apanel::apanel( TQWidget *parent, const char * name ) - : QWidget( parent, name ) + : TQWidget( parent, name ) { puse = 0; - pack = new QHBoxLayout(this); + pack = new TQHBoxLayout(this); { - puse = new QCheckBox(i18n("Use"),this); + puse = new TQCheckBox(i18n("Use"),this); pack->addWidget(puse,0); - pent = new QLineEdit(this); + pent = new TQLineEdit(this); pent->setMinimumWidth(600); pack->addWidget(pent,0); @@ -62,13 +62,13 @@ apanel::~apanel() { } -QString apanel::getText() const +TQString apanel::getText() const { - QString s = pent->text(); + TQString s = pent->text(); return s; } -void apanel::setText(const QString &s) +void apanel::setText(const TQString &s) { pent->setText(s); } @@ -99,29 +99,29 @@ void apanel::clear() ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -dpanel::dpanel( QWidget *parent, const char * name ) - : QWidget( parent, name ) +dpanel::dpanel( TQWidget *parent, const char * name ) + : TQWidget( parent, name ) { puse = 0; psubdirs = 0; - pack = new QHBoxLayout(this); + pack = new TQHBoxLayout(this); { - pent = new QLineEdit(this); + pent = new TQLineEdit(this); pent->setMinimumWidth(280); pack->addWidget(pent,0); - pbut = new QPushButton("...",this); + pbut = new TQPushButton("...",this); pack->addWidget(pbut,0); - connect(pbut, SIGNAL(clicked()), this, SLOT(dirOpen())); + connect(pbut, TQT_SIGNAL(clicked()), this, TQT_SLOT(dirOpen())); } } -dpanel::dpanel(dpanel *basep, const QString &Pfilter, bool bsubdirs, - QWidget *parent, const char * name ) - : QWidget( parent, name ) +dpanel::dpanel(dpanel *basep, const TQString &Pfilter, bool bsubdirs, + TQWidget *parent, const char * name ) + : TQWidget( parent, name ) { filter = Pfilter; puse = 0; @@ -129,28 +129,28 @@ dpanel::dpanel(dpanel *basep, const QString &Pfilter, bool bsubdirs, base = basep; - pack = new QHBoxLayout(this); + pack = new TQHBoxLayout(this); { - puse = new QCheckBox(i18n("Use"),this); + puse = new TQCheckBox(i18n("Use"),this); pack->addWidget(puse,0); - pent = new QLineEdit(this); + pent = new TQLineEdit(this); pent->setMinimumWidth(280); pack->addWidget(pent,0); if (bsubdirs) { - psubdirs = new QCheckBox(i18n("Subfolders"),this); + psubdirs = new TQCheckBox(i18n("Subfolders"),this); psubdirs->setFixedSize(psubdirs->sizeHint()); pack->addWidget(psubdirs,0); } - pbut = new QPushButton("...",this); + pbut = new TQPushButton("...",this); pack->addWidget(pbut,0); if (base) - connect(pbut, SIGNAL(clicked()), this, SLOT(fileOpen())); + connect(pbut, TQT_SIGNAL(clicked()), this, TQT_SLOT(fileOpen())); else - connect(pbut, SIGNAL(clicked()), this, SLOT(dirOpen())); + connect(pbut, TQT_SIGNAL(clicked()), this, TQT_SLOT(dirOpen())); } } @@ -159,13 +159,13 @@ dpanel::~dpanel() { } -QString dpanel::getText() const +TQString dpanel::getText() const { - QString s = pent->text(); + TQString s = pent->text(); return s; } -void dpanel::setText(const QString &s) +void dpanel::setText(const TQString &s) { pent->setText(s); } @@ -209,7 +209,7 @@ void dpanel::setSubdirs(int n) void dpanel::fileOpen() { - QString st; + TQString st; if (base && getText().isEmpty()) { st = base->getText(); @@ -231,7 +231,7 @@ void dpanel::fileOpen() void dpanel::dirOpen() { - QString st; + TQString st; if (base && getText().isEmpty()) { st = base->getText(); @@ -252,29 +252,29 @@ void dpanel::dirOpen() ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -updateLoc::updateLoc(QWidget *p, int panelNumber, pkgInterface *inter, const QString &iname) - : QWidget(p,"updateLoc",FALSE) +updateLoc::updateLoc(TQWidget *p, int panelNumber, pkgInterface *inter, const TQString &iname) + : TQWidget(p,"updateLoc",FALSE) { interName = iname; interface = inter; panNumber = panelNumber; - vf = new QVBoxLayout( this, 15, 10, "vf"); + vf = new TQVBoxLayout( this, 15, 10, "vf"); } updateLoc::~updateLoc() { } -void updateLoc::doBase(const QString & bmsg) +void updateLoc::doBase(const TQString & bmsg) { base = 0; if (haveBase) { - fbase = new QGroupBox(bmsg, this); + fbase = new TQGroupBox(bmsg, this); fbase->setColumnLayout(0, Qt::Vertical ); fbase->layout()->setSpacing( KDialog::spacingHint() ); fbase->layout()->setMargin( KDialog::marginHint() ); - vbase = new QVBoxLayout(fbase->layout()); + vbase = new TQVBoxLayout(fbase->layout()); vf->addWidget(fbase,1); base = new dpanel(fbase); vbase->addWidget(base,0); @@ -285,8 +285,8 @@ void updateLoc::doBase(const QString & bmsg) ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -aUpdateLoc::aUpdateLoc(QWidget *p, int panelNumber, pkgInterface *inter, const QString &iname, - int numberLines, const QString &label) +aUpdateLoc::aUpdateLoc(TQWidget *p, int panelNumber, pkgInterface *inter, const TQString &iname, + int numberLines, const TQString &label) : updateLoc(p, panelNumber, inter, iname) { @@ -297,16 +297,16 @@ aUpdateLoc::aUpdateLoc(QWidget *p, int panelNumber, pkgInterface *inter, const Q ap[0] = 0; - QGroupBox *floc = new QGroupBox(1,Qt::Vertical, label, this); + TQGroupBox *floc = new TQGroupBox(1,Qt::Vertical, label, this); vf->addWidget(floc,1); - QScrollView* sv = new QScrollView(floc); - sv->setHScrollBarMode(QScrollView::AlwaysOff); - sv->setResizePolicy(QScrollView::AutoOneFit); + TQScrollView* sv = new TQScrollView(floc); + sv->setHScrollBarMode(TQScrollView::AlwaysOff); + sv->setResizePolicy(TQScrollView::AutoOneFit); - QFrame *f = new QFrame(sv->viewport()); + TQFrame *f = new TQFrame(sv->viewport()); sv->addChild(f); - QVBoxLayout *vloc = new QVBoxLayout(f, 0, 3, "vloc"); + TQVBoxLayout *vloc = new TQVBoxLayout(f, 0, 3, "vloc"); for (int i = 0; i < numLines; i++) { ap[i] = new apanel( f); @@ -323,14 +323,14 @@ aUpdateLoc::~aUpdateLoc() void aUpdateLoc::readSettings() { int i = 0; - QString a,b; + TQString a,b; for (int i = 0; i < numLines; i++) { ap[i]->clear(); } - QStringList list = interface->readApt(); - for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { + TQStringList list = interface->readApt(); + for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { if (!(*it).isEmpty()) { if ((*it).left(1) == "#") { ap[i]->setText(((*it).mid(1)).stripWhiteSpace()); @@ -349,10 +349,10 @@ void aUpdateLoc::readSettings() } void aUpdateLoc::writeSettings() { - QStringList list; - QString s; + TQStringList list; + TQString s; - QString ln; + TQString ln; for (int i = 0; i < numLines; i++) { if (!ap[i]) break; @@ -377,9 +377,9 @@ void aUpdateLoc::applyS(LcacheObj *) { ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -pdUpdateLoc::pdUpdateLoc(QWidget *p, int panelNumber, pkgInterface *inter, const QString &iname, - int numberLines, const QString &filter, - const QString &lmsg, QString bmsg, +pdUpdateLoc::pdUpdateLoc(TQWidget *p, int panelNumber, pkgInterface *inter, const TQString &iname, + int numberLines, const TQString &filter, + const TQString &lmsg, TQString bmsg, bool subdirs ) : updateLoc(p, panelNumber, inter, iname) { @@ -393,7 +393,7 @@ pdUpdateLoc::pdUpdateLoc(QWidget *p, int panelNumber, pkgInterface *inter, const dp[0] = 0; - QString pn; + TQString pn; pn.setNum(panNumber); pn += "_"; @@ -408,12 +408,12 @@ pdUpdateLoc::pdUpdateLoc(QWidget *p, int panelNumber, pkgInterface *inter, const doBase(bmsg); - QGroupBox *floc = new QGroupBox(lmsg, this); + TQGroupBox *floc = new TQGroupBox(lmsg, this); floc->setColumnLayout(0, Qt::Vertical ); floc->layout()->setSpacing( KDialog::spacingHint() ); floc->layout()->setMargin( KDialog::marginHint() ); vf->addWidget(floc,1); - QVBoxLayout *vloc = new QVBoxLayout(floc->layout()); + TQVBoxLayout *vloc = new TQVBoxLayout(floc->layout()); for (int i = 0; i < numLines; i++) { dp[i] = new dpanel(base, filter, subdirs, floc); @@ -430,7 +430,7 @@ pdUpdateLoc::~pdUpdateLoc() void pdUpdateLoc::applyS(LcacheObj *slist) { - QString t,pn,cn,pv,prev,opts; + TQString t,pn,cn,pv,prev,opts; cacheObj *CObj; KConfig *config = kapp->config(); config->setGroup(interName); @@ -446,13 +446,13 @@ void pdUpdateLoc::applyS(LcacheObj *slist) pv = packL + pn.setNum(i); prev = config->readEntry(pv); if (prev != dp[i]->getText()) - cacheObj::rmDCache(QString(cn + pn.setNum(i))); + cacheObj::rmDCache(TQString(cn + pn.setNum(i))); // create cache object corresponding to this entry if (dp[i]->getUse()) { t = dp[i]->getText(); if (!t.isEmpty()) { - CObj = new cacheObj(haveBase ? base->getText() : QString::null, + CObj = new cacheObj(haveBase ? base->getText() : TQString::null, t, cn + pn.setNum(i), "", dp[i]->getSubdirs()); slist->append(CObj); // printf("T=%s\n",t.data()); @@ -464,7 +464,7 @@ void pdUpdateLoc::applyS(LcacheObj *slist) void pdUpdateLoc::readSettings() { - QString pv, pn; + TQString pv, pn; KConfig *config = kapp->config(); @@ -487,7 +487,7 @@ void pdUpdateLoc::readSettings() void pdUpdateLoc::writeSettings() { - QString pv, pn; + TQString pv, pn; KConfig *config = kapp->config(); @@ -512,9 +512,9 @@ void pdUpdateLoc::writeSettings() ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -cUpdateLoc::cUpdateLoc(QWidget *p, int panelNumber, pkgInterface *inter, const QString &iname, - int numberLines, const QString &baseMsg, - const QString &boxLabels, const QString &boxValues) +cUpdateLoc::cUpdateLoc(TQWidget *p, int panelNumber, pkgInterface *inter, const TQString &iname, + int numberLines, const TQString &baseMsg, + const TQString &boxLabels, const TQString &boxValues) : updateLoc(p, panelNumber, inter, iname) { if (numberLines > PNUM) @@ -526,7 +526,7 @@ cUpdateLoc::cUpdateLoc(QWidget *p, int panelNumber, pkgInterface *inter, const Q combo[0] = 0; - QString pn; + TQString pn; pn.setNum(panNumber); pn += "_"; @@ -535,28 +535,28 @@ cUpdateLoc::cUpdateLoc(QWidget *p, int panelNumber, pkgInterface *inter, const Q availB = "Available_Base"; availB += pn; - QStringList kc = QStringList::split('\n', boxLabels); - QStringList::Iterator kcIt = kc.begin(); + TQStringList kc = TQStringList::split('\n', boxLabels); + TQStringList::Iterator kcIt = kc.begin(); - QStringList oc = QStringList::split('\n', boxValues); - QStringList::Iterator ocIt = oc.begin(); + TQStringList oc = TQStringList::split('\n', boxValues); + TQStringList::Iterator ocIt = oc.begin(); doBase(baseMsg); for (int i = 0; i < numLines; i++) { - QGroupBox *floc = new QGroupBox(*kcIt, this); + TQGroupBox *floc = new TQGroupBox(*kcIt, this); floc->setColumnLayout(0, Qt::Vertical ); floc->layout()->setSpacing( KDialog::spacingHint() ); floc->layout()->setMargin( KDialog::marginHint() ); vf->addWidget(floc,1); - QVBoxLayout *vloc = new QVBoxLayout(floc->layout()); + TQVBoxLayout *vloc = new TQVBoxLayout(floc->layout()); combo[i] = new KComboBox( true, floc); KCompletion *comp = combo[i]->completionObject(); - connect(combo[i],SIGNAL(returnPressed(const QString&)) - ,comp,SLOT(addItem(const QString&))); - combo[i]->insertStringList(QStringList::split(' ',*ocIt)); + connect(combo[i],TQT_SIGNAL(returnPressed(const TQString&)) + ,comp,TQT_SLOT(addItem(const TQString&))); + combo[i]->insertStringList(TQStringList::split(' ',*ocIt)); vloc->addWidget(combo[i]); if (kcIt != kc.end()) { ++kcIt; @@ -575,7 +575,7 @@ cUpdateLoc::~cUpdateLoc() void cUpdateLoc::applyS(LcacheObj *slist) { - QString t,pn,cn,pv,prev,opts; + TQString t,pn,cn,pv,prev,opts; cacheObj *CObj; KConfig *config = kapp->config(); config->setGroup(interName); @@ -599,7 +599,7 @@ cUpdateLoc::~cUpdateLoc() void cUpdateLoc::readSettings() { - QString pv, pn; + TQString pv, pn; KConfig *config = kapp->config(); @@ -621,7 +621,7 @@ void cUpdateLoc::readSettings() void cUpdateLoc::writeSettings() { - QString pv, pn; + TQString pv, pn; KConfig *config = kapp->config(); @@ -642,27 +642,27 @@ void cUpdateLoc::writeSettings() ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -Locations::Locations(const QString &msg) +Locations::Locations(const TQString &msg) : KDialogBase(Tabbed, msg, Ok | Cancel, Ok, 0, "Locations", false) { numPanels = 0; - connect( this, SIGNAL(okClicked()), SLOT(write_slot()) ); + connect( this, TQT_SIGNAL(okClicked()), TQT_SLOT(write_slot()) ); } void Locations::dLocations(int numberDirs, int numberLines, - pkgInterface *inter, const QString &iname, - const QString &label, const QString &filter, const QString &dirMsg, + pkgInterface *inter, const TQString &iname, + const TQString &label, const TQString &filter, const TQString &dirMsg, bool subdirs) { - QString nm; + TQString nm; for (int i = numPanels ; (i < numPanels + numberDirs) && (i < PANNUM); i++) { - QString mp = iname; + TQString mp = iname; nm.setNum(i+1); mp += nm; - QVBox *page = addVBoxPage(mp); + TQVBox *page = addVBoxPage(mp); pn[i] = new pdUpdateLoc(page, i, inter, label, numberLines, filter, dirMsg, NULL, subdirs); @@ -671,17 +671,17 @@ void Locations::dLocations(int numberDirs, int numberLines, } void Locations::pLocations(int numberDirs, int numberLines, - pkgInterface *inter, const QString &iname, const QString &label, - const QString &filter, - const QString &packMsg, QString baseMsg, bool subdirs) + pkgInterface *inter, const TQString &iname, const TQString &label, + const TQString &filter, + const TQString &packMsg, TQString baseMsg, bool subdirs) { - QString nm; + TQString nm; for (int i = numPanels; (i < numPanels + numberDirs) && (i < PANNUM); i++) { - QString mp = iname; + TQString mp = iname; nm.setNum(i+1); mp += nm; - QVBox *page = addVBoxPage(mp); + TQVBox *page = addVBoxPage(mp); pn[i] = new pdUpdateLoc(page, i, inter, label, numberLines, filter, packMsg, baseMsg, subdirs); @@ -690,16 +690,16 @@ void Locations::pLocations(int numberDirs, int numberLines, } void Locations::cLocations(int numberDirs, int numberLines, - pkgInterface *inter, const QString &iname, const QString &label, - const QString &boxLables, const QString &baseMsg, const QString &boxValues) + pkgInterface *inter, const TQString &iname, const TQString &label, + const TQString &boxLables, const TQString &baseMsg, const TQString &boxValues) { - QString nm; + TQString nm; for (int i = numPanels; (i < numPanels + numberDirs) && (i < PANNUM); i++) { - QString mp = iname; + TQString mp = iname; nm.setNum(i+1); mp += nm; - QVBox *page = addVBoxPage(mp); + TQVBox *page = addVBoxPage(mp); pn[i] = new cUpdateLoc(page, i, inter, label, numberLines, baseMsg, boxLables, boxValues); @@ -708,15 +708,15 @@ void Locations::cLocations(int numberDirs, int numberLines, } void Locations::aLocations(int numberDirs, int numberLines, - pkgInterface *inter, const QString &iname, const QString &label) + pkgInterface *inter, const TQString &iname, const TQString &label) { - QString nm; + TQString nm; for (int i = numPanels; (i < numPanels + numberDirs) && (i < PANNUM); i++) { - QString mp = iname; + TQString mp = iname; nm.setNum(i+1); mp += nm; - QVBox *page = addVBoxPage(mp); + TQVBox *page = addVBoxPage(mp); pn[i] = new aUpdateLoc(page, i, inter, iname, numberLines, label); } diff --git a/kpackage/updateLoc.h b/kpackage/updateLoc.h index 269bf74..d9879f3 100644 --- a/kpackage/updateLoc.h +++ b/kpackage/updateLoc.h @@ -35,15 +35,15 @@ #include <stdio.h> // Qt Headers -#include <qdir.h> -#include <qwidget.h> -#include <qframe.h> -#include <qlabel.h> -#include <qfiledialog.h> -#include <qgroupbox.h> -#include <qcheckbox.h> -#include <qlayout.h> -#include <qlineedit.h> +#include <tqdir.h> +#include <tqwidget.h> +#include <tqframe.h> +#include <tqlabel.h> +#include <tqfiledialog.h> +#include <tqgroupbox.h> +#include <tqcheckbox.h> +#include <tqlayout.h> +#include <tqlineedit.h> // KDE headers #include <kbuttonbox.h> @@ -62,14 +62,14 @@ class dpanel : public QWidget Q_OBJECT public: - dpanel(QWidget *parent, const char * name = 0); - dpanel(dpanel *basep, const QString &Pfilter, bool bsubdirs, - QWidget *parent, const char * name = 0); + dpanel(TQWidget *parent, const char * name = 0); + dpanel(dpanel *basep, const TQString &Pfilter, bool bsubdirs, + TQWidget *parent, const char * name = 0); ~dpanel(); - QString getText() const; - void setText(const QString &s); + TQString getText() const; + void setText(const TQString &s); bool getUse() const; void setUse(int n); bool getSubdirs() const; @@ -77,14 +77,14 @@ public: private: - QCheckBox *psubdirs; - QCheckBox *puse; - QHBoxLayout* pack; - QLineEdit *pent; - QPushButton *pbut; + TQCheckBox *psubdirs; + TQCheckBox *puse; + TQHBoxLayout* pack; + TQLineEdit *pent; + TQPushButton *pbut; dpanel *base; - QString filter; + TQString filter; public slots: void fileOpen(); @@ -99,21 +99,21 @@ class apanel : public QWidget Q_OBJECT public: - apanel( QWidget *parent, const char * name = 0 ); + apanel( TQWidget *parent, const char * name = 0 ); ~apanel(); - QString getText() const; - void setText(const QString &s); + TQString getText() const; + void setText(const TQString &s); bool getUse(); void setUse(int n); void clear(); private: - QCheckBox *puse; - QHBoxLayout* pack; - QLineEdit *pent; + TQCheckBox *puse; + TQHBoxLayout* pack; + TQLineEdit *pent; @@ -129,7 +129,7 @@ class updateLoc : public QWidget public: - updateLoc (QWidget *p, int panelNumber, pkgInterface *inter, const QString &iname); + updateLoc (TQWidget *p, int panelNumber, pkgInterface *inter, const TQString &iname); ~updateLoc(); virtual void readSettings() = 0; @@ -137,20 +137,20 @@ public: virtual void applyS(LcacheObj *slist) = 0; - void doBase(const QString &bmsg); + void doBase(const TQString &bmsg); - QString interName; + TQString interName; int panNumber; bool haveBase; pkgInterface *interface; - QVBoxLayout *vf; + TQVBoxLayout *vf; dpanel *base; - QGroupBox *fbase; - QVBoxLayout* vbase; + TQGroupBox *fbase; + TQVBoxLayout* vbase; }; ////////////////////////////////////////////////////////////////////////////// @@ -161,8 +161,8 @@ class aUpdateLoc : public updateLoc public: - aUpdateLoc (QWidget *p, int panelNumber, pkgInterface *inter, const QString &iname, - int numberLines, const QString &label); + aUpdateLoc (TQWidget *p, int panelNumber, pkgInterface *inter, const TQString &iname, + int numberLines, const TQString &label); ~aUpdateLoc(); @@ -173,21 +173,21 @@ public: private: - QString packL, packU, packS, availB; + TQString packL, packU, packS, availB; int wdth; - QPushButton *butloc; + TQPushButton *butloc; - QHBoxLayout* hloc; + TQHBoxLayout* hloc; int numLines; enum { PNUM = 100 }; apanel *ap[PNUM]; - QVBoxLayout* vl; - QVBoxLayout* vtop; - QGroupBox *frame1; + TQVBoxLayout* vl; + TQVBoxLayout* vtop; + TQGroupBox *frame1; KButtonBox* hb; }; @@ -200,9 +200,9 @@ class pdUpdateLoc : public updateLoc public: - pdUpdateLoc (QWidget *p, int panelNumber, pkgInterface *inter, - const QString &iname, int numberLines, const QString &filter, - const QString &lmsg, QString bmsg = 0, + pdUpdateLoc (TQWidget *p, int panelNumber, pkgInterface *inter, + const TQString &iname, int numberLines, const TQString &filter, + const TQString &lmsg, TQString bmsg = 0, bool subdirs = FALSE); ~pdUpdateLoc(); @@ -214,21 +214,21 @@ public: private: - QString packL, packU, packS, availB; + TQString packL, packU, packS, availB; int wdth; - QPushButton *butloc; + TQPushButton *butloc; - QHBoxLayout* hloc; + TQHBoxLayout* hloc; int numLines; enum { PNUM = 40 }; dpanel *dp[PNUM]; - QVBoxLayout* vl; - QVBoxLayout* vtop; - QGroupBox *frame1; + TQVBoxLayout* vl; + TQVBoxLayout* vtop; + TQGroupBox *frame1; KButtonBox* hb; }; @@ -241,9 +241,9 @@ class cUpdateLoc : public updateLoc public: - cUpdateLoc (QWidget *p, int panelNumber, pkgInterface *inter, - const QString &iname, int numberLines, const QString &baseMsg, - const QString &boxLabels, const QString &boxValues); + cUpdateLoc (TQWidget *p, int panelNumber, pkgInterface *inter, + const TQString &iname, int numberLines, const TQString &baseMsg, + const TQString &boxLabels, const TQString &boxValues); ~cUpdateLoc(); @@ -254,19 +254,19 @@ public: private: - QString packC, availB; + TQString packC, availB; - QPushButton *butloc; + TQPushButton *butloc; - QHBoxLayout* hloc; + TQHBoxLayout* hloc; int numLines; enum { PNUM = 40 }; KComboBox *combo[PNUM]; - QVBoxLayout* vl; - QVBoxLayout* vtop; - QGroupBox *frame1; + TQVBoxLayout* vl; + TQVBoxLayout* vtop; + TQGroupBox *frame1; KButtonBox* hb; @@ -281,26 +281,26 @@ class Locations : public KDialogBase Q_OBJECT public: - Locations( const QString &msg); + Locations( const TQString &msg); ~Locations(); void dLocations(int numberDirs, int numberLines, - pkgInterface *inter, const QString &iname, - const QString &label, const QString &filter, const QString &dirMsg, + pkgInterface *inter, const TQString &iname, + const TQString &label, const TQString &filter, const TQString &dirMsg, bool subdirs=TRUE ); void pLocations(int numberDirs, int numberLines, - pkgInterface *inter, const QString &iname, - const QString &label, const QString &filter, - const QString &packMsg, QString baseMsg = 0, + pkgInterface *inter, const TQString &iname, + const TQString &label, const TQString &filter, + const TQString &packMsg, TQString baseMsg = 0, bool subdirs=FALSE); void cLocations(int numberDirs, int numberLines, - pkgInterface *inter, const QString &iname, const QString &label, - const QString &boxLabels, const QString &baseMsg, const QString &boxValues); + pkgInterface *inter, const TQString &iname, const TQString &label, + const TQString &boxLabels, const TQString &baseMsg, const TQString &boxValues); void aLocations(int numberDirs, int numberLines, - pkgInterface *inter, const QString &iname, const QString &label); + pkgInterface *inter, const TQString &iname, const TQString &label); diff --git a/kpackage/utils.cpp b/kpackage/utils.cpp index 4f0ef44..679b037 100644 --- a/kpackage/utils.cpp +++ b/kpackage/utils.cpp @@ -32,12 +32,12 @@ #include "utils.h" #include "kplview.h" -void KpMsgE( const QString &msg, bool stop) +void KpMsgE( const TQString &msg, bool stop) { KpMsg( "Error", msg, stop); } -void KpMsg(const QString &lab, const QString &msg, bool stop) +void KpMsg(const TQString &lab, const TQString &msg, bool stop) { if (stop) KMessageBox::sorry(kpkg, msg, lab); @@ -45,7 +45,7 @@ void KpMsg(const QString &lab, const QString &msg, bool stop) KMessageBox::information(kpkg, msg, lab); } -KpTreeListItem *findGroup(const QString &name, KpTreeListItem *search) +KpTreeListItem *findGroup(const TQString &name, KpTreeListItem *search) { if(!search) return NULL; diff --git a/kpackage/utils.h b/kpackage/utils.h index 5cf30d9..4608965 100644 --- a/kpackage/utils.h +++ b/kpackage/utils.h @@ -33,7 +33,7 @@ class KpTreeListItem; -KpTreeListItem *findGroup(const QString &name, KpTreeListItem *search); +KpTreeListItem *findGroup(const TQString &name, KpTreeListItem *search); #endif |