summaryrefslogtreecommitdiffstats
path: root/kdeprint/lpd
diff options
context:
space:
mode:
Diffstat (limited to 'kdeprint/lpd')
-rw-r--r--kdeprint/lpd/gschecker.cpp14
-rw-r--r--kdeprint/lpd/gschecker.h10
-rw-r--r--kdeprint/lpd/klpdprinterimpl.cpp10
-rw-r--r--kdeprint/lpd/klpdprinterimpl.h6
-rw-r--r--kdeprint/lpd/kmlpdfactory.cpp4
-rw-r--r--kdeprint/lpd/kmlpdfactory.h4
-rw-r--r--kdeprint/lpd/kmlpdmanager.cpp134
-rw-r--r--kdeprint/lpd/kmlpdmanager.h30
-rw-r--r--kdeprint/lpd/kmlpduimanager.cpp10
-rw-r--r--kdeprint/lpd/kmlpduimanager.h2
-rw-r--r--kdeprint/lpd/lpdtools.cpp38
-rw-r--r--kdeprint/lpd/lpdtools.h26
12 files changed, 144 insertions, 144 deletions
diff --git a/kdeprint/lpd/gschecker.cpp b/kdeprint/lpd/gschecker.cpp
index a4142abbb..8f23fcc32 100644
--- a/kdeprint/lpd/gschecker.cpp
+++ b/kdeprint/lpd/gschecker.cpp
@@ -20,15 +20,15 @@
#include "gschecker.h"
#include "kpipeprocess.h"
-#include <qfile.h>
-#include <qtextstream.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
-GsChecker::GsChecker(QObject *parent, const char *name)
-: QObject(parent,name)
+GsChecker::GsChecker(TQObject *parent, const char *name)
+: TQObject(parent,name)
{
}
-bool GsChecker::checkGsDriver(const QString& name)
+bool GsChecker::checkGsDriver(const TQString& name)
{
if (m_driverlist.count() == 0)
loadDriverList();
@@ -53,9 +53,9 @@ void GsChecker::loadDriverList()
else
buffer.append(line).append(" ");
}
- else if (line.startsWith(QString::fromLatin1("Available devices:")))
+ else if (line.startsWith(TQString::fromLatin1("Available devices:")))
ok = true;
}
- m_driverlist = QStringList::split(' ',buffer,false);
+ m_driverlist = TQStringList::split(' ',buffer,false);
}
}
diff --git a/kdeprint/lpd/gschecker.h b/kdeprint/lpd/gschecker.h
index d7c040315..65f247380 100644
--- a/kdeprint/lpd/gschecker.h
+++ b/kdeprint/lpd/gschecker.h
@@ -20,15 +20,15 @@
#ifndef GSCHECKER_H
#define GSCHECKER_H
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qobject.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqobject.h>
class GsChecker : public QObject
{
public:
- GsChecker(QObject *parent = 0, const char *name = 0);
- bool checkGsDriver(const QString& name);
+ GsChecker(TQObject *parent = 0, const char *name = 0);
+ bool checkGsDriver(const TQString& name);
protected:
void loadDriverList();
diff --git a/kdeprint/lpd/klpdprinterimpl.cpp b/kdeprint/lpd/klpdprinterimpl.cpp
index ad8912c47..8a04927e6 100644
--- a/kdeprint/lpd/klpdprinterimpl.cpp
+++ b/kdeprint/lpd/klpdprinterimpl.cpp
@@ -20,11 +20,11 @@
#include "klpdprinterimpl.h"
#include "kprinter.h"
-#include <qfile.h>
+#include <tqfile.h>
#include <kstandarddirs.h>
#include <klocale.h>
-KLpdPrinterImpl::KLpdPrinterImpl(QObject *parent, const char *name)
+KLpdPrinterImpl::KLpdPrinterImpl(TQObject *parent, const char *name)
: KPrinterImpl(parent,name)
{
}
@@ -33,12 +33,12 @@ KLpdPrinterImpl::~KLpdPrinterImpl()
{
}
-QString KLpdPrinterImpl::executable()
+TQString KLpdPrinterImpl::executable()
{
return KStandardDirs::findExe("lpr");
}
-bool KLpdPrinterImpl::setupCommand(QString& cmd, KPrinter *printer)
+bool KLpdPrinterImpl::setupCommand(TQString& cmd, KPrinter *printer)
{
QString exestr = executable();
if (exestr.isEmpty())
@@ -46,6 +46,6 @@ bool KLpdPrinterImpl::setupCommand(QString& cmd, KPrinter *printer)
printer->setErrorMessage(i18n("The <b>%1</b> executable could not be found in your path. Check your installation.").arg("lpr"));
return false;
}
- cmd = QString::fromLatin1("%1 -P %2 '-#%3'").arg(exestr).arg(quote(printer->printerName())).arg(printer->numCopies());
+ cmd = TQString::fromLatin1("%1 -P %2 '-#%3'").arg(exestr).arg(quote(printer->printerName())).arg(printer->numCopies());
return true;
}
diff --git a/kdeprint/lpd/klpdprinterimpl.h b/kdeprint/lpd/klpdprinterimpl.h
index ea88c1138..654c2606e 100644
--- a/kdeprint/lpd/klpdprinterimpl.h
+++ b/kdeprint/lpd/klpdprinterimpl.h
@@ -25,13 +25,13 @@
class KLpdPrinterImpl : public KPrinterImpl
{
public:
- KLpdPrinterImpl(QObject *parent = 0, const char *name = 0);
+ KLpdPrinterImpl(TQObject *parent = 0, const char *name = 0);
~KLpdPrinterImpl();
- bool setupCommand(QString&, KPrinter*);
+ bool setupCommand(TQString&, KPrinter*);
protected:
- QString executable();
+ TQString executable();
};
#endif
diff --git a/kdeprint/lpd/kmlpdfactory.cpp b/kdeprint/lpd/kmlpdfactory.cpp
index 3285a32a2..a1882c3ca 100644
--- a/kdeprint/lpd/kmlpdfactory.cpp
+++ b/kdeprint/lpd/kmlpdfactory.cpp
@@ -30,7 +30,7 @@ extern "C"
}
};
-KLpdFactory::KLpdFactory(QObject *parent, const char *name)
+KLpdFactory::KLpdFactory(TQObject *parent, const char *name)
: KLibFactory(parent,name)
{
}
@@ -39,7 +39,7 @@ KLpdFactory::~KLpdFactory()
{
}
-QObject* KLpdFactory::createObject(QObject *parent, const char *name, const char *classname, const QStringList&)
+TQObject* KLpdFactory::createObject(TQObject *parent, const char *name, const char *classname, const TQStringList&)
{
if (strcmp(classname,"KMManager") == 0)
return new KMLpdManager(parent,name);
diff --git a/kdeprint/lpd/kmlpdfactory.h b/kdeprint/lpd/kmlpdfactory.h
index 2d4dc7efb..6e6c2fda8 100644
--- a/kdeprint/lpd/kmlpdfactory.h
+++ b/kdeprint/lpd/kmlpdfactory.h
@@ -25,11 +25,11 @@
class KLpdFactory : public KLibFactory
{
public:
- KLpdFactory(QObject *parent = 0, const char *name = 0);
+ KLpdFactory(TQObject *parent = 0, const char *name = 0);
virtual ~KLpdFactory();
protected:
- QObject* createObject(QObject *parent = 0, const char *name = 0, const char *className = "QObject", const QStringList& args = QStringList());
+ TQObject* createObject(TQObject *parent = 0, const char *name = 0, const char *className = "TQObject", const TQStringList& args = TQStringList());
};
#endif
diff --git a/kdeprint/lpd/kmlpdmanager.cpp b/kdeprint/lpd/kmlpdmanager.cpp
index a19cd3f5f..95623a56f 100644
--- a/kdeprint/lpd/kmlpdmanager.cpp
+++ b/kdeprint/lpd/kmlpdmanager.cpp
@@ -26,11 +26,11 @@
#include "gschecker.h"
#include "kpipeprocess.h"
-#include <qfile.h>
-#include <qfileinfo.h>
-#include <qtextstream.h>
-#include <qmap.h>
-#include <qregexp.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
+#include <tqtextstream.h>
+#include <tqmap.h>
+#include <tqregexp.h>
#include <klocale.h>
#include <kstandarddirs.h>
@@ -45,11 +45,11 @@
// only there to allow testing on my system. Should be removed
// when everything has proven to be working and stable
QString lpdprefix = "";
-QString ptPrinterType(KMPrinter*);
+TQString ptPrinterType(KMPrinter*);
//************************************************************************************************
-KMLpdManager::KMLpdManager(QObject *parent, const char *name)
+KMLpdManager::KMLpdManager(TQObject *parent, const char *name)
: KMManager(parent,name)
{
m_entries.setAutoDelete(true);
@@ -63,14 +63,14 @@ KMLpdManager::~KMLpdManager()
{
}
-QString KMLpdManager::driverDbCreationProgram()
+TQString KMLpdManager::driverDbCreationProgram()
{
- return QString::fromLatin1("make_driver_db_lpd");
+ return TQString::fromLatin1("make_driver_db_lpd");
}
-QString KMLpdManager::driverDirectory()
+TQString KMLpdManager::driverDirectory()
{
- return QString::fromLatin1("/usr/lib/rhs/rhs-printfilters");
+ return TQString::fromLatin1("/usr/lib/rhs/rhs-printfilters");
}
bool KMLpdManager::completePrinter(KMPrinter *printer)
@@ -91,29 +91,29 @@ bool KMLpdManager::completePrinterShort(KMPrinter *printer)
KURL url;
if (!entry->arg("rm").isEmpty())
{
- url = QString::fromLatin1("lpd://%1/%2").arg(entry->arg("rm")).arg(entry->arg("rp"));
+ url = TQString::fromLatin1("lpd://%1/%2").arg(entry->arg("rm")).arg(entry->arg("rp"));
printer->setDescription(i18n("Remote LPD queue %1@%2").arg(entry->arg("rp")).arg(entry->arg("rm")));
}
else if (!lp.isEmpty() && lp != "/dev/null")
- url = QString::fromLatin1("parallel:%1").arg(lp);
- else if (QFile::exists(entry->arg("sd")+"/.config"))
+ url = TQString::fromLatin1("parallel:%1").arg(lp);
+ else if (TQFile::exists(entry->arg("sd")+"/.config"))
{
- QMap<QString,QString> map = loadPrinttoolCfgFile(entry->arg("sd")+"/.config");
+ TQMap<TQString,TQString> map = loadPrinttoolCfgFile(entry->arg("sd")+"/.config");
if (type == "SMB")
{
- QStringList l = QStringList::split('\\',map["share"],false);
+ QStringList l = TQStringList::split('\\',map["share"],false);
if (map["workgroup"].isEmpty())
- url = QString::fromLatin1("smb://%1/%2").arg(l[0]).arg(l[1]);
+ url = TQString::fromLatin1("smb://%1/%2").arg(l[0]).arg(l[1]);
else
- url = QString::fromLatin1("smb://%1/%2/%3").arg(map["workgroup"]).arg(l[0]).arg(l[1]);
+ url = TQString::fromLatin1("smb://%1/%2/%3").arg(map["workgroup"]).arg(l[0]).arg(l[1]);
url.setUser(map["user"]);
url.setPass(map["password"]);
}
else if (type == "DIRECT")
- url = QString::fromLatin1("socket://%1:%2").arg(map["printer_ip"]).arg(map["port"]);
+ url = TQString::fromLatin1("socket://%1:%2").arg(map["printer_ip"]).arg(map["port"]);
else if (type == "NCP")
{
- url = QString::fromLatin1("ncp://%1/%2").arg(map["server"]).arg(map["queue"]);
+ url = TQString::fromLatin1("ncp://%1/%2").arg(map["server"]).arg(map["queue"]);
url.setUser(map["user"]);
url.setPass(map["password"]);
}
@@ -146,12 +146,12 @@ bool KMLpdManager::createPrinter(KMPrinter *printer)
{
// remote lpd queue
ent->m_args["rm"] = printer->device().host();
- ent->m_args["rp"] = printer->device().path().replace("/",QString::fromLatin1(""));
+ ent->m_args["rp"] = printer->device().path().replace("/",TQString::fromLatin1(""));
ent->m_args["lpd_bounce"] = "true";
- ent->m_comment = QString::fromLatin1("##PRINTTOOL3## REMOTE");
+ ent->m_comment = TQString::fromLatin1("##PRINTTOOL3## REMOTE");
}
ent->m_args["mx"] = (printer->option("mx").isEmpty() ? "#0" : printer->option("mx"));
- ent->m_args["sh"] = QString::null;
+ ent->m_args["sh"] = TQString::null;
// create spool directory (if necessary) and update PrintcapEntry object
if (!createSpooldir(ent))
{
@@ -184,10 +184,10 @@ bool KMLpdManager::createPrinter(KMPrinter *printer)
}
// 4) change permissions of spool directory
- QCString cmd = "chmod -R o-rwx,g+rwX ";
- cmd += QFile::encodeName(KProcess::quote(ent->arg("sd")));
+ TQCString cmd = "chmod -R o-rwx,g+rwX ";
+ cmd += TQFile::encodeName(KProcess::quote(ent->arg("sd")));
cmd += "&& chown -R lp.lp ";
- cmd += QFile::encodeName(KProcess::quote(ent->arg("sd")));
+ cmd += TQFile::encodeName(KProcess::quote(ent->arg("sd")));
if (system(cmd.data()) != 0)
{
setErrorMsg(i18n("Unable to set correct permissions on spool directory %1 for printer <b>%2</b>.").arg(ent->arg("sd")).arg(ent->m_name));
@@ -208,8 +208,8 @@ bool KMLpdManager::removePrinter(KMPrinter *printer)
m_entries.insert(ent->m_name,ent);
return false;
}
- QCString cmd = "rm -rf ";
- cmd += QFile::encodeName(KProcess::quote(ent->arg("sd")));
+ TQCString cmd = "rm -rf ";
+ cmd += TQFile::encodeName(KProcess::quote(ent->arg("sd")));
system(cmd.data());
delete ent;
return true;
@@ -259,9 +259,9 @@ bool KMLpdManager::disablePrinter(KMPrinter *printer)
void KMLpdManager::listPrinters()
{
m_entries.clear();
- loadPrintcapFile(QString::fromLatin1("%1/etc/printcap").arg(lpdprefix));
+ loadPrintcapFile(TQString::fromLatin1("%1/etc/printcap").arg(lpdprefix));
- QDictIterator<PrintcapEntry> it(m_entries);
+ TQDictIterator<PrintcapEntry> it(m_entries);
for (;it.current();++it)
{
KMPrinter *printer = it.current()->createPrinter();
@@ -271,7 +271,7 @@ void KMLpdManager::listPrinters()
checkStatus();
}
-QString KMLpdManager::programName(int f)
+TQString KMLpdManager::programName(int f)
{
KConfig *conf = KMFactory::self()->printConfig();
conf->setGroup("LPD");
@@ -281,7 +281,7 @@ QString KMLpdManager::programName(int f)
case 1: return conf->readPathEntry("LpdQueue","lpq");
case 2: return conf->readPathEntry("LpdRemove","lprm");
}
- return QString::null;
+ return TQString::null;
}
void KMLpdManager::checkStatus()
@@ -312,7 +312,7 @@ void KMLpdManager::checkStatus()
bool KMLpdManager::writePrinters()
{
- if (!writePrintcapFile(QString::fromLatin1("%1/etc/printcap").arg(lpdprefix)))
+ if (!writePrintcapFile(TQString::fromLatin1("%1/etc/printcap").arg(lpdprefix)))
{
setErrorMsg(i18n("Unable to write printcap file."));
return false;
@@ -320,7 +320,7 @@ bool KMLpdManager::writePrinters()
return true;
}
-void KMLpdManager::loadPrintcapFile(const QString& filename)
+void KMLpdManager::loadPrintcapFile(const TQString& filename)
{
QFile f(filename);
if (f.exists() && f.open(IO_ReadOnly))
@@ -348,14 +348,14 @@ void KMLpdManager::loadPrintcapFile(const QString& filename)
}
}
-bool KMLpdManager::writePrintcapFile(const QString& filename)
+bool KMLpdManager::writePrintcapFile(const TQString& filename)
{
QFile f(filename);
if (f.open(IO_WriteOnly))
{
QTextStream t(&f);
t << "# File generated by KDE print (LPD plugin).\n#Don't edit by hand." << endl << endl;
- QDictIterator<PrintcapEntry> it(m_entries);
+ TQDictIterator<PrintcapEntry> it(m_entries);
for (;it.current();++it)
it.current()->writeEntry(t);
return true;
@@ -363,7 +363,7 @@ bool KMLpdManager::writePrintcapFile(const QString& filename)
return false;
}
-PrinttoolEntry* KMLpdManager::findPrinttoolEntry(const QString& name)
+PrinttoolEntry* KMLpdManager::findPrinttoolEntry(const TQString& name)
{
if (m_ptentries.count() == 0)
loadPrinttoolDb(driverDirectory()+"/printerdb");
@@ -373,7 +373,7 @@ PrinttoolEntry* KMLpdManager::findPrinttoolEntry(const QString& name)
return ent;
}
-void KMLpdManager::loadPrinttoolDb(const QString& filename)
+void KMLpdManager::loadPrinttoolDb(const TQString& filename)
{
QFile f(filename);
if (f.exists() && f.open(IO_ReadOnly))
@@ -404,7 +404,7 @@ DrMain* KMLpdManager::loadDbDriver(KMDBEntry *entry)
return NULL;
}
-PrintcapEntry* KMLpdManager::findPrintcapEntry(const QString& name)
+PrintcapEntry* KMLpdManager::findPrintcapEntry(const TQString& name)
{
PrintcapEntry *ent = m_entries.find(name);
if (!ent)
@@ -420,9 +420,9 @@ DrMain* KMLpdManager::loadPrinterDriver(KMPrinter *printer, bool config)
// check for printtool driver (only for configuration)
QString sd = entry->arg("sd"), dr(entry->comment(7));
- if (QFile::exists(sd+"/postscript.cfg") && config && !dr.isEmpty())
+ if (TQFile::exists(sd+"/postscript.cfg") && config && !dr.isEmpty())
{
- QMap<QString,QString> map = loadPrinttoolCfgFile(sd+"/postscript.cfg");
+ TQMap<TQString,TQString> map = loadPrinttoolCfgFile(sd+"/postscript.cfg");
PrinttoolEntry *ptentry = findPrinttoolEntry(dr);
if (!ptentry)
return NULL;
@@ -443,7 +443,7 @@ DrMain* KMLpdManager::loadPrinterDriver(KMPrinter *printer, bool config)
return NULL;
}
-bool KMLpdManager::checkGsDriver(const QString& gsdriver)
+bool KMLpdManager::checkGsDriver(const TQString& gsdriver)
{
if (gsdriver == "ppa" || gsdriver == "POSTSCRIPT" || gsdriver == "TEXT")
return true;
@@ -455,10 +455,10 @@ bool KMLpdManager::checkGsDriver(const QString& gsdriver)
return true;
}
-QMap<QString,QString> KMLpdManager::loadPrinttoolCfgFile(const QString& filename)
+TQMap<TQString,TQString> KMLpdManager::loadPrinttoolCfgFile(const TQString& filename)
{
QFile f(filename);
- QMap<QString,QString> map;
+ TQMap<TQString,TQString> map;
if (f.exists() && f.open(IO_ReadOnly))
{
QTextStream t(&f);
@@ -485,11 +485,11 @@ QMap<QString,QString> KMLpdManager::loadPrinttoolCfgFile(const QString& filename
return map;
}
-bool KMLpdManager::savePrinttoolCfgFile(const QString& templatefile, const QString& dirname, const QMap<QString,QString>& options)
+bool KMLpdManager::savePrinttoolCfgFile(const TQString& templatefile, const TQString& dirname, const TQMap<TQString,TQString>& options)
{
// defines input and output file
- QString fname = QFileInfo(templatefile).fileName();
- fname.replace(QRegExp("\\.in$"),QString::fromLatin1(""));
+ QString fname = TQFileInfo(templatefile).fileName();
+ fname.replace(TQRegExp("\\.in$"),TQString::fromLatin1(""));
QFile fin(templatefile);
QFile fout(dirname + "/" + fname);
if (fin.exists() && fin.open(IO_ReadOnly) && fout.open(IO_WriteOnly))
@@ -508,7 +508,7 @@ bool KMLpdManager::savePrinttoolCfgFile(const QString& templatefile, const QStri
if (line.startsWith("export "))
{
tout << "export ";
- line.replace(0,7,QString::fromLatin1(""));
+ line.replace(0,7,TQString::fromLatin1(""));
}
if ((p=line.find('=')) != -1)
{
@@ -533,7 +533,7 @@ bool KMLpdManager::savePrinterDriver(KMPrinter *printer, DrMain *driver)
if (driver->get("drtype") == "printtool" && !spooldir.isEmpty())
{
- QMap<QString,QString> options;
+ TQMap<TQString,TQString> options;
driver->getOptions(options,true);
// add some standard options
options["DESIRED_TO"] = "ps";
@@ -543,15 +543,15 @@ bool KMLpdManager::savePrinterDriver(KMPrinter *printer, DrMain *driver)
return false;
QString resol(options["RESOLUTION"]), color(options["COLOR"]);
// update entry comment to make printtool happy and save printcap file
- ent->m_comment = QString::fromLatin1("##PRINTTOOL3## %1 %2 %3 %4 {} {%5} %6 {}").arg(options["PRINTER_TYPE"]).arg(options["GSDEVICE"]).arg((resol.isEmpty() ? QString::fromLatin1("NAxNA") : resol)).arg(options["PAPERSIZE"]).arg(driver->name()).arg((color.isEmpty() ? QString::fromLatin1("Default") : color.right(color.length()-15)));
- ent->m_args["if"] = spooldir+QString::fromLatin1("/filter");
+ ent->m_comment = TQString::fromLatin1("##PRINTTOOL3## %1 %2 %3 %4 {} {%5} %6 {}").arg(options["PRINTER_TYPE"]).arg(options["GSDEVICE"]).arg((resol.isEmpty() ? TQString::fromLatin1("NAxNA") : resol)).arg(options["PAPERSIZE"]).arg(driver->name()).arg((color.isEmpty() ? TQString::fromLatin1("Default") : color.right(color.length()-15)));
+ ent->m_args["if"] = spooldir+TQString::fromLatin1("/filter");
if (!writePrinters())
return false;
// write various driver files using templates
- QCString cmd = "cp ";
- cmd += QFile::encodeName(KProcess::quote(driverDirectory()+"/master-filter"));
+ TQCString cmd = "cp ";
+ cmd += TQFile::encodeName(KProcess::quote(driverDirectory()+"/master-filter"));
cmd += " ";
- cmd += QFile::encodeName(KProcess::quote(spooldir + "/filter"));
+ cmd += TQFile::encodeName(KProcess::quote(spooldir + "/filter"));
if (system(cmd.data()) == 0 &&
savePrinttoolCfgFile(driverDirectory()+"/general.cfg.in",spooldir,options) &&
savePrinttoolCfgFile(driverDirectory()+"/postscript.cfg.in",spooldir,options) &&
@@ -566,11 +566,11 @@ bool KMLpdManager::createPrinttoolEntry(KMPrinter *printer, PrintcapEntry *entry
{
KURL dev(printer->device());
QString prot = dev.protocol(), sd(entry->arg("sd"));
- entry->m_comment = QString::fromLatin1("##PRINTTOOL3## %1").arg(ptPrinterType(printer));
+ entry->m_comment = TQString::fromLatin1("##PRINTTOOL3## %1").arg(ptPrinterType(printer));
if (prot == "smb" || prot == "ncp" || prot == "socket")
{
- entry->m_args["af"] = sd+QString::fromLatin1("/acct");
- QFile f(sd+QString::fromLatin1("/.config"));
+ entry->m_args["af"] = sd+TQString::fromLatin1("/acct");
+ QFile f(sd+TQString::fromLatin1("/.config"));
if (f.open(IO_WriteOnly))
{
QTextStream t(&f);
@@ -578,11 +578,11 @@ bool KMLpdManager::createPrinttoolEntry(KMPrinter *printer, PrintcapEntry *entry
{
t << "printer_ip=" << dev.host() << endl;
t << "port=" << dev.port() << endl;
- entry->m_args["if"] = driverDirectory()+QString::fromLatin1("/directprint");
+ entry->m_args["if"] = driverDirectory()+TQString::fromLatin1("/directprint");
}
else if (prot == "smb")
{
- QStringList l = QStringList::split('/',dev.path(),false);
+ QStringList l = TQStringList::split('/',dev.path(),false);
if (l.count() == 2)
{
t << "share='\\\\" << l[0] << '\\' << l[1] << '\'' << endl;
@@ -594,20 +594,20 @@ bool KMLpdManager::createPrinttoolEntry(KMPrinter *printer, PrintcapEntry *entry
t << "hostip=" << endl;
t << "user='" << dev.user() << '\'' << endl;
t << "password='" << dev.pass() << '\'' << endl;
- t << "workgroup='" << (l.count() == 2 ? dev.host() : QString::fromLatin1("")) << '\'' << endl;
- entry->m_args["if"] = driverDirectory()+QString::fromLatin1("/smbprint");
+ t << "workgroup='" << (l.count() == 2 ? dev.host() : TQString::fromLatin1("")) << '\'' << endl;
+ entry->m_args["if"] = driverDirectory()+TQString::fromLatin1("/smbprint");
}
else if (prot == "ncp")
{
t << "server=" << dev.host() << endl;
- t << "queue=" << dev.path().replace("/",QString::fromLatin1("")) << endl;
+ t << "queue=" << dev.path().replace("/",TQString::fromLatin1("")) << endl;
t << "user=" << dev.user() << endl;
t << "password=" << dev.pass() << endl;
- entry->m_args["if"] = driverDirectory()+QString::fromLatin1("/ncpprint");
+ entry->m_args["if"] = driverDirectory()+TQString::fromLatin1("/ncpprint");
}
}
else return false;
- entry->m_args["lp"] = QString::fromLatin1("/dev/null");
+ entry->m_args["lp"] = TQString::fromLatin1("/dev/null");
}
else if (prot != "lpd")
entry->m_args["lp"] = dev.path();
@@ -618,14 +618,14 @@ bool KMLpdManager::createSpooldir(PrintcapEntry *entry)
{
// first check if it has a "sd" defined
if (entry->arg("sd").isEmpty())
- entry->m_args["sd"] = QString::fromLatin1("/var/spool/lpd/")+entry->m_name;
+ entry->m_args["sd"] = TQString::fromLatin1("/var/spool/lpd/")+entry->m_name;
QString sd = entry->arg("sd");
if (!KStandardDirs::exists(sd))
{
if (!KStandardDirs::makeDir(sd,0750))
return false;
struct passwd *lp_pw = getpwnam("lp");
- if (lp_pw && chown(QFile::encodeName(sd),lp_pw->pw_uid,lp_pw->pw_gid) != 0)
+ if (lp_pw && chown(TQFile::encodeName(sd),lp_pw->pw_uid,lp_pw->pw_gid) != 0)
return false;
}
return true;
@@ -639,7 +639,7 @@ bool KMLpdManager::validateDbDriver(KMDBEntry *entry)
//************************************************************************************************
-QString ptPrinterType(KMPrinter *p)
+TQString ptPrinterType(KMPrinter *p)
{
QString type, prot = p->device().protocol();
if (prot == "lpd") type = "REMOTE";
diff --git a/kdeprint/lpd/kmlpdmanager.h b/kdeprint/lpd/kmlpdmanager.h
index e38fdb6aa..0af2d1e15 100644
--- a/kdeprint/lpd/kmlpdmanager.h
+++ b/kdeprint/lpd/kmlpdmanager.h
@@ -21,7 +21,7 @@
#define KMLPDMANAGER_H
#include "kmmanager.h"
-#include <qdict.h>
+#include <tqdict.h>
class PrintcapEntry;
class PrinttoolEntry;
@@ -30,7 +30,7 @@ class GsChecker;
class KMLpdManager : public KMManager
{
public:
- KMLpdManager(QObject *parent = 0, const char *name = 0);
+ KMLpdManager(TQObject *parent = 0, const char *name = 0);
~KMLpdManager();
bool completePrinterShort(KMPrinter*);
@@ -41,8 +41,8 @@ public:
bool disablePrinter(KMPrinter*);
// Driver DB functions
- QString driverDbCreationProgram();
- QString driverDirectory();
+ TQString driverDbCreationProgram();
+ TQString driverDirectory();
// Driver loading functions
DrMain* loadDbDriver(KMDBEntry*);
@@ -53,23 +53,23 @@ public:
protected:
void listPrinters();
bool writePrinters();
- void loadPrintcapFile(const QString& filename);
- bool writePrintcapFile(const QString& filename);
- void loadPrinttoolDb(const QString& filename);
- QMap<QString,QString> loadPrinttoolCfgFile(const QString& filename);
- bool savePrinttoolCfgFile(const QString& templatefile, const QString& dirname, const QMap<QString,QString>& options);
- bool checkGsDriver(const QString& gsdriver);
+ void loadPrintcapFile(const TQString& filename);
+ bool writePrintcapFile(const TQString& filename);
+ void loadPrinttoolDb(const TQString& filename);
+ TQMap<TQString,TQString> loadPrinttoolCfgFile(const TQString& filename);
+ bool savePrinttoolCfgFile(const TQString& templatefile, const TQString& dirname, const TQMap<TQString,TQString>& options);
+ bool checkGsDriver(const TQString& gsdriver);
bool createSpooldir(PrintcapEntry*);
bool createPrinttoolEntry(KMPrinter*, PrintcapEntry*);
- PrintcapEntry* findPrintcapEntry(const QString& name);
- PrinttoolEntry* findPrinttoolEntry(const QString& name);
- QString programName(int);
+ PrintcapEntry* findPrintcapEntry(const TQString& name);
+ PrinttoolEntry* findPrinttoolEntry(const TQString& name);
+ TQString programName(int);
void checkStatus();
bool enablePrinter(KMPrinter*, bool);
private:
- QDict<PrintcapEntry> m_entries;
- QDict<PrinttoolEntry> m_ptentries;
+ TQDict<PrintcapEntry> m_entries;
+ TQDict<PrinttoolEntry> m_ptentries;
GsChecker *m_gschecker;
};
diff --git a/kdeprint/lpd/kmlpduimanager.cpp b/kdeprint/lpd/kmlpduimanager.cpp
index 911f96b12..be243c688 100644
--- a/kdeprint/lpd/kmlpduimanager.cpp
+++ b/kdeprint/lpd/kmlpduimanager.cpp
@@ -26,10 +26,10 @@
#include "kmpropbackend.h"
#include "kmpropdriver.h"
-#include <qfile.h>
+#include <tqfile.h>
#include <klocale.h>
-KMLpdUiManager::KMLpdUiManager(QObject *parent, const char *name)
+KMLpdUiManager::KMLpdUiManager(TQObject *parent, const char *name)
: KMUiManager(parent,name)
{
}
@@ -48,9 +48,9 @@ void KMLpdUiManager::setupWizard(KMWizard *wizard)
backend->addBackend(KMWizard::File,i18n("File printer (print to file)"),true);
KMManager *mgr = KMFactory::self()->manager();
- if (QFile::exists(mgr->driverDirectory()+"/smbprint")) backend->enableBackend(KMWizard::SMB,true);
- if (QFile::exists(mgr->driverDirectory()+"/directprint")) backend->enableBackend(KMWizard::TCP,true);
- if (QFile::exists(mgr->driverDirectory()+"/ncpprint")) backend->enableBackend(KMWizard::Custom+1,true);
+ if (TQFile::exists(mgr->driverDirectory()+"/smbprint")) backend->enableBackend(KMWizard::SMB,true);
+ if (TQFile::exists(mgr->driverDirectory()+"/directprint")) backend->enableBackend(KMWizard::TCP,true);
+ if (TQFile::exists(mgr->driverDirectory()+"/ncpprint")) backend->enableBackend(KMWizard::Custom+1,true);
}
void KMLpdUiManager::setupPropertyPages(KMPropertyPage *p)
diff --git a/kdeprint/lpd/kmlpduimanager.h b/kdeprint/lpd/kmlpduimanager.h
index df3fb4561..0483df181 100644
--- a/kdeprint/lpd/kmlpduimanager.h
+++ b/kdeprint/lpd/kmlpduimanager.h
@@ -25,7 +25,7 @@
class KMLpdUiManager : public KMUiManager
{
public:
- KMLpdUiManager(QObject *parent = 0, const char *name = 0);
+ KMLpdUiManager(TQObject *parent = 0, const char *name = 0);
~KMLpdUiManager();
void setupWizard(KMWizard*);
diff --git a/kdeprint/lpd/lpdtools.cpp b/kdeprint/lpd/lpdtools.cpp
index bba934e61..3b1651337 100644
--- a/kdeprint/lpd/lpdtools.cpp
+++ b/kdeprint/lpd/lpdtools.cpp
@@ -21,7 +21,7 @@
#include "driver.h"
#include "kmprinter.h"
-#include <qfile.h>
+#include <tqfile.h>
#include <klocale.h>
static const char *pt_pagesize[] = {
@@ -53,7 +53,7 @@ void setupBooleanOption(DrBooleanOption *opt)
}
}
-QString nextWord(const QString& s, int& pos)
+TQString nextWord(const TQString& s, int& pos)
{
int p1(pos), p2(0);
while (s[p1].isSpace() && p1 < (int)s.length()) p1++;
@@ -73,9 +73,9 @@ QString nextWord(const QString& s, int& pos)
//************************************************************************************************
-bool PrintcapEntry::readLine(const QString& line)
+bool PrintcapEntry::readLine(const TQString& line)
{
- QStringList l = QStringList::split(':',line,false);
+ QStringList l = TQStringList::split(':',line,false);
if (l.count() > 0)
{
m_name = l[0];
@@ -97,12 +97,12 @@ bool PrintcapEntry::readLine(const QString& line)
return false;
}
-void PrintcapEntry::writeEntry(QTextStream& t)
+void PrintcapEntry::writeEntry(TQTextStream& t)
{
if (m_comment.isEmpty()) t << "# Entry for printer " << m_name << endl;
else t << m_comment << endl;
t << m_name << ":";
- for (QMap<QString,QString>::ConstIterator it=m_args.begin(); it!=m_args.end(); ++it)
+ for (TQMap<TQString,TQString>::ConstIterator it=m_args.begin(); it!=m_args.end(); ++it)
{
t << "\\\n\t:" << it.key();
if (!it.data().isEmpty())
@@ -112,7 +112,7 @@ void PrintcapEntry::writeEntry(QTextStream& t)
t << endl << endl;
}
-QString PrintcapEntry::comment(int index)
+TQString PrintcapEntry::comment(int index)
{
QString w;
if (m_comment.startsWith("##PRINTTOOL3##"))
@@ -129,7 +129,7 @@ KMPrinter* PrintcapEntry::createPrinter()
KMPrinter *printer = new KMPrinter();
printer->setName(m_name);
printer->setPrinterName(m_name);
- printer->setInstanceName(QString::null);
+ printer->setInstanceName(TQString::null);
printer->setState(KMPrinter::Idle);
printer->setType(KMPrinter::Printer);
return printer;
@@ -137,7 +137,7 @@ KMPrinter* PrintcapEntry::createPrinter()
//************************************************************************************************
-QStringList splitPrinttoolLine(const QString& line)
+TQStringList splitPrinttoolLine(const TQString& line)
{
QStringList l;
int p = line.find(':');
@@ -164,7 +164,7 @@ QStringList splitPrinttoolLine(const QString& line)
return l;
}
-bool PrinttoolEntry::readEntry(QTextStream& t)
+bool PrinttoolEntry::readEntry(TQTextStream& t)
{
QString line;
QStringList args;
@@ -253,15 +253,15 @@ DrMain* PrinttoolEntry::createDriver()
lopt->setName("RESOLUTION");
lopt->set("text",i18n("Resolution"));
gr->addOption(lopt);
- QPtrListIterator<Resolution> it(m_resolutions);
+ TQPtrListIterator<Resolution> it(m_resolutions);
for (int i=0;it.current();++it,i++)
{
ch = new DrBase;
- ch->setName(QString::fromLatin1("%1x%2").arg(it.current()->xdpi).arg(it.current()->ydpi));
+ ch->setName(TQString::fromLatin1("%1x%2").arg(it.current()->xdpi).arg(it.current()->ydpi));
if (it.current()->comment.isEmpty())
- ch->set("text",QString::fromLatin1("%1x%2 DPI").arg(it.current()->xdpi).arg(it.current()->ydpi));
+ ch->set("text",TQString::fromLatin1("%1x%2 DPI").arg(it.current()->xdpi).arg(it.current()->ydpi));
else
- ch->set("text",QString::fromLatin1("%2x%3 DPI (%1)").arg(it.current()->comment).arg(it.current()->xdpi).arg(it.current()->ydpi));
+ ch->set("text",TQString::fromLatin1("%2x%3 DPI (%1)").arg(it.current()->comment).arg(it.current()->xdpi).arg(it.current()->ydpi));
lopt->addChoice(ch);
}
QString defval = lopt->choices()->first()->name();
@@ -276,18 +276,18 @@ DrMain* PrinttoolEntry::createDriver()
lopt->setName("COLOR");
lopt->set("text",i18n("Color depth"));
gr->addOption(lopt);
- QPtrListIterator<BitsPerPixel> it(m_depths);
+ TQPtrListIterator<BitsPerPixel> it(m_depths);
for (int i=0;it.current();++it,i++)
{
ch = new DrBase;
if (m_gsdriver != "uniprint")
- ch->setName(QString::fromLatin1("-dBitsPerPixel=%1").arg(it.current()->bpp));
+ ch->setName(TQString::fromLatin1("-dBitsPerPixel=%1").arg(it.current()->bpp));
else
ch->setName(it.current()->bpp);
if (it.current()->comment.isEmpty())
ch->set("text",it.current()->bpp);
else
- ch->set("text",QString::fromLatin1("%1 - %2").arg(it.current()->bpp).arg(it.current()->comment));
+ ch->set("text",TQString::fromLatin1("%1 - %2").arg(it.current()->bpp).arg(it.current()->comment));
lopt->addChoice(ch);
}
QString defval = lopt->choices()->first()->name();
@@ -333,7 +333,7 @@ DrMain* PrinttoolEntry::createDriver()
while (pt_nup[i] != -1)
{
ch = new DrBase();
- ch->setName(QString::number(pt_nup[i++]));
+ ch->setName(TQString::number(pt_nup[i++]));
ch->set("text",ch->name());
lopt->addChoice(ch);
}
@@ -392,7 +392,7 @@ DrMain* PrinttoolEntry::createDriver()
//************************************************************************************************
-QString getPrintcapLine(QTextStream& t, QString *lastcomment)
+TQString getPrintcapLine(TQTextStream& t, TQString *lastcomment)
{
QString line, buffer, comm;
while (!t.eof())
diff --git a/kdeprint/lpd/lpdtools.h b/kdeprint/lpd/lpdtools.h
index 2f8b8c975..3592437e6 100644
--- a/kdeprint/lpd/lpdtools.h
+++ b/kdeprint/lpd/lpdtools.h
@@ -19,10 +19,10 @@
#ifndef LPDTOOLS_H
#define LPDTOOLS_H
-#include <qstring.h>
-#include <qmap.h>
-#include <qptrlist.h>
-#include <qtextstream.h>
+#include <tqstring.h>
+#include <tqmap.h>
+#include <tqptrlist.h>
+#include <tqtextstream.h>
class KMLpdManager;
class DrMain;
@@ -32,15 +32,15 @@ class PrintcapEntry
{
friend class KMLpdManager;
public:
- bool readLine(const QString& line);
- void writeEntry(QTextStream&);
+ bool readLine(const TQString& line);
+ void writeEntry(TQTextStream&);
KMPrinter* createPrinter();
- QString arg(const QString& key) const { return m_args[key]; }
- QString comment(int i);
+ TQString arg(const TQString& key) const { return m_args[key]; }
+ TQString comment(int i);
private:
QString m_name;
QString m_comment;
- QMap<QString,QString> m_args;
+ TQMap<TQString,TQString> m_args;
};
//*****************************************************************************************************
@@ -61,16 +61,16 @@ class PrinttoolEntry
{
friend class KMLpdManager;
public:
- bool readEntry(QTextStream& t);
+ bool readEntry(TQTextStream& t);
DrMain* createDriver();
private:
QString m_name, m_gsdriver, m_description, m_about;
- QPtrList<Resolution> m_resolutions;
- QPtrList<BitsPerPixel> m_depths;
+ TQPtrList<Resolution> m_resolutions;
+ TQPtrList<BitsPerPixel> m_depths;
};
//*****************************************************************************************************
-QString getPrintcapLine(QTextStream& t, QString *lastcomment = NULL);
+TQString getPrintcapLine(TQTextStream& t, TQString *lastcomment = NULL);
#endif // LPDTOOLS_H