diff options
Diffstat (limited to 'kdeprint/lpd')
-rw-r--r-- | kdeprint/lpd/gschecker.cpp | 6 | ||||
-rw-r--r-- | kdeprint/lpd/gschecker.h | 2 | ||||
-rw-r--r-- | kdeprint/lpd/klpdprinterimpl.cpp | 2 | ||||
-rw-r--r-- | kdeprint/lpd/kmlpdmanager.cpp | 102 | ||||
-rw-r--r-- | kdeprint/lpd/kmlpdmanager.h | 6 | ||||
-rw-r--r-- | kdeprint/lpd/lpdtools.cpp | 24 |
6 files changed, 71 insertions, 71 deletions
diff --git a/kdeprint/lpd/gschecker.cpp b/kdeprint/lpd/gschecker.cpp index d9f58b859..8f23fcc32 100644 --- a/kdeprint/lpd/gschecker.cpp +++ b/kdeprint/lpd/gschecker.cpp @@ -32,7 +32,7 @@ bool GsChecker::checkGsDriver(const TQString& name) { if (m_driverlist.count() == 0) loadDriverList(); - return m_driverlist.tqcontains(name); + return m_driverlist.contains(name); } void GsChecker::loadDriverList() @@ -48,12 +48,12 @@ void GsChecker::loadDriverList() line = t.readLine().stripWhiteSpace(); if (ok) { - if (line.tqfind(':') != -1) + if (line.find(':') != -1) break; else buffer.append(line).append(" "); } - else if (line.startsWith(TQString::tqfromLatin1("Available devices:"))) + else if (line.startsWith(TQString::fromLatin1("Available devices:"))) ok = true; } m_driverlist = TQStringList::split(' ',buffer,false); diff --git a/kdeprint/lpd/gschecker.h b/kdeprint/lpd/gschecker.h index 1814ca1d7..65f247380 100644 --- a/kdeprint/lpd/gschecker.h +++ b/kdeprint/lpd/gschecker.h @@ -24,7 +24,7 @@ #include <tqstringlist.h> #include <tqobject.h> -class GsChecker : public TQObject +class GsChecker : public QObject { public: GsChecker(TQObject *parent = 0, const char *name = 0); diff --git a/kdeprint/lpd/klpdprinterimpl.cpp b/kdeprint/lpd/klpdprinterimpl.cpp index 8b365cbd1..8a04927e6 100644 --- a/kdeprint/lpd/klpdprinterimpl.cpp +++ b/kdeprint/lpd/klpdprinterimpl.cpp @@ -46,6 +46,6 @@ bool KLpdPrinterImpl::setupCommand(TQString& 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 = TQString::tqfromLatin1("%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/kmlpdmanager.cpp b/kdeprint/lpd/kmlpdmanager.cpp index e7e640bc9..95623a56f 100644 --- a/kdeprint/lpd/kmlpdmanager.cpp +++ b/kdeprint/lpd/kmlpdmanager.cpp @@ -65,12 +65,12 @@ KMLpdManager::~KMLpdManager() TQString KMLpdManager::driverDbCreationProgram() { - return TQString::tqfromLatin1("make_driver_db_lpd"); + return TQString::fromLatin1("make_driver_db_lpd"); } TQString KMLpdManager::driverDirectory() { - return TQString::tqfromLatin1("/usr/lib/rhs/rhs-printfilters"); + return TQString::fromLatin1("/usr/lib/rhs/rhs-printfilters"); } bool KMLpdManager::completePrinter(KMPrinter *printer) @@ -80,7 +80,7 @@ bool KMLpdManager::completePrinter(KMPrinter *printer) bool KMLpdManager::completePrinterShort(KMPrinter *printer) { - PrintcapEntry *entry = m_entries.tqfind(printer->name()); + PrintcapEntry *entry = m_entries.find(printer->name()); if (entry) { QString type(entry->comment(2)), driver(entry->comment(7)), lp(entry->arg("lp")); @@ -91,11 +91,11 @@ bool KMLpdManager::completePrinterShort(KMPrinter *printer) KURL url; if (!entry->arg("rm").isEmpty()) { - url = TQString::tqfromLatin1("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 = TQString::tqfromLatin1("parallel:%1").arg(lp); + url = TQString::fromLatin1("parallel:%1").arg(lp); else if (TQFile::exists(entry->arg("sd")+"/.config")) { TQMap<TQString,TQString> map = loadPrinttoolCfgFile(entry->arg("sd")+"/.config"); @@ -103,17 +103,17 @@ bool KMLpdManager::completePrinterShort(KMPrinter *printer) { QStringList l = TQStringList::split('\\',map["share"],false); if (map["workgroup"].isEmpty()) - url = TQString::tqfromLatin1("smb://%1/%2").arg(l[0]).arg(l[1]); + url = TQString::fromLatin1("smb://%1/%2").arg(l[0]).arg(l[1]); else - url = TQString::tqfromLatin1("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 = TQString::tqfromLatin1("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 = TQString::tqfromLatin1("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"]); } @@ -127,7 +127,7 @@ bool KMLpdManager::completePrinterShort(KMPrinter *printer) bool KMLpdManager::createPrinter(KMPrinter *printer) { // 1) create the printcap entry - PrintcapEntry *ent = tqfindPrintcapEntry(printer->printerName()); + PrintcapEntry *ent = findPrintcapEntry(printer->printerName()); if (!ent) { ent = new PrintcapEntry(); @@ -146,9 +146,9 @@ bool KMLpdManager::createPrinter(KMPrinter *printer) { // remote lpd queue ent->m_args["rm"] = printer->device().host(); - ent->m_args["rp"] = printer->device().path().tqreplace("/",TQString::tqfromLatin1("")); + ent->m_args["rp"] = printer->device().path().replace("/",TQString::fromLatin1("")); ent->m_args["lpd_bounce"] = "true"; - ent->m_comment = TQString::tqfromLatin1("##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"] = TQString::null; @@ -199,7 +199,7 @@ bool KMLpdManager::createPrinter(KMPrinter *printer) bool KMLpdManager::removePrinter(KMPrinter *printer) { - PrintcapEntry *ent = tqfindPrintcapEntry(printer->printerName()); + PrintcapEntry *ent = findPrintcapEntry(printer->printerName()); if (ent) { ent = m_entries.take(printer->printerName()); @@ -259,7 +259,7 @@ bool KMLpdManager::disablePrinter(KMPrinter *printer) void KMLpdManager::listPrinters() { m_entries.clear(); - loadPrintcapFile(TQString::tqfromLatin1("%1/etc/printcap").arg(lpdprefix)); + loadPrintcapFile(TQString::fromLatin1("%1/etc/printcap").arg(lpdprefix)); TQDictIterator<PrintcapEntry> it(m_entries); for (;it.current();++it) @@ -268,7 +268,7 @@ void KMLpdManager::listPrinters() addPrinter(printer); } - checktqStatus(); + checkStatus(); } TQString KMLpdManager::programName(int f) @@ -284,7 +284,7 @@ TQString KMLpdManager::programName(int f) return TQString::null; } -void KMLpdManager::checktqStatus() +void KMLpdManager::checkStatus() { KPipeProcess proc; QString cmd = programName(0) + " status all"; @@ -299,11 +299,11 @@ void KMLpdManager::checktqStatus() line = t.readLine().stripWhiteSpace(); if (line.isEmpty()) continue; - if ((p=line.tqfind(':')) != -1) - printer = tqfindPrinter(line.left(p)); + if ((p=line.find(':')) != -1) + printer = findPrinter(line.left(p)); else if (line.startsWith("printing") && printer) - printer->setState(line.tqfind("enabled") != -1 ? KMPrinter::Idle : KMPrinter::Stopped); - else if (line.tqfind("entries") != -1 && printer) + printer->setState(line.find("enabled") != -1 ? KMPrinter::Idle : KMPrinter::Stopped); + else if (line.find("entries") != -1 && printer) if (!line.startsWith("no") && printer->state() == KMPrinter::Idle) printer->setState(KMPrinter::Processing); } @@ -312,7 +312,7 @@ void KMLpdManager::checktqStatus() bool KMLpdManager::writePrinters() { - if (!writePrintcapFile(TQString::tqfromLatin1("%1/etc/printcap").arg(lpdprefix))) + if (!writePrintcapFile(TQString::fromLatin1("%1/etc/printcap").arg(lpdprefix))) { setErrorMsg(i18n("Unable to write printcap file.")); return false; @@ -363,13 +363,13 @@ bool KMLpdManager::writePrintcapFile(const TQString& filename) return false; } -PrinttoolEntry* KMLpdManager::tqfindPrinttoolEntry(const TQString& name) +PrinttoolEntry* KMLpdManager::findPrinttoolEntry(const TQString& name) { if (m_ptentries.count() == 0) loadPrinttoolDb(driverDirectory()+"/printerdb"); - PrinttoolEntry *ent = m_ptentries.tqfind(name); + PrinttoolEntry *ent = m_ptentries.find(name); if (!ent) - setErrorMsg(i18n("Couldn't tqfind driver <b>%1</b> in printtool database.").arg(name)); + setErrorMsg(i18n("Couldn't find driver <b>%1</b> in printtool database.").arg(name)); return ent; } @@ -394,7 +394,7 @@ DrMain* KMLpdManager::loadDbDriver(KMDBEntry *entry) QString ptdbfilename = driverDirectory() + "/printerdb"; if (entry->file == ptdbfilename) { - PrinttoolEntry *ptentry = tqfindPrinttoolEntry(entry->modelname); + PrinttoolEntry *ptentry = findPrinttoolEntry(entry->modelname); if (ptentry) { DrMain *dr = ptentry->createDriver(); @@ -404,17 +404,17 @@ DrMain* KMLpdManager::loadDbDriver(KMDBEntry *entry) return NULL; } -PrintcapEntry* KMLpdManager::tqfindPrintcapEntry(const TQString& name) +PrintcapEntry* KMLpdManager::findPrintcapEntry(const TQString& name) { - PrintcapEntry *ent = m_entries.tqfind(name); + PrintcapEntry *ent = m_entries.find(name); if (!ent) - setErrorMsg(i18n("Couldn't tqfind printer <b>%1</b> in printcap file.").arg(name)); + setErrorMsg(i18n("Couldn't find printer <b>%1</b> in printcap file.").arg(name)); return ent; } DrMain* KMLpdManager::loadPrinterDriver(KMPrinter *printer, bool config) { - PrintcapEntry *entry = tqfindPrintcapEntry(printer->name()); + PrintcapEntry *entry = findPrintcapEntry(printer->name()); if (!entry) return NULL; @@ -423,7 +423,7 @@ DrMain* KMLpdManager::loadPrinterDriver(KMPrinter *printer, bool config) if (TQFile::exists(sd+"/postscript.cfg") && config && !dr.isEmpty()) { TQMap<TQString,TQString> map = loadPrinttoolCfgFile(sd+"/postscript.cfg"); - PrinttoolEntry *ptentry = tqfindPrinttoolEntry(dr); + PrinttoolEntry *ptentry = findPrinttoolEntry(dr); if (!ptentry) return NULL; DrMain *dr = ptentry->createDriver(); @@ -470,13 +470,13 @@ TQMap<TQString,TQString> KMLpdManager::loadPrinttoolCfgFile(const TQString& file if (line.isEmpty()) break; if (line.startsWith("export ")) - line.tqreplace(0,7,""); - if ((p=line.tqfind('=')) != -1) + line.replace(0,7,""); + if ((p=line.find('=')) != -1) { name = line.left(p); val = line.right(line.length()-p-1); - val.tqreplace("\"",""); - val.tqreplace("'",""); + val.replace("\"",""); + val.replace("'",""); if (!name.isEmpty() && !val.isEmpty()) map[name] = val; } @@ -489,7 +489,7 @@ bool KMLpdManager::savePrinttoolCfgFile(const TQString& templatefile, const TQSt { // defines input and output file QString fname = TQFileInfo(templatefile).fileName(); - fname.tqreplace(TQRegExp("\\.in$"),TQString::tqfromLatin1("")); + 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,9 +508,9 @@ bool KMLpdManager::savePrinttoolCfgFile(const TQString& templatefile, const TQSt if (line.startsWith("export ")) { tout << "export "; - line.tqreplace(0,7,TQString::tqfromLatin1("")); + line.replace(0,7,TQString::fromLatin1("")); } - if ((p=line.tqfind('=')) != -1) + if ((p=line.find('=')) != -1) { name = line.left(p); tout << name << '=' << options[name] << endl; @@ -526,7 +526,7 @@ bool KMLpdManager::savePrinterDriver(KMPrinter *printer, DrMain *driver) // To be able to save a printer driver, a printcap entry MUST exist. // We can then retrieve the spool directory from it. QString spooldir; - PrintcapEntry *ent = tqfindPrintcapEntry(printer->printerName()); + PrintcapEntry *ent = findPrintcapEntry(printer->printerName()); if (!ent) return false; spooldir = ent->arg("sd"); @@ -543,8 +543,8 @@ 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 = TQString::tqfromLatin1("##PRINTTOOL3## %1 %2 %3 %4 {} {%5} %6 {}").arg(options["PRINTER_TYPE"]).arg(options["GSDEVICE"]).arg((resol.isEmpty() ? TQString::tqfromLatin1("NAxNA") : resol)).arg(options["PAPERSIZE"]).arg(driver->name()).arg((color.isEmpty() ? TQString::tqfromLatin1("Default") : color.right(color.length()-15))); - ent->m_args["if"] = spooldir+TQString::tqfromLatin1("/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 @@ -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 = TQString::tqfromLatin1("##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+TQString::tqfromLatin1("/acct"); - QFile f(sd+TQString::tqfromLatin1("/.config")); + entry->m_args["af"] = sd+TQString::fromLatin1("/acct"); + QFile f(sd+TQString::fromLatin1("/.config")); if (f.open(IO_WriteOnly)) { QTextStream t(&f); @@ -578,7 +578,7 @@ bool KMLpdManager::createPrinttoolEntry(KMPrinter *printer, PrintcapEntry *entry { t << "printer_ip=" << dev.host() << endl; t << "port=" << dev.port() << endl; - entry->m_args["if"] = driverDirectory()+TQString::tqfromLatin1("/directprint"); + entry->m_args["if"] = driverDirectory()+TQString::fromLatin1("/directprint"); } else if (prot == "smb") { @@ -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() : TQString::tqfromLatin1("")) << '\'' << endl; - entry->m_args["if"] = driverDirectory()+TQString::tqfromLatin1("/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().tqreplace("/",TQString::tqfromLatin1("")) << endl; + t << "queue=" << dev.path().replace("/",TQString::fromLatin1("")) << endl; t << "user=" << dev.user() << endl; t << "password=" << dev.pass() << endl; - entry->m_args["if"] = driverDirectory()+TQString::tqfromLatin1("/ncpprint"); + entry->m_args["if"] = driverDirectory()+TQString::fromLatin1("/ncpprint"); } } else return false; - entry->m_args["lp"] = TQString::tqfromLatin1("/dev/null"); + entry->m_args["lp"] = TQString::fromLatin1("/dev/null"); } else if (prot != "lpd") entry->m_args["lp"] = dev.path(); @@ -618,7 +618,7 @@ bool KMLpdManager::createSpooldir(PrintcapEntry *entry) { // first check if it has a "sd" defined if (entry->arg("sd").isEmpty()) - entry->m_args["sd"] = TQString::tqfromLatin1("/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)) { @@ -633,7 +633,7 @@ bool KMLpdManager::createSpooldir(PrintcapEntry *entry) bool KMLpdManager::validateDbDriver(KMDBEntry *entry) { - PrinttoolEntry *ptentry = tqfindPrinttoolEntry(entry->modelname); + PrinttoolEntry *ptentry = findPrinttoolEntry(entry->modelname); return (ptentry && checkGsDriver(ptentry->m_gsdriver)); } diff --git a/kdeprint/lpd/kmlpdmanager.h b/kdeprint/lpd/kmlpdmanager.h index be7aa4ab1..0af2d1e15 100644 --- a/kdeprint/lpd/kmlpdmanager.h +++ b/kdeprint/lpd/kmlpdmanager.h @@ -61,10 +61,10 @@ protected: bool checkGsDriver(const TQString& gsdriver); bool createSpooldir(PrintcapEntry*); bool createPrinttoolEntry(KMPrinter*, PrintcapEntry*); - PrintcapEntry* tqfindPrintcapEntry(const TQString& name); - PrinttoolEntry* tqfindPrinttoolEntry(const TQString& name); + PrintcapEntry* findPrintcapEntry(const TQString& name); + PrinttoolEntry* findPrinttoolEntry(const TQString& name); TQString programName(int); - void checktqStatus(); + void checkStatus(); bool enablePrinter(KMPrinter*, bool); private: diff --git a/kdeprint/lpd/lpdtools.cpp b/kdeprint/lpd/lpdtools.cpp index ee919ff95..3b1651337 100644 --- a/kdeprint/lpd/lpdtools.cpp +++ b/kdeprint/lpd/lpdtools.cpp @@ -60,7 +60,7 @@ TQString nextWord(const TQString& s, int& pos) if (s[p1] == '{') { p1++; - p2 = s.tqfind('}',p1); + p2 = s.find('}',p1); } else { @@ -81,12 +81,12 @@ bool PrintcapEntry::readLine(const TQString& line) m_name = l[0]; int p(-1); // discard aliases - if ((p=m_name.tqfind('|')) != -1) + if ((p=m_name.find('|')) != -1) m_name = m_name.left(p); m_args.clear(); for (uint i=1; i<l.count(); i++) { - int p = l[i].tqfind('='); + int p = l[i].find('='); if (p == -1) p = 2; QString key = l[i].left(p); QString value = l[i].right(l[i].length()-(l[i][p] == '=' ? p+1 : p)); @@ -140,22 +140,22 @@ KMPrinter* PrintcapEntry::createPrinter() TQStringList splitPrinttoolLine(const TQString& line) { QStringList l; - int p = line.tqfind(':'); + int p = line.find(':'); if (p != -1) { l.append(line.left(p)); - p = line.tqfind('{',p); + p = line.find('{',p); if (p == -1) l.append(line.right(line.length()-l[0].length()-1).stripWhiteSpace()); else { while (p != -1) { - int q = line.tqfind('}',p); + int q = line.find('}',p); if (q != -1) { l.append(line.mid(p+1,q-p-1)); - p = line.tqfind('{',q); + p = line.find('{',q); } else break; } @@ -257,11 +257,11 @@ DrMain* PrinttoolEntry::createDriver() for (int i=0;it.current();++it,i++) { ch = new DrBase; - ch->setName(TQString::tqfromLatin1("%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",TQString::tqfromLatin1("%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",TQString::tqfromLatin1("%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(); @@ -281,13 +281,13 @@ DrMain* PrinttoolEntry::createDriver() { ch = new DrBase; if (m_gsdriver != "uniprint") - ch->setName(TQString::tqfromLatin1("-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",TQString::tqfromLatin1("%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(); |