summaryrefslogtreecommitdiffstats
path: root/kpackage/fbsdInterface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kpackage/fbsdInterface.cpp')
-rw-r--r--kpackage/fbsdInterface.cpp156
1 files changed, 78 insertions, 78 deletions
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;