summaryrefslogtreecommitdiffstats
path: root/kpackage/slackInterface.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:25:18 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:25:18 +0000
commitaa3a1ca934bc541bddd3fa136a85f106f7da266e (patch)
tree9ad0b795aed8fa4ac30c2fe0fd1aacb8175714c0 /kpackage/slackInterface.cpp
parentb10cf7066791a2f362495890cd50c984e8025412 (diff)
downloadtdeadmin-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/slackInterface.cpp')
-rw-r--r--kpackage/slackInterface.cpp162
1 files changed, 81 insertions, 81 deletions
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);