diff options
Diffstat (limited to 'kdeprint/lpr')
-rw-r--r-- | kdeprint/lpr/apshandler.cpp | 40 | ||||
-rw-r--r-- | kdeprint/lpr/editentrydialog.cpp | 12 | ||||
-rw-r--r-- | kdeprint/lpr/editentrydialog.h | 16 | ||||
-rw-r--r-- | kdeprint/lpr/kmconfiglpr.cpp | 6 | ||||
-rw-r--r-- | kdeprint/lpr/kmconfiglpr.h | 2 | ||||
-rw-r--r-- | kdeprint/lpr/kmlprjobmanager.cpp | 2 | ||||
-rw-r--r-- | kdeprint/lpr/kmlprmanager.cpp | 30 | ||||
-rw-r--r-- | kdeprint/lpr/kmlprmanager.h | 2 | ||||
-rw-r--r-- | kdeprint/lpr/lpchelper.cpp | 30 | ||||
-rw-r--r-- | kdeprint/lpr/lpchelper.h | 2 | ||||
-rw-r--r-- | kdeprint/lpr/lpqhelper.cpp | 10 | ||||
-rw-r--r-- | kdeprint/lpr/lpqhelper.h | 2 | ||||
-rw-r--r-- | kdeprint/lpr/lprhandler.cpp | 14 | ||||
-rw-r--r-- | kdeprint/lpr/lprhandler.h | 4 | ||||
-rw-r--r-- | kdeprint/lpr/lprngtoolhandler.cpp | 56 | ||||
-rw-r--r-- | kdeprint/lpr/lprngtoolhandler.h | 4 | ||||
-rw-r--r-- | kdeprint/lpr/lprsettings.cpp | 16 | ||||
-rw-r--r-- | kdeprint/lpr/matichandler.cpp | 80 | ||||
-rw-r--r-- | kdeprint/lpr/matichandler.h | 4 | ||||
-rw-r--r-- | kdeprint/lpr/matichelper.cpp | 4 | ||||
-rw-r--r-- | kdeprint/lpr/printcapentry.cpp | 2 | ||||
-rw-r--r-- | kdeprint/lpr/printcapentry.h | 14 | ||||
-rw-r--r-- | kdeprint/lpr/printcapreader.cpp | 4 |
23 files changed, 178 insertions, 178 deletions
diff --git a/kdeprint/lpr/apshandler.cpp b/kdeprint/lpr/apshandler.cpp index 526edaf49..57ac45311 100644 --- a/kdeprint/lpr/apshandler.cpp +++ b/kdeprint/lpr/apshandler.cpp @@ -63,7 +63,7 @@ bool ApsHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, bool shor if (!shortmode) { TQMap<TQString,TQString> opts = loadResources(entry); - if (opts.contains("PRINTER")) + if (opts.tqcontains("PRINTER")) { prt->setDescription(i18n("APS Driver (%1)").arg(opts["PRINTER"])); prt->setDriverInfo(prt->description()); @@ -72,8 +72,8 @@ bool ApsHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, bool shor if (prt->device().isEmpty()) { TQString prot; - QString smbname(sysconfDir() + "/" + prt->printerName() + "/smbclient.conf"); - QString ncpname(sysconfDir() + "/" + prt->printerName() + "/netware.conf"); + TQString smbname(sysconfDir() + "/" + prt->printerName() + "/smbclient.conf"); + TQString ncpname(sysconfDir() + "/" + prt->printerName() + "/netware.conf"); if (TQFile::exists(smbname)) { TQMap<TQString,TQString> opts = loadVarFile(smbname); @@ -139,19 +139,19 @@ TQMap<TQString,TQString> ApsHandler::loadResources(PrintcapEntry *entry) TQMap<TQString,TQString> ApsHandler::loadVarFile(const TQString& filename) { TQMap<TQString,TQString> opts; - QFile f(filename); + TQFile f(filename); if (f.open(IO_ReadOnly)) { - QTextStream t(&f); - QString line; + TQTextStream t(&f); + TQString line; int p(-1); while (!t.atEnd()) { line = t.readLine().stripWhiteSpace(); if (line.isEmpty() || line[0] == '#' || (p = line.tqfind('=')) == -1) continue; - QString variable = line.left(p).stripWhiteSpace(); - QString value = line.mid(p+1).stripWhiteSpace(); + TQString variable = line.left(p).stripWhiteSpace(); + TQString value = line.mid(p+1).stripWhiteSpace(); if (!value.isEmpty() && value[0] == '\'') value = value.mid(1, value.length()-2); opts[variable] = value; @@ -166,7 +166,7 @@ DrMain* ApsHandler::loadDriver(KMPrinter *prt, PrintcapEntry *entry, bool config if (driver /* && config */ ) // Load resources in all case, to get the correct page size { TQMap<TQString,TQString> opts = loadResources(entry); - if ( !config && opts.contains( "PAPERSIZE" ) ) + if ( !config && opts.tqcontains( "PAPERSIZE" ) ) { // this is needed to keep applications informed // about the current selected page size @@ -209,13 +209,13 @@ void ApsHandler::reset() PrintcapEntry* ApsHandler::createEntry(KMPrinter *prt) { - QString prot = prt->deviceProtocol(); + TQString prot = prt->deviceProtocol(); if (prot != "parallel" && prot != "lpd" && prot != "smb" && prot != "ncp") { manager()->setErrorMsg(i18n("Unsupported backend: %1.").arg(prot)); return NULL; } - QString path = sysconfDir() + "/" + prt->printerName(); + TQString path = sysconfDir() + "/" + prt->printerName(); if (!KStandardDirs::makeDir(path, 0755)) { manager()->setErrorMsg(i18n("Unable to create directory %1.").arg(path)); @@ -226,13 +226,13 @@ PrintcapEntry* ApsHandler::createEntry(KMPrinter *prt) // either "smb" or "ncp" TQFile::remove(path + "/smbclient.conf"); TQFile::remove(path + "/netware.conf"); - QFile f; + TQFile f; if (prot == "smb") { f.setName(path + "/smbclient.conf"); if (f.open(IO_WriteOnly)) { - QTextStream t(&f); + TQTextStream t(&f); TQString work, server, printer, user, passwd; if ( splitSmbURI( prt->device(), work, server, printer, user, passwd ) ) { @@ -275,7 +275,7 @@ PrintcapEntry* ApsHandler::createEntry(KMPrinter *prt) uri.replace( 0, 3, "smb" ); if ( splitSmbURI( uri, work, server, printer, user, passwd ) ) { - QTextStream t(&f); + TQTextStream t(&f); t << "NCP_SERVER='" << server << "'" << endl; t << "NCP_PRINTER='" << printer << "'" << endl; if (!user.isEmpty()) @@ -305,7 +305,7 @@ PrintcapEntry* ApsHandler::createEntry(KMPrinter *prt) entry = new PrintcapEntry; entry->addField("lp", Field::String, "/dev/null"); } - QString sd = LprSettings::self()->baseSpoolDir() + "/" + prt->printerName(); + TQString sd = LprSettings::self()->baseSpoolDir() + "/" + prt->printerName(); entry->addField("af", Field::String, sd + "/acct"); entry->addField("lf", Field::String, sd + "/log"); entry->addField("if", Field::String, sysconfDir() + "/basedir/bin/apsfilter"); @@ -322,10 +322,10 @@ bool ApsHandler::savePrinterDriver(KMPrinter *prt, PrintcapEntry *entry, DrMain manager()->setErrorMsg(i18n("The APS driver is not defined.")); return false; } - QFile f(sysconfDir() + "/" + prt->printerName() + "/apsfilterrc"); + TQFile f(sysconfDir() + "/" + prt->printerName() + "/apsfilterrc"); if (f.open(IO_WriteOnly)) { - QTextStream t(&f); + TQTextStream t(&f); t << "# File generated by KDEPrint" << endl; t << "PRINTER='" << driver->get("gsdriver") << "'" << endl; TQValueStack<DrGroup*> stack; @@ -337,7 +337,7 @@ bool ApsHandler::savePrinterDriver(KMPrinter *prt, PrintcapEntry *entry, DrMain for (; git.current(); ++git) stack.push(git.current()); TQPtrListIterator<DrBase> oit(grp->options()); - QString value; + TQString value; for (; oit.current(); ++oit) { value = oit.current()->valueText(); @@ -371,7 +371,7 @@ bool ApsHandler::savePrinterDriver(KMPrinter *prt, PrintcapEntry *entry, DrMain bool ApsHandler::removePrinter(KMPrinter*, PrintcapEntry *entry) { - QString path(sysconfDir() + "/" + entry->name); + TQString path(sysconfDir() + "/" + entry->name); TQFile::remove(path + "/smbclient.conf"); TQFile::remove(path + "/netware.conf"); TQFile::remove(path + "/apsfilterrc"); @@ -385,7 +385,7 @@ bool ApsHandler::removePrinter(KMPrinter*, PrintcapEntry *entry) TQString ApsHandler::printOptions(KPrinter *printer) { - QString optstr; + TQString optstr; TQMap<TQString,TQString> opts = printer->options(); for (TQMap<TQString,TQString>::ConstIterator it=opts.begin(); it!=opts.end(); ++it) { diff --git a/kdeprint/lpr/editentrydialog.cpp b/kdeprint/lpr/editentrydialog.cpp index 6b0fb63f7..9029a6736 100644 --- a/kdeprint/lpr/editentrydialog.cpp +++ b/kdeprint/lpr/editentrydialog.cpp @@ -34,10 +34,10 @@ EditEntryDialog::EditEntryDialog(PrintcapEntry *entry, TQWidget *parent, const char *name) : KDialogBase(parent, name, true, TQString::null, Ok|Cancel) { - QWidget *w = new TQWidget(this); + TQWidget *w = new TQWidget(this); setMainWidget(w); - QLabel *lab0 = new TQLabel(i18n("Aliases:"), w); + TQLabel *lab0 = new TQLabel(i18n("Aliases:"), w); m_aliases = new TQLineEdit(w); m_view = new KListView(w); m_view->addColumn(""); @@ -55,9 +55,9 @@ EditEntryDialog::EditEntryDialog(PrintcapEntry *entry, TQWidget *parent, const c m_stack->addWidget(m_number, 1); m_name = new TQLineEdit(w); - QVBoxLayout *l0 = new TQVBoxLayout(w, 0, 10); - QHBoxLayout *l1 = new TQHBoxLayout(0, 0, 10); - QHBoxLayout *l2 = new TQHBoxLayout(0, 0, 5); + TQVBoxLayout *l0 = new TQVBoxLayout(w, 0, 10); + TQHBoxLayout *l1 = new TQHBoxLayout(0, 0, 10); + TQHBoxLayout *l2 = new TQHBoxLayout(0, 0, 5); l0->addLayout(l1); l1->addWidget(lab0); l1->addWidget(m_aliases); @@ -72,7 +72,7 @@ EditEntryDialog::EditEntryDialog(PrintcapEntry *entry, TQWidget *parent, const c setCaption(i18n("Printcap Entry: %1").arg(entry->name)); m_fields = entry->fields; m_aliases->setText(entry->aliases.join("|")); - QListViewItem *root = new TQListViewItem(m_view, entry->name), *item = 0; + TQListViewItem *root = new TQListViewItem(m_view, entry->name), *item = 0; root->setSelectable(false); root->setOpen(true); root->setPixmap(0, SmallIcon("fileprint")); diff --git a/kdeprint/lpr/editentrydialog.h b/kdeprint/lpr/editentrydialog.h index bbde7613c..c51152627 100644 --- a/kdeprint/lpr/editentrydialog.h +++ b/kdeprint/lpr/editentrydialog.h @@ -28,7 +28,7 @@ class TQCheckBox; class TQSpinBox; class TQComboBox; class TQListView; -class QListviewItem; +class TQListviewItem; class TQWidgetStack; class EditEntryDialog : public KDialogBase @@ -49,13 +49,13 @@ protected: private: TQMap<TQString,Field> m_fields; - QLineEdit *m_name, *m_string, *m_aliases; - QCheckBox *m_boolean; - QComboBox *m_type; - QSpinBox *m_number; - QListView *m_view; - QWidgetStack *m_stack; - QString m_current; + TQLineEdit *m_name, *m_string, *m_aliases; + TQCheckBox *m_boolean; + TQComboBox *m_type; + TQSpinBox *m_number; + TQListView *m_view; + TQWidgetStack *m_stack; + TQString m_current; bool m_block; }; diff --git a/kdeprint/lpr/kmconfiglpr.cpp b/kdeprint/lpr/kmconfiglpr.cpp index 95a2e02d4..f9f51b46d 100644 --- a/kdeprint/lpr/kmconfiglpr.cpp +++ b/kdeprint/lpr/kmconfiglpr.cpp @@ -34,13 +34,13 @@ KMConfigLpr::KMConfigLpr(TQWidget *parent, const char *name) setPageHeader(i18n("Spooler Settings")); setPagePixmap("gear"); - QGroupBox *m_modebox = new TQGroupBox(1, Qt::Vertical, i18n("Spooler"), this); + TQGroupBox *m_modebox = new TQGroupBox(1, Qt::Vertical, i18n("Spooler"), this); m_mode = new TQComboBox(m_modebox); m_mode->insertItem("LPR (BSD compatible)"); m_mode->insertItem("LPRng"); - QVBoxLayout *l0 = new TQVBoxLayout(this, 5, 10); + TQVBoxLayout *l0 = new TQVBoxLayout(this, 5, 10); l0->addWidget(m_modebox); l0->addStretch(1); } @@ -54,7 +54,7 @@ void KMConfigLpr::saveConfig(KConfig *conf) { LprSettings::self()->setMode((LprSettings::Mode)(m_mode->currentItem())); - QString modestr; + TQString modestr; switch (m_mode->currentItem()) { default: diff --git a/kdeprint/lpr/kmconfiglpr.h b/kdeprint/lpr/kmconfiglpr.h index 2700e846c..1f88d9fb7 100644 --- a/kdeprint/lpr/kmconfiglpr.h +++ b/kdeprint/lpr/kmconfiglpr.h @@ -33,7 +33,7 @@ public: void saveConfig(KConfig*); private: - QComboBox *m_mode; + TQComboBox *m_mode; }; #endif diff --git a/kdeprint/lpr/kmlprjobmanager.cpp b/kdeprint/lpr/kmlprjobmanager.cpp index f002043d5..67e7a4001 100644 --- a/kdeprint/lpr/kmlprjobmanager.cpp +++ b/kdeprint/lpr/kmlprjobmanager.cpp @@ -60,7 +60,7 @@ int KMLprJobManager::actions() bool KMLprJobManager::sendCommandSystemJob(const TQPtrList<KMJob>& jobs, int action, const TQString& arg) { - QString msg; + TQString msg; TQPtrListIterator<KMJob> it(jobs); bool status(true); LpcHelper *helper = lpcHelper(); diff --git a/kdeprint/lpr/kmlprmanager.cpp b/kdeprint/lpr/kmlprmanager.cpp index 008674a78..d9bcae5e1 100644 --- a/kdeprint/lpr/kmlprmanager.cpp +++ b/kdeprint/lpr/kmlprmanager.cpp @@ -67,7 +67,7 @@ KMLprManager::KMLprManager(TQObject *parent, const char *name, const TQStringLis void KMLprManager::listPrinters() { - QFileInfo fi(LprSettings::self()->printcapFile()); + TQFileInfo fi(LprSettings::self()->printcapFile()); if (m_lpchelper) m_lpchelper->updateStates(); @@ -84,7 +84,7 @@ void KMLprManager::listPrinters() // try to open the printcap file and parse it PrintcapReader reader; - QFile f(fi.absFilePath()); + TQFile f(fi.absFilePath()); PrintcapEntry *entry; if (f.exists() && f.open(IO_ReadOnly)) { @@ -137,7 +137,7 @@ void KMLprManager::initHandlers() insertHandler(new LPRngToolHandler(this)); // now load external handlers - QStringList l = KGlobal::dirs()->findAllResources("data", "kdeprint/lpr/*.la"); + TQStringList l = KGlobal::dirs()->findAllResources("data", "kdeprint/lpr/*.la"); for (TQStringList::ConstIterator it=l.begin(); it!=l.end(); ++it) { KLibrary *library = KLibLoader::self()->library(TQFile::encodeName(*it)); @@ -158,7 +158,7 @@ void KMLprManager::initHandlers() LprHandler* KMLprManager::findHandler(KMPrinter *prt) { - QString handlerstr(prt->option("kde-lpr-handler")); + TQString handlerstr(prt->option("kde-lpr-handler")); LprHandler *handler(0); if (handlerstr.isEmpty() || (handler = m_handlers.tqfind(handlerstr)) == NULL) { @@ -231,7 +231,7 @@ DrMain* KMLprManager::loadPrinterDriver(KMPrinter *prt, bool config) DrMain* KMLprManager::loadFileDriver(const TQString& filename) { int p = filename.tqfind('/'); - QString handler_str = (p != -1 ? filename.left(p) : TQString::tqfromLatin1("default")); + TQString handler_str = (p != -1 ? filename.left(p) : TQString::tqfromLatin1("default")); LprHandler *handler = m_handlers.tqfind(handler_str); if (handler) { @@ -245,7 +245,7 @@ DrMain* KMLprManager::loadFileDriver(const TQString& filename) bool KMLprManager::enablePrinter(KMPrinter *prt, bool state) { - QString msg; + TQString msg; if (!m_lpchelper->enable(prt, state, msg)) { setErrorMsg(msg); @@ -256,7 +256,7 @@ bool KMLprManager::enablePrinter(KMPrinter *prt, bool state) bool KMLprManager::startPrinter(KMPrinter *prt, bool state) { - QString msg; + TQString msg; if (!m_lpchelper->start(prt, state, msg)) { setErrorMsg(msg); @@ -289,10 +289,10 @@ bool KMLprManager::savePrintcapFile() setErrorMsg(i18n("The printcap file is a remote file (NIS). It cannot be written.")); return false; } - QFile f(LprSettings::self()->printcapFile()); + TQFile f(LprSettings::self()->printcapFile()); if (f.open(IO_WriteOnly)) { - QTextStream t(&f); + TQTextStream t(&f); TQDictIterator<PrintcapEntry> it(m_entries); for (; it.current(); ++it) { @@ -338,7 +338,7 @@ bool KMLprManager::createPrinter(KMPrinter *prt) if (!prt->driver() && oldEntry) prt->setDriver(handler->loadDriver(prt, oldEntry, true)); - QString sd = LprSettings::self()->baseSpoolDir(); + TQString sd = LprSettings::self()->baseSpoolDir(); if (sd.isEmpty()) { setErrorMsg(i18n("Couldn't determine spool directory. See options dialog.")); @@ -376,7 +376,7 @@ bool KMLprManager::createPrinter(KMPrinter *prt) // in case of LPRng, we need to tell the daemon about new printer if (LprSettings::self()->mode() == LprSettings::LPRng) { - QString msg; + TQString msg; if (!m_lpchelper->restart(msg)) { setErrorMsg(i18n("The printer has been created but the print daemon " @@ -396,7 +396,7 @@ bool KMLprManager::removePrinter(KMPrinter *prt) { if (handler->removePrinter(prt, entry)) { - QString sd = entry->field("sd"); + TQString sd = entry->field("sd"); // first try to save the printcap file, and if // successful, remove the spool directory m_entries.take(prt->printerName()); @@ -428,10 +428,10 @@ TQString KMLprManager::driverDbCreationProgram() TQString KMLprManager::driverDirectory() { TQPtrListIterator<LprHandler> it(m_handlerlist); - QString dbDirs; + TQString dbDirs; for (; it.current(); ++it) { - QString dir = it.current()->driverDirectory(); + TQString dir = it.current()->driverDirectory(); if (!dir.isEmpty()) dbDirs.append(dir).append(":"); } @@ -443,7 +443,7 @@ TQString KMLprManager::driverDirectory() TQString KMLprManager::printOptions(KPrinter *prt) { KMPrinter *mprt = findPrinter(prt->printerName()); - QString opts; + TQString opts; if (mprt) { LprHandler *handler = findHandler(mprt); diff --git a/kdeprint/lpr/kmlprmanager.h b/kdeprint/lpr/kmlprmanager.h index 516494f95..d95fb7db5 100644 --- a/kdeprint/lpr/kmlprmanager.h +++ b/kdeprint/lpr/kmlprmanager.h @@ -74,7 +74,7 @@ private: TQDict<LprHandler> m_handlers; TQPtrList<LprHandler> m_handlerlist; TQDict<PrintcapEntry> m_entries; - QDateTime m_updtime; + TQDateTime m_updtime; LpcHelper *m_lpchelper; KMPrinter *m_currentprinter; }; diff --git a/kdeprint/lpr/lpchelper.cpp b/kdeprint/lpr/lpchelper.cpp index fb39a37f9..4fa32b8e0 100644 --- a/kdeprint/lpr/lpchelper.cpp +++ b/kdeprint/lpr/lpchelper.cpp @@ -33,10 +33,10 @@ static TQString execute(const TQString& cmd) { KPipeProcess proc; - QString output; + TQString output; if (proc.open(cmd)) { - QTextStream t(&proc); + TQTextStream t(&proc); while (!t.atEnd()) output.append(t.readLine()).append("\n"); proc.close(); @@ -49,7 +49,7 @@ LpcHelper::LpcHelper(TQObject *parent, const char *name) { // look for the "lpc" executable. Use the PATH variable and // add some specific dirs. - QString PATH = getenv("PATH"); + TQString PATH = getenv("PATH"); PATH.append(":/usr/sbin:/usr/local/sbin:/sbin:/opt/sbin:/opt/local/sbin"); m_exepath = KStandardDirs::findExe("lpc", PATH); m_checkpcpath = KStandardDirs::findExe("checkpc", PATH); @@ -62,7 +62,7 @@ LpcHelper::~LpcHelper() KMPrinter::PrinterState LpcHelper::state(const TQString& prname) const { - if (m_state.contains(prname)) + if (m_state.tqcontains(prname)) return m_state[prname]; return KMPrinter::Unknown; } @@ -74,7 +74,7 @@ KMPrinter::PrinterState LpcHelper::state(KMPrinter *prt) const void LpcHelper::parseStatusLPR(TQTextStream &t) { - QString printer, line; + TQString printer, line; int p(-1); while (!t.atEnd()) @@ -109,9 +109,9 @@ void LpcHelper::parseStatusLPR(TQTextStream &t) void LpcHelper::parseStatusLPRng(TQTextStream& t) { - QStringList l; + TQStringList l; int p(-1); - QString printer; + TQString printer; while (!t.atEnd()) if (t.readLine().stripWhiteSpace().startsWith("Printer")) @@ -146,7 +146,7 @@ void LpcHelper::updateStates() m_state.clear(); if (!m_exepath.isEmpty() && proc.open(m_exepath + " status all")) { - QTextStream t(&proc); + TQTextStream t(&proc); switch (LprSettings::self()->mode()) { @@ -211,7 +211,7 @@ static TQString lprngAnswer(const TQString& result, const TQString& printer) { q = result.tqfind(':', p)+2; p = result.tqfind('\n', q); - QString answer = result.mid(q, p-q).stripWhiteSpace(); + TQString answer = result.mid(q, p-q).stripWhiteSpace(); return answer; } return TQString::null; @@ -219,7 +219,7 @@ static TQString lprngAnswer(const TQString& result, const TQString& printer) int LpcHelper::parseStateChangeLPRng(const TQString& result, const TQString& printer) { - QString answer = lprngAnswer(result, printer); + TQString answer = lprngAnswer(result, printer); if (answer == "no") return -1; else if (answer == "disabled" || answer == "enabled" || answer == "started" || answer == "stopped") @@ -235,7 +235,7 @@ bool LpcHelper::changeState(const TQString& printer, const TQString& op, TQStrin msg = i18n("The executable %1 couldn't be found in your PATH.").arg("lpc"); return false; } - QString result = execute(m_exepath + " " + op + " " + KProcess::quote(printer)); + TQString result = execute(m_exepath + " " + op + " " + KProcess::quote(printer)); int status; switch (LprSettings::self()->mode()) @@ -273,7 +273,7 @@ bool LpcHelper::removeJob(KMJob *job, TQString& msg) msg = i18n("The executable %1 couldn't be found in your PATH.").arg("lprm"); return false; } - QString result = execute(m_lprmpath + " -P " + KProcess::quote(job->printer()) + " " + TQString::number(job->id())); + TQString result = execute(m_lprmpath + " -P " + KProcess::quote(job->printer()) + " " + TQString::number(job->id())); if (result.tqfind("dequeued") != -1) return true; else if (result.tqfind("Permission denied") != -1 || result.tqfind("no permissions") != -1) @@ -291,8 +291,8 @@ bool LpcHelper::changeJobState(KMJob *job, int state, TQString& msg) msg = i18n("The executable %1 couldn't be found in your PATH.").arg("lpc"); return false; } - QString result = execute(m_exepath + (state == KMJob::Held ? " hold " : " release ") + KProcess::quote(job->printer()) + " " + TQString::number(job->id())); - QString answer = lprngAnswer(result, job->printer()); + TQString result = execute(m_exepath + (state == KMJob::Held ? " hold " : " release ") + KProcess::quote(job->printer()) + " " + TQString::number(job->id())); + TQString answer = lprngAnswer(result, job->printer()); if (answer == "no") { msg = i18n("Permission denied."); @@ -304,7 +304,7 @@ bool LpcHelper::changeJobState(KMJob *job, int state, TQString& msg) bool LpcHelper::restart(TQString& msg) { - QString s; + TQString s; if (m_exepath.isEmpty()) s = "lpc"; else if (m_checkpcpath.isEmpty()) diff --git a/kdeprint/lpr/lpchelper.h b/kdeprint/lpr/lpchelper.h index 2c711f41b..8f2590065 100644 --- a/kdeprint/lpr/lpchelper.h +++ b/kdeprint/lpr/lpchelper.h @@ -53,7 +53,7 @@ protected: private: TQMap<TQString, KMPrinter::PrinterState> m_state; - QString m_exepath, m_lprmpath, m_checkpcpath; + TQString m_exepath, m_lprmpath, m_checkpcpath; }; #endif diff --git a/kdeprint/lpr/lpqhelper.cpp b/kdeprint/lpr/lpqhelper.cpp index aa8e19879..bbc70da3a 100644 --- a/kdeprint/lpr/lpqhelper.cpp +++ b/kdeprint/lpr/lpqhelper.cpp @@ -38,7 +38,7 @@ LpqHelper::~LpqHelper() KMJob* LpqHelper::parseLineLpr(const TQString& line) { - QString rank = line.left(7); + TQString rank = line.left(7); if (!rank[0].isDigit() && rank != "active") return NULL; KMJob *job = new KMJob; @@ -56,13 +56,13 @@ KMJob* LpqHelper::parseLineLpr(const TQString& line) KMJob* LpqHelper::parseLineLPRng(const TQString& line) { - QString rank = line.left(7).stripWhiteSpace(); + TQString rank = line.left(7).stripWhiteSpace(); if (!rank[0].isDigit() && rank != "active" && rank != "hold") return NULL; KMJob *job = new KMJob; job->setState((rank[0].isDigit() ? KMJob::Queued : (rank == "hold" ? KMJob::Held : KMJob::Printing))); int p = line.tqfind('@', 7), q = line.tqfind(' ', 7); - job->setOwner(line.mid(7, QMIN(p,q)-7)); + job->setOwner(line.mid(7, TQMIN(p,q)-7)); while (line[q].isSpace()) q++; q++; @@ -85,8 +85,8 @@ void LpqHelper::listJobs(TQPtrList<KMJob>& jobs, const TQString& prname, int lim KPipeProcess proc; if (!m_exepath.isEmpty() && proc.open(m_exepath + " -P " + KProcess::quote(prname))) { - QTextStream t(&proc); - QString line; + TQTextStream t(&proc); + TQString line; bool lprng = (LprSettings::self()->mode() == LprSettings::LPRng); int count = 0; diff --git a/kdeprint/lpr/lpqhelper.h b/kdeprint/lpr/lpqhelper.h index d79903f57..59965fb62 100644 --- a/kdeprint/lpr/lpqhelper.h +++ b/kdeprint/lpr/lpqhelper.h @@ -38,7 +38,7 @@ protected: KMJob* parseLineLPRng(const TQString&); private: - QString m_exepath; + TQString m_exepath; }; #endif diff --git a/kdeprint/lpr/lprhandler.cpp b/kdeprint/lpr/lprhandler.cpp index 4a2a96b0f..1cacfae85 100644 --- a/kdeprint/lpr/lprhandler.cpp +++ b/kdeprint/lpr/lprhandler.cpp @@ -121,7 +121,7 @@ PrintcapEntry* LprHandler::createEntry(KMPrinter *prt) { // this default handler only supports local parallel and remote lpd URIs KURL uri ( prt->device() ); - QString prot = uri.protocol(); + TQString prot = uri.protocol(); if (!prot.isEmpty() && prot != "parallel" && prot != "file" && prot != "lpd" && prot != "socket") { manager()->setErrorMsg(i18n("Unsupported backend: %1.").arg(prot)); @@ -132,7 +132,7 @@ PrintcapEntry* LprHandler::createEntry(KMPrinter *prt) if (prot == "lpd") { entry->addField("rm", Field::String, uri.host()); - QString rp = uri.path(); + TQString rp = uri.path(); if (rp[0] == '/') rp = rp.mid(1); entry->addField("rp", Field::String, rp); @@ -172,13 +172,13 @@ void LprHandler::reset() DrMain* LprHandler::loadToolDriver(const TQString& filename) { - QFile f(filename); + TQFile f(filename); if (f.open(IO_ReadOnly)) { DrMain *driver = new DrMain; TQValueStack<DrGroup*> groups; - QTextStream t(&f); - QStringList l; + TQTextStream t(&f); + TQStringList l; DrListOption *lopt(0); DrBase *opt(0); @@ -259,10 +259,10 @@ TQString LprHandler::driverDirInternal() TQString LprHandler::locateDir(const TQString& dirname, const TQString& paths) { - QStringList pathlist = TQStringList::split(':', paths, false); + TQStringList pathlist = TQStringList::split(':', paths, false); for (TQStringList::ConstIterator it=pathlist.begin(); it!=pathlist.end(); ++it) { - QString testpath = *it + "/" + dirname; + TQString testpath = *it + "/" + dirname; if (::access(TQFile::encodeName(testpath), F_OK) == 0) return testpath; } diff --git a/kdeprint/lpr/lprhandler.h b/kdeprint/lpr/lprhandler.h index 98b9c3819..eaab2557f 100644 --- a/kdeprint/lpr/lprhandler.h +++ b/kdeprint/lpr/lprhandler.h @@ -68,9 +68,9 @@ protected: virtual TQString driverDirInternal(); protected: - QString m_name; + TQString m_name; KMManager *m_manager; - QString m_cacheddriverdir; + TQString m_cacheddriverdir; }; inline TQString LprHandler::name() const diff --git a/kdeprint/lpr/lprngtoolhandler.cpp b/kdeprint/lpr/lprngtoolhandler.cpp index 624b74114..aea703ea5 100644 --- a/kdeprint/lpr/lprngtoolhandler.cpp +++ b/kdeprint/lpr/lprngtoolhandler.cpp @@ -47,10 +47,10 @@ bool LPRngToolHandler::validate(PrintcapEntry *entry) bool LPRngToolHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, bool shortmode) { - QString str, lp; + TQString str, lp; // look for type in comment - QStringList l = TQStringList::split(' ', entry->comment, false); + TQStringList l = TQStringList::split(' ', entry->comment, false); lp = entry->field("lp"); if (l.count() < 1) return false; @@ -60,7 +60,7 @@ bool LPRngToolHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, boo else if (l[1] == "SMB") { TQMap<TQString,TQString> opts = parseXferOptions(entry->field("xfer_options")); - QString user, pass; + TQString user, pass; loadAuthFile(LprSettings::self()->baseSpoolDir() + "/" + entry->name + "/" + opts["authfile"], user, pass); TQString uri = buildSmbURI( opts[ "workgroup" ], @@ -81,7 +81,7 @@ bool LPRngToolHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, boo //{ if (!(str=entry->field("ifhp")).isEmpty()) { - QString model; + TQString model; int p = str.tqfind("model"); if (p != -1) { @@ -107,7 +107,7 @@ TQMap<TQString,TQString> LPRngToolHandler::parseXferOptions(const TQString& str) { uint p(0), q; TQMap<TQString,TQString> opts; - QString key, val; + TQString key, val; while (p < str.length()) { @@ -132,11 +132,11 @@ TQMap<TQString,TQString> LPRngToolHandler::parseXferOptions(const TQString& str) void LPRngToolHandler::loadAuthFile(const TQString& filename, TQString& user, TQString& pass) { - QFile f(filename); + TQFile f(filename); if (f.open(IO_ReadOnly)) { - QTextStream t(&f); - QString line; + TQTextStream t(&f); + TQString line; while (!t.atEnd()) { line = t.readLine().stripWhiteSpace(); @@ -145,7 +145,7 @@ void LPRngToolHandler::loadAuthFile(const TQString& filename, TQString& user, TQ int p = line.tqfind('='); if (p != -1) { - QString key = line.left(p); + TQString key = line.left(p); if (key == "username") user = line.mid(p+1); else if (key == "password") @@ -166,7 +166,7 @@ DrMain* LPRngToolHandler::loadDriver(KMPrinter *prt, PrintcapEntry *entry, bool DrMain* driver = loadToolDriver(locate("data", "kdeprint/lprngtooldriver1")); if (driver) { - QString model = prt->option("driverID"); + TQString model = prt->option("driverID"); driver->set("text", i18n("LPRngTool Common Driver (%1)").arg((model.isEmpty() ? i18n("unknown") : model))); if (!model.isEmpty()) driver->set("driverID", model); @@ -189,22 +189,22 @@ DrMain* LPRngToolHandler::loadDbDriver(const TQString& s) return driver; } -TQValueList< QPair<TQString,TQStringList> > LPRngToolHandler::loadChoiceDict(const TQString& filename) +TQValueList< TQPair<TQString,TQStringList> > LPRngToolHandler::loadChoiceDict(const TQString& filename) { - QFile f(filename); - TQValueList< QPair<TQString,TQStringList> > dict; + TQFile f(filename); + TQValueList< TQPair<TQString,TQStringList> > dict; if (f.open(IO_ReadOnly)) { - QTextStream t(&f); - QString line, key; - QStringList l; + TQTextStream t(&f); + TQString line, key; + TQStringList l; while (!t.atEnd()) { line = t.readLine().stripWhiteSpace(); if (line.startsWith("OPTION")) { if (l.count() > 0 && !key.isEmpty()) - dict << QPair<TQString,TQStringList>(key, l); + dict << TQPair<TQString,TQStringList>(key, l); l.clear(); key = TQString::null; if (line.contains('|') == 2 || line.right(7) == "BOOLEAN") @@ -226,18 +226,18 @@ TQValueList< QPair<TQString,TQStringList> > LPRngToolHandler::loadChoiceDict(con TQMap<TQString,TQString> LPRngToolHandler::parseZOptions(const TQString& optstr) { TQMap<TQString,TQString> opts; - QStringList l = TQStringList::split(',', optstr, false); + TQStringList l = TQStringList::split(',', optstr, false); if (l.count() == 0) return opts; if (m_dict.count() == 0) m_dict = loadChoiceDict(locate("data", "kdeprint/lprngtooldriver1")); - QString unknown; + TQString unknown; for (TQStringList::ConstIterator it=l.begin(); it!=l.end(); ++it) { bool found(false); - for (TQValueList< QPair<TQString,TQStringList> >::ConstIterator p=m_dict.begin(); p!=m_dict.end() && !found; ++p) + for (TQValueList< TQPair<TQString,TQStringList> >::ConstIterator p=m_dict.begin(); p!=m_dict.end() && !found; ++p) { if ((*p).second.tqfind(*it) != (*p).second.end()) { @@ -270,7 +270,7 @@ TQString LPRngToolHandler::driverDirInternal() PrintcapEntry* LPRngToolHandler::createEntry(KMPrinter *prt) { - QString prot = prt->deviceProtocol(); + TQString prot = prt->deviceProtocol(); if (prot != "parallel" && prot != "lpd" && prot != "smb" && prot != "socket") { manager()->setErrorMsg(i18n("Unsupported backend: %1.").arg(prot)); @@ -278,7 +278,7 @@ PrintcapEntry* LPRngToolHandler::createEntry(KMPrinter *prt) } PrintcapEntry *entry = new PrintcapEntry; entry->addField("cm", Field::String, prt->description()); - QString lp, comment("##LPRNGTOOL## "); + TQString lp, comment("##LPRNGTOOL## "); if (prot == "parallel") { comment.append("DEVICE "); @@ -305,14 +305,14 @@ PrintcapEntry* LPRngToolHandler::createEntry(KMPrinter *prt) { comment.append("SMB "); lp = "| " + filterDir() + "/smbprint"; - QString work, server, printer, user, passwd; + TQString work, server, printer, user, passwd; if ( splitSmbURI( prt->device(), work, server, printer, user, passwd ) ) { entry->addField("xfer_options", Field::String, TQString::tqfromLatin1("authfile=\"auth\" crlf=\"0\" hostip=\"\" host=\"%1\" printer=\"%2\" remote_mode=\"SMB\" share=\"//%3/%4\" workgroup=\"%5\"").arg(server).arg(printer).arg(server).arg(printer).arg(work)); - QFile authfile(LprSettings::self()->baseSpoolDir() + "/" + prt->printerName() + "/auth"); + TQFile authfile(LprSettings::self()->baseSpoolDir() + "/" + prt->printerName() + "/auth"); if (authfile.open(IO_WriteOnly)) { - QTextStream t(&authfile); + TQTextStream t(&authfile); t << "username=" << user << endl; t << "password=" << passwd << endl; authfile.close(); @@ -334,7 +334,7 @@ PrintcapEntry* LPRngToolHandler::createEntry(KMPrinter *prt) entry->addField("ifhp", Field::String, TQString::tqfromLatin1("model=%1,status@,sync@,pagecount@,waitend@").arg(driver->get("driverID"))); entry->addField("lprngtooloptions", Field::String, TQString::tqfromLatin1("FILTERTYPE=\"IFHP\" IFHP_OPTIONS=\"status@,sync@,pagecount@,waitend@\" PRINTERDB_ENTRY=\"%1\"").arg(driver->get("driverID"))); TQMap<TQString,TQString> opts; - QString optstr; + TQString optstr; driver->getOptions(opts, false); for (TQMap<TQString,TQString>::ConstIterator it=opts.begin(); it!=opts.end(); ++it) if (it.key() != "lpr") @@ -358,7 +358,7 @@ bool LPRngToolHandler::savePrinterDriver(KMPrinter*, PrintcapEntry *entry, DrMai { // save options in the "prefix_z" field and tell the manager to save the printcap file TQMap<TQString,TQString> opts; - QString optstr; + TQString optstr; driver->getOptions(opts, false); for (TQMap<TQString,TQString>::ConstIterator it=opts.begin(); it!=opts.end(); ++it) if (it.key() != "lpr") @@ -376,7 +376,7 @@ bool LPRngToolHandler::savePrinterDriver(KMPrinter*, PrintcapEntry *entry, DrMai TQString LPRngToolHandler::printOptions(KPrinter *printer) { - QString optstr; + TQString optstr; TQMap<TQString,TQString> opts = printer->options(); for (TQMap<TQString,TQString>::ConstIterator it=opts.begin(); it!=opts.end(); ++it) { diff --git a/kdeprint/lpr/lprngtoolhandler.h b/kdeprint/lpr/lprngtoolhandler.h index 6d7ec299f..e8843dc64 100644 --- a/kdeprint/lpr/lprngtoolhandler.h +++ b/kdeprint/lpr/lprngtoolhandler.h @@ -41,14 +41,14 @@ public: protected: TQMap<TQString,TQString> parseXferOptions(const TQString&); void loadAuthFile(const TQString&, TQString&, TQString&); - TQValueList< QPair<TQString,TQStringList> > loadChoiceDict(const TQString&); + TQValueList< TQPair<TQString,TQStringList> > loadChoiceDict(const TQString&); TQMap<TQString,TQString> parseZOptions(const TQString&); TQString filterDir(); TQString driverDirInternal(); private: - TQValueList< QPair<TQString,TQStringList> > m_dict; + TQValueList< TQPair<TQString,TQStringList> > m_dict; }; #endif diff --git a/kdeprint/lpr/lprsettings.cpp b/kdeprint/lpr/lprsettings.cpp index 15eef4126..a1a632a0f 100644 --- a/kdeprint/lpr/lprsettings.cpp +++ b/kdeprint/lpr/lprsettings.cpp @@ -55,7 +55,7 @@ void LprSettings::init() // LPR/LPRng mode KConfig *conf = KMFactory::self()->printConfig(); conf->setGroup("LPR"); - QString modestr = conf->readEntry("Mode"); + TQString modestr = conf->readEntry("Mode"); if (modestr == "LPRng") m_mode = LPRng; else if (modestr == "LPR") @@ -70,7 +70,7 @@ void LprSettings::init() } // Printcap file - m_printcapfile = TQString::null; + m_printcapfile = TQString(); m_local = true; // Spool directory @@ -89,14 +89,14 @@ TQString LprSettings::printcapFile() TQFile cf(LPDCONF); if (cf.open(IO_ReadOnly)) { - QTextStream t(&cf); - QString line; + TQTextStream t(&cf); + TQString line; while (!t.atEnd()) { line = t.readLine().stripWhiteSpace(); if (line.startsWith("printcap_path")) { - QString filename = line.mid(14).stripWhiteSpace(); + TQString filename = line.mid(14).stripWhiteSpace(); if (filename[0] != '|') m_printcapfile = filename; else @@ -120,14 +120,14 @@ TQString LprSettings::defaultRemoteHost() TQFile cf(LPDCONF); if (cf.open(IO_ReadOnly)) { - QTextStream t(&cf); - QString line; + TQTextStream t(&cf); + TQString line; while (!t.atEnd()) { line = t.readLine().stripWhiteSpace(); if (line.startsWith("default_remote_host")) { - QString hostname = line.mid(20).stripWhiteSpace(); + TQString hostname = line.mid(20).stripWhiteSpace(); m_defaultremotehost = hostname; } } diff --git a/kdeprint/lpr/matichandler.cpp b/kdeprint/lpr/matichandler.cpp index 9f830c821..1625571d7 100644 --- a/kdeprint/lpr/matichandler.cpp +++ b/kdeprint/lpr/matichandler.cpp @@ -44,7 +44,7 @@ MaticHandler::MaticHandler(KMManager *mgr) : LprHandler("foomatic", mgr) { - QString PATH = getenv("PATH"); + TQString PATH = getenv("PATH"); PATH.append(":/usr/sbin:/usr/local/sbin:/opt/sbin:/opt/local/sbin"); m_exematicpath = KStandardDirs::findExe("lpdomatic", PATH); m_ncpath = KStandardDirs::findExe("nc"); @@ -76,7 +76,7 @@ KMPrinter* MaticHandler::createPrinter(PrintcapEntry *entry) bool MaticHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, bool shortmode) { - QString val = entry->field("lp"); + TQString val = entry->field("lp"); if (val == "/dev/null" || val.isEmpty()) { prt->setLocation(i18n("Network printer")); @@ -98,13 +98,13 @@ bool MaticHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, bool sh Foomatic2Loader loader; if ( loader.readFromFile( maticFile( entry ) ) ) { - QString postpipe = loader.data()[ "POSTPIPE" ].toString(); + TQString postpipe = loader.data()[ "POSTPIPE" ].toString(); if (!postpipe.isEmpty()) { KURL url ( parsePostpipe(postpipe) ); if (!url.isEmpty()) { - QString ds = TQString::tqfromLatin1("%1 (%2)").arg(prt->location()).arg(url.protocol()); + TQString ds = TQString::tqfromLatin1("%1 (%2)").arg(prt->location()).arg(url.protocol()); prt->setDevice(url.url()); prt->setLocation(ds); } @@ -125,9 +125,9 @@ bool MaticHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, bool sh TQString MaticHandler::parsePostpipe(const TQString& s) { - QString url; - int p = s.findRev('|'); - QStringList args = TQStringList::split(" ", s.right(s.length()-p-1)); + TQString url; + int p = s.tqfindRev('|'); + TQStringList args = TQStringList::split(" ", s.right(s.length()-p-1)); if (args.count() != 0) { @@ -143,8 +143,8 @@ TQString MaticHandler::parsePostpipe(const TQString& s) // smb printer else if (args[0].right(10) == "/smbclient") { - QStringList host_components = TQStringList::split(TQRegExp("/|\\\\\""), args[1], false); - QString workgrp, user, pass; + TQStringList host_components = TQStringList::split(TQRegExp("/|\\\\\""), args[1], false); + TQString workgrp, user, pass; for (uint i=2; i<args.count(); i++) { if (args[i] == "-U") @@ -166,7 +166,7 @@ TQString MaticHandler::parsePostpipe(const TQString& s) i++; else { - QString host = (args[i].length() == 2 ? args[i+1] : args[i].right(args[i].length()-2)); + TQString host = (args[i].length() == 2 ? args[i+1] : args[i].right(args[i].length()-2)); int p = host.tqfind("\\@"); if (p != -1) { @@ -184,8 +184,8 @@ TQString MaticHandler::parsePostpipe(const TQString& s) TQString MaticHandler::createPostpipe(const TQString& _url) { KURL url( _url ); - QString prot = url.protocol(); - QString str; + TQString prot = url.protocol(); + TQString str; if (prot == "socket") { str += ("| " + m_ncpath); @@ -196,7 +196,7 @@ TQString MaticHandler::createPostpipe(const TQString& _url) else if (prot == "lpd") { str += ("| " + m_rlprpath + " -q -h"); - QString h = url.host(), p = url.path().mid(1); + TQString h = url.host(), p = url.path().mid(1); str += (" -P " + p + "\\@" + h); } else if (prot == "smb") @@ -223,8 +223,8 @@ DrMain* MaticHandler::loadDriver(KMPrinter*, PrintcapEntry *entry, bool) // we need to use a copy of the driver, as the driver // is not self-contained. If the printer is removed (when // changing printer name), the template would be also removed - QString origfilename = maticFile(entry); - QString filename = locateLocal("tmp", "foomatic_" + kapp->randomString(8)); + TQString origfilename = maticFile(entry); + TQString filename = locateLocal("tmp", "foomatic_" + kapp->randomString(8)); ::system(TQFile::encodeName("cp " + KProcess::quote(origfilename) + " " + KProcess::quote(filename))); DrMain *driver = Foomatic2Loader::loadDriver(filename); if (driver) @@ -239,16 +239,16 @@ DrMain* MaticHandler::loadDriver(KMPrinter*, PrintcapEntry *entry, bool) DrMain* MaticHandler::loadDbDriver(const TQString& path) { - QStringList comps = TQStringList::split('/', path, false); + TQStringList comps = TQStringList::split('/', path, false); if (comps.count() < 3 || comps[0] != "foomatic") { manager()->setErrorMsg(i18n("Internal error.")); return NULL; } - QString tmpFile = locateLocal("tmp", "foomatic_" + kapp->randomString(8)); - QString PATH = getenv("PATH") + TQString::tqfromLatin1(":/usr/sbin:/usr/local/sbin:/opt/sbin:/opt/local/sbin"); - QString exe = KStandardDirs::findExe("foomatic-datafile", PATH); + TQString tmpFile = locateLocal("tmp", "foomatic_" + kapp->randomString(8)); + TQString PATH = getenv("PATH") + TQString::tqfromLatin1(":/usr/sbin:/usr/local/sbin:/opt/sbin:/opt/local/sbin"); + TQString exe = KStandardDirs::findExe("foomatic-datafile", PATH); if (exe.isEmpty()) { manager()->setErrorMsg(i18n("Unable to find the executable foomatic-datafile " @@ -257,7 +257,7 @@ DrMain* MaticHandler::loadDbDriver(const TQString& path) } KPipeProcess in; - QFile out(tmpFile); + TQFile out(tmpFile); TQString cmd = KProcess::quote(exe); cmd += " -t lpd -d "; cmd += KProcess::quote(comps[2]); @@ -265,8 +265,8 @@ DrMain* MaticHandler::loadDbDriver(const TQString& path) cmd += KProcess::quote(comps[1]); if (in.open(cmd) && out.open(IO_WriteOnly)) { - QTextStream tin(&in), tout(&out); - QString line; + TQTextStream tin(&in), tout(&out); + TQString line; while (!tin.atEnd()) { line = tin.readLine(); @@ -291,16 +291,16 @@ DrMain* MaticHandler::loadDbDriver(const TQString& path) bool MaticHandler::savePrinterDriver(KMPrinter *prt, PrintcapEntry *entry, DrMain *driver, bool*) { - QFile tmpFile(locateLocal("tmp", "foomatic_" + kapp->randomString(8))); - QFile inFile(driver->get("template")); - QString outFile = maticFile(entry); + TQFile tmpFile(locateLocal("tmp", "foomatic_" + kapp->randomString(8))); + TQFile inFile(driver->get("template")); + TQString outFile = maticFile(entry); bool result(false); - QString postpipe = createPostpipe(prt->device()); + TQString postpipe = createPostpipe(prt->device()); if (inFile.open(IO_ReadOnly) && tmpFile.open(IO_WriteOnly)) { - QTextStream tin(&inFile), tout(&tmpFile); - QString line, optname; + TQTextStream tin(&inFile), tout(&tmpFile); + TQString line, optname; int p(-1), q(-1); if (!postpipe.isEmpty()) tout << "$postpipe = \"" << postpipe << "\";" << endl; @@ -329,7 +329,7 @@ bool MaticHandler::savePrinterDriver(KMPrinter *prt, PrintcapEntry *entry, DrMai inFile.close(); tmpFile.close(); - QString cmd = "mv " + KProcess::quote(tmpFile.name()) + " " + KProcess::quote(outFile); + TQString cmd = "mv " + KProcess::quote(tmpFile.name()) + " " + KProcess::quote(outFile); int status = ::system(TQFile::encodeName(cmd).data()); TQFile::remove(tmpFile.name()); result = (status != -1 && WEXITSTATUS(status) == 0); @@ -347,12 +347,12 @@ bool MaticHandler::savePrinterDriver(KMPrinter *prt, PrintcapEntry *entry, DrMai bool MaticHandler::savePpdFile(DrMain *driver, const TQString& filename) { - QString mdriver(driver->get("matic_driver")), mprinter(driver->get("matic_printer")); + TQString mdriver(driver->get("matic_driver")), mprinter(driver->get("matic_printer")); if (mdriver.isEmpty() || mprinter.isEmpty()) return true; - QString PATH = getenv("PATH") + TQString::tqfromLatin1(":/usr/sbin:/usr/local/sbin:/opt/sbin:/opt/local/sbin"); - QString exe = KStandardDirs::findExe("foomatic-datafile", PATH); + TQString PATH = getenv("PATH") + TQString::tqfromLatin1(":/usr/sbin:/usr/local/sbin:/opt/sbin:/opt/local/sbin"); + TQString exe = KStandardDirs::findExe("foomatic-datafile", PATH); if (exe.isEmpty()) { manager()->setErrorMsg(i18n("Unable to find the executable foomatic-datafile " @@ -361,12 +361,12 @@ bool MaticHandler::savePpdFile(DrMain *driver, const TQString& filename) } KPipeProcess in; - QFile out(filename); + TQFile out(filename); if (in.open(exe + " -t cups -d " + mdriver + " -p " + mprinter) && out.open(IO_WriteOnly)) { - QTextStream tin(&in), tout(&out); - QString line, optname; - QRegExp re("^\\*Default(\\w+):"), foo("'name'\\s+=>\\s+'(\\w+)'"), foo2("'\\w+'\\s*,\\s*$"); + TQTextStream tin(&in), tout(&out); + TQString line, optname; + TQRegExp re("^\\*Default(\\w+):"), foo("'name'\\s+=>\\s+'(\\w+)'"), foo2("'\\w+'\\s*,\\s*$"); while (!tin.atEnd()) { line = tin.readLine(); @@ -388,7 +388,7 @@ bool MaticHandler::savePpdFile(DrMain *driver, const TQString& filename) DrBase *opt = driver->findOption(re.cap(1)); if (opt) { - QString val = opt->valueText(); + TQString val = opt->valueText(); if (opt->type() == DrBase::Boolean) val = (val == "1" ? "True" : "False"); tout << "*Default" << opt->name() << ": " << val << endl; @@ -412,7 +412,7 @@ bool MaticHandler::savePpdFile(DrMain *driver, const TQString& filename) PrintcapEntry* MaticHandler::createEntry(KMPrinter *prt) { KURL url( prt->device() ); - QString prot = url.protocol(); + TQString prot = url.protocol(); if ((prot != "lpd" || m_rlprpath.isEmpty()) && (prot != "socket" || m_ncpath.isEmpty()) && (prot != "smb" || m_smbpath.isEmpty()) && @@ -449,7 +449,7 @@ PrintcapEntry* MaticHandler::createEntry(KMPrinter *prt) bool MaticHandler::removePrinter(KMPrinter *prt, PrintcapEntry *entry) { // remove Foomatic driver - QString af = entry->field("af"); + TQString af = entry->field("af"); if (af.isEmpty()) return true; if (!TQFile::remove(af)) @@ -463,7 +463,7 @@ bool MaticHandler::removePrinter(KMPrinter *prt, PrintcapEntry *entry) TQString MaticHandler::printOptions(KPrinter *printer) { TQMap<TQString,TQString> opts = printer->options(); - QString str; + TQString str; for (TQMap<TQString,TQString>::Iterator it=opts.begin(); it!=opts.end(); ++it) { if (it.key().startsWith("kde-") || it.key().startsWith("_kde-") || it.key().startsWith( "app-" )) diff --git a/kdeprint/lpr/matichandler.h b/kdeprint/lpr/matichandler.h index a7111f5ff..db376f264 100644 --- a/kdeprint/lpr/matichandler.h +++ b/kdeprint/lpr/matichandler.h @@ -50,8 +50,8 @@ private: bool savePpdFile(DrMain*, const TQString&); private: - QString m_exematicpath; - QString m_ncpath, m_smbpath, m_rlprpath; + TQString m_exematicpath; + TQString m_ncpath, m_smbpath, m_rlprpath; }; #endif diff --git a/kdeprint/lpr/matichelper.cpp b/kdeprint/lpr/matichelper.cpp index 544db8c71..acc968331 100644 --- a/kdeprint/lpr/matichelper.cpp +++ b/kdeprint/lpr/matichelper.cpp @@ -23,13 +23,13 @@ TQString maticFile(PrintcapEntry *entry) { - QString s(entry->field("af")); + TQString s(entry->field("af")); if (s.isEmpty()) { s = entry->field("filter_options"); if (!s.isEmpty()) { - int p = s.findRev(' '); + int p = s.tqfindRev(' '); if (p != -1) s = s.mid(p+1); } diff --git a/kdeprint/lpr/printcapentry.cpp b/kdeprint/lpr/printcapentry.cpp index 419a532a9..3f3af643b 100644 --- a/kdeprint/lpr/printcapentry.cpp +++ b/kdeprint/lpr/printcapentry.cpp @@ -21,7 +21,7 @@ TQString Field::toString() const { - QString s = name; + TQString s = name; switch (type) { case String: diff --git a/kdeprint/lpr/printcapentry.h b/kdeprint/lpr/printcapentry.h index 15adafddd..e1c785760 100644 --- a/kdeprint/lpr/printcapentry.h +++ b/kdeprint/lpr/printcapentry.h @@ -52,8 +52,8 @@ public: TQString toString() const; Type type; - QString name; - QString value; + TQString name; + TQString value; }; /** @@ -66,13 +66,13 @@ public: class PrintcapEntry { public: - QString name; - QStringList aliases; - QString comment; + TQString name; + TQStringList aliases; + TQString comment; TQMap<TQString,Field> fields; - QString postcomment; + TQString postcomment; - bool has(const TQString& f) const { return fields.contains(f); } + bool has(const TQString& f) const { return fields.tqcontains(f); } TQString field(const TQString& f) const { return fields[f].value; } bool writeEntry(TQTextStream&); void addField(const TQString& name, Field::Type type = Field::Boolean, const TQString& value = TQString::null); diff --git a/kdeprint/lpr/printcapreader.cpp b/kdeprint/lpr/printcapreader.cpp index 7abd094f9..4a5ce5ea7 100644 --- a/kdeprint/lpr/printcapreader.cpp +++ b/kdeprint/lpr/printcapreader.cpp @@ -27,7 +27,7 @@ void PrintcapReader::setPrintcapFile(TQFile *f) { if (f->isOpen()) { - m_stream.setDevice(f); + m_stream.setDevice(TQT_TQIODEVICE(f)); m_buffer = TQString::null; } } @@ -56,7 +56,7 @@ void PrintcapReader::unputLine(const TQString& s) PrintcapEntry* PrintcapReader::nextEntry() { - if (!m_stream.device()) + if (!m_stream.tqdevice()) return NULL; TQString line, comment, name, fields, buf; |