summaryrefslogtreecommitdiffstats
path: root/kdeprint/lpr
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-07 03:45:53 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-07 03:45:53 +0000
commit10308be19ef7fa44699562cc75946e7ea1fdf6b9 (patch)
tree4bc444c00a79e88105f2cfce5b6209994c413ca0 /kdeprint/lpr
parent307136d8eef0ba133b78ceee8e901138d4c996a1 (diff)
downloadtdelibs-10308be19ef7fa44699562cc75946e7ea1fdf6b9.tar.gz
tdelibs-10308be19ef7fa44699562cc75946e7ea1fdf6b9.zip
Revert automated changes
Sorry guys, they are just not ready for prime time Work will continue as always git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1212479 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdeprint/lpr')
-rw-r--r--kdeprint/lpr/apshandler.cpp22
-rw-r--r--kdeprint/lpr/klprprinterimpl.cpp4
-rw-r--r--kdeprint/lpr/kmlprmanager.cpp38
-rw-r--r--kdeprint/lpr/kmlprmanager.h2
-rw-r--r--kdeprint/lpr/lpchelper.cpp34
-rw-r--r--kdeprint/lpr/lpchelper.h6
-rw-r--r--kdeprint/lpr/lpqhelper.cpp6
-rw-r--r--kdeprint/lpr/lpqhelper.h2
-rw-r--r--kdeprint/lpr/lprhandler.cpp4
-rw-r--r--kdeprint/lpr/lprngtoolhandler.cpp26
-rw-r--r--kdeprint/lpr/matichandler.cpp38
-rw-r--r--kdeprint/lpr/matichelper.cpp2
-rw-r--r--kdeprint/lpr/printcapentry.h2
-rw-r--r--kdeprint/lpr/printcapreader.cpp8
14 files changed, 97 insertions, 97 deletions
diff --git a/kdeprint/lpr/apshandler.cpp b/kdeprint/lpr/apshandler.cpp
index fb8a47fed..fc6ade276 100644
--- a/kdeprint/lpr/apshandler.cpp
+++ b/kdeprint/lpr/apshandler.cpp
@@ -50,8 +50,8 @@ bool ApsHandler::validate(PrintcapEntry *entry)
KMPrinter* ApsHandler::createPrinter(PrintcapEntry *entry)
{
- entry->comment = TQString::tqfromLatin1("# APS%1_BEGIN:printer%2").arg(m_counter).arg(m_counter);
- entry->postcomment = TQString::tqfromLatin1("# APS%1_END - don't delete this").arg(m_counter);
+ entry->comment = TQString::fromLatin1("# APS%1_BEGIN:printer%2").arg(m_counter).arg(m_counter);
+ entry->postcomment = TQString::fromLatin1("# APS%1_END - don't delete this").arg(m_counter);
m_counter++;
return LprHandler::createPrinter(entry);
}
@@ -63,7 +63,7 @@ bool ApsHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, bool shor
if (!shortmode)
{
TQMap<TQString,TQString> opts = loadResources(entry);
- if (opts.tqcontains("PRINTER"))
+ if (opts.contains("PRINTER"))
{
prt->setDescription(i18n("APS Driver (%1)").arg(opts["PRINTER"]));
prt->setDriverInfo(prt->description());
@@ -103,7 +103,7 @@ bool ApsHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, bool shor
opts[ "NCP_PRINTER" ],
opts[ "NCP_USER" ],
opts[ "NCP_PASSWD" ] );
- uri.tqreplace( 0, 3, "ncp" );
+ uri.replace( 0, 3, "ncp" );
prt->setDevice(uri);
}
prot = "ncp";
@@ -148,7 +148,7 @@ TQMap<TQString,TQString> ApsHandler::loadVarFile(const TQString& filename)
while (!t.atEnd())
{
line = t.readLine().stripWhiteSpace();
- if (line.isEmpty() || line[0] == '#' || (p = line.tqfind('=')) == -1)
+ if (line.isEmpty() || line[0] == '#' || (p = line.find('=')) == -1)
continue;
QString variable = line.left(p).stripWhiteSpace();
QString value = line.mid(p+1).stripWhiteSpace();
@@ -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.tqcontains( "PAPERSIZE" ) )
+ if ( !config && opts.contains( "PAPERSIZE" ) )
{
// this is needed to keep applications informed
// about the current selected page size
@@ -175,7 +175,7 @@ DrMain* ApsHandler::loadDriver(KMPrinter *prt, PrintcapEntry *entry, bool config
// default page size needs to be set to the actual
// value of the printer driver, otherwise it's blocked
// to A4
- DrBase *opt = driver->tqfindOption( "PageSize" );
+ DrBase *opt = driver->findOption( "PageSize" );
if ( opt )
opt->set( "default", opts[ "PageSize" ] );
}
@@ -187,7 +187,7 @@ DrMain* ApsHandler::loadDriver(KMPrinter *prt, PrintcapEntry *entry, bool config
DrMain* ApsHandler::loadDbDriver(const TQString& s)
{
- int p = s.tqfind('/');
+ int p = s.find('/');
DrMain *driver = loadApsDriver(true);
if (driver)
driver->set("gsdriver", s.mid(p+1));
@@ -272,7 +272,7 @@ PrintcapEntry* ApsHandler::createEntry(KMPrinter *prt)
{
TQString work, server, printer, user, passwd;
TQString uri = prt->device();
- uri.tqreplace( 0, 3, "smb" );
+ uri.replace( 0, 3, "smb" );
if ( splitSmbURI( uri, work, server, printer, user, passwd ) )
{
QTextStream t(&f);
@@ -309,8 +309,8 @@ PrintcapEntry* ApsHandler::createEntry(KMPrinter *prt)
entry->addField("af", Field::String, sd + "/acct");
entry->addField("lf", Field::String, sd + "/log");
entry->addField("if", Field::String, sysconfDir() + "/basedir/bin/apsfilter");
- entry->comment = TQString::tqfromLatin1("# APS%1_BEGIN:printer%2").arg(m_counter).arg(m_counter);
- entry->postcomment = TQString::tqfromLatin1("# APS%1_END").arg(m_counter);
+ entry->comment = TQString::fromLatin1("# APS%1_BEGIN:printer%2").arg(m_counter).arg(m_counter);
+ entry->postcomment = TQString::fromLatin1("# APS%1_END").arg(m_counter);
m_counter++;
return entry;
}
diff --git a/kdeprint/lpr/klprprinterimpl.cpp b/kdeprint/lpr/klprprinterimpl.cpp
index 9f0956ff3..1d77b166c 100644
--- a/kdeprint/lpr/klprprinterimpl.cpp
+++ b/kdeprint/lpr/klprprinterimpl.cpp
@@ -41,7 +41,7 @@ bool KLprPrinterImpl::setupCommand(TQString& cmd, KPrinter *printer)
if (!printer || m_exepath.isEmpty())
return false;
- cmd = TQString::tqfromLatin1("%1 -P %1 '-#%1'").arg(m_exepath).arg(quote(printer->printerName())).arg( printer->numCopies() );
+ cmd = TQString::fromLatin1("%1 -P %1 '-#%1'").arg(m_exepath).arg(quote(printer->printerName())).arg( printer->numCopies() );
QString opts = static_cast<KMLprManager*>(KMManager::self())->printOptions(printer);
if (!opts.isEmpty())
cmd += (" " + opts);
@@ -53,7 +53,7 @@ void KLprPrinterImpl::broadcastOption(const TQString& key, const TQString& value
KPrinterImpl::broadcastOption(key,value);
if (key == "kde-pagesize")
{
- QString pagename = TQString::tqfromLatin1(pageSizeToPageName((KPrinter::PageSize)value.toInt()));
+ QString pagename = TQString::fromLatin1(pageSizeToPageName((KPrinter::PageSize)value.toInt()));
KPrinterImpl::broadcastOption("PageSize",pagename);
}
}
diff --git a/kdeprint/lpr/kmlprmanager.cpp b/kdeprint/lpr/kmlprmanager.cpp
index 787504064..65b08eb67 100644
--- a/kdeprint/lpr/kmlprmanager.cpp
+++ b/kdeprint/lpr/kmlprmanager.cpp
@@ -148,7 +148,7 @@ void KMLprManager::initHandlers()
if (func)
insertHandler(func(this));
else
- kdDebug() << "couldn't tqfind the symbol 'create_handler'" << endl;
+ kdDebug() << "couldn't find the symbol 'create_handler'" << endl;
}
}
@@ -156,11 +156,11 @@ void KMLprManager::initHandlers()
insertHandler(new LprHandler("default", this));
}
-LprHandler* KMLprManager::tqfindHandler(KMPrinter *prt)
+LprHandler* KMLprManager::findHandler(KMPrinter *prt)
{
QString handlerstr(prt->option("kde-lpr-handler"));
LprHandler *handler(0);
- if (handlerstr.isEmpty() || (handler = m_handlers.tqfind(handlerstr)) == NULL)
+ if (handlerstr.isEmpty() || (handler = m_handlers.find(handlerstr)) == NULL)
{
return NULL;
}
@@ -169,7 +169,7 @@ LprHandler* KMLprManager::tqfindHandler(KMPrinter *prt)
PrintcapEntry* KMLprManager::findEntry(KMPrinter *prt)
{
- PrintcapEntry *entry = m_entries.tqfind(prt->printerName());
+ PrintcapEntry *entry = m_entries.find(prt->printerName());
if (!entry)
{
return NULL;
@@ -179,7 +179,7 @@ PrintcapEntry* KMLprManager::findEntry(KMPrinter *prt)
bool KMLprManager::completePrinter(KMPrinter *prt)
{
- LprHandler *handler = tqfindHandler(prt);
+ LprHandler *handler = findHandler(prt);
PrintcapEntry *entry = findEntry(prt);
if (handler && entry)
return handler->completePrinter(prt, entry, false);
@@ -188,7 +188,7 @@ bool KMLprManager::completePrinter(KMPrinter *prt)
bool KMLprManager::completePrinterShort(KMPrinter *prt)
{
- LprHandler *handler = tqfindHandler(prt);
+ LprHandler *handler = findHandler(prt);
PrintcapEntry *entry = findEntry(prt);
if (!handler || !entry)
return false;
@@ -216,7 +216,7 @@ DrMain* KMLprManager::loadPrinterDriver(KMPrinter *prt, bool config)
if (!prt)
return NULL;
- LprHandler *handler = tqfindHandler(prt);
+ LprHandler *handler = findHandler(prt);
PrintcapEntry *entry = findEntry(prt);
if (handler && entry)
{
@@ -230,9 +230,9 @@ 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"));
- LprHandler *handler = m_handlers.tqfind(handler_str);
+ int p = filename.find('/');
+ QString handler_str = (p != -1 ? filename.left(p) : TQString::fromLatin1("default"));
+ LprHandler *handler = m_handlers.find(handler_str);
if (handler)
{
DrMain *driver = handler->loadDbDriver(filename);
@@ -267,7 +267,7 @@ bool KMLprManager::startPrinter(KMPrinter *prt, bool state)
bool KMLprManager::savePrinterDriver(KMPrinter *prt, DrMain *driver)
{
- LprHandler *handler = tqfindHandler(prt);
+ LprHandler *handler = findHandler(prt);
PrintcapEntry *entry = findEntry(prt);
if (handler && entry)
{
@@ -311,7 +311,7 @@ bool KMLprManager::savePrintcapFile()
bool KMLprManager::createPrinter(KMPrinter *prt)
{
// remove existing printcap entry
- PrintcapEntry *oldEntry = m_entries.tqfind(prt->printerName());
+ PrintcapEntry *oldEntry = m_entries.find(prt->printerName());
// look for the handler and re-create entry
LprHandler *handler(0);
@@ -320,11 +320,11 @@ bool KMLprManager::createPrinter(KMPrinter *prt)
// or we use the handler of the existing printer
// (modifying something else, handler stays the same)
if (prt->driver())
- handler = m_handlers.tqfind(prt->driver()->get("handler"));
+ handler = m_handlers.find(prt->driver()->get("handler"));
else if (oldEntry)
- handler = tqfindHandler(prt);
+ handler = findHandler(prt);
else
- handler = m_handlers.tqfind("default");
+ handler = m_handlers.find("default");
if (!handler)
{
setErrorMsg(i18n("Internal error: no handler defined."));
@@ -390,7 +390,7 @@ bool KMLprManager::createPrinter(KMPrinter *prt)
bool KMLprManager::removePrinter(KMPrinter *prt)
{
- LprHandler *handler = tqfindHandler(prt);
+ LprHandler *handler = findHandler(prt);
PrintcapEntry *entry = findEntry(prt);
if (handler && entry)
{
@@ -422,7 +422,7 @@ bool KMLprManager::removePrinter(KMPrinter *prt)
TQString KMLprManager::driverDbCreationProgram()
{
- return TQString::tqfromLatin1("make_driver_db_lpr");
+ return TQString::fromLatin1("make_driver_db_lpr");
}
TQString KMLprManager::driverDirectory()
@@ -442,11 +442,11 @@ TQString KMLprManager::driverDirectory()
TQString KMLprManager::printOptions(KPrinter *prt)
{
- KMPrinter *mprt = tqfindPrinter(prt->printerName());
+ KMPrinter *mprt = findPrinter(prt->printerName());
QString opts;
if (mprt)
{
- LprHandler *handler = tqfindHandler(mprt);
+ LprHandler *handler = findHandler(mprt);
if (handler)
return handler->printOptions(prt);
}
diff --git a/kdeprint/lpr/kmlprmanager.h b/kdeprint/lpr/kmlprmanager.h
index f7b31ba28..516494f95 100644
--- a/kdeprint/lpr/kmlprmanager.h
+++ b/kdeprint/lpr/kmlprmanager.h
@@ -66,7 +66,7 @@ protected:
void initHandlers();
void insertHandler(LprHandler*);
PrintcapEntry* findEntry(KMPrinter*);
- LprHandler* tqfindHandler(KMPrinter*);
+ LprHandler* findHandler(KMPrinter*);
void checkPrinterState(KMPrinter*);
bool savePrintcapFile();
diff --git a/kdeprint/lpr/lpchelper.cpp b/kdeprint/lpr/lpchelper.cpp
index 1ef43ed79..516e85af3 100644
--- a/kdeprint/lpr/lpchelper.cpp
+++ b/kdeprint/lpr/lpchelper.cpp
@@ -62,7 +62,7 @@ LpcHelper::~LpcHelper()
KMPrinter::PrinterState LpcHelper::state(const TQString& prname) const
{
- if (m_state.tqcontains(prname))
+ if (m_state.contains(prname))
return m_state[prname];
return KMPrinter::Unknown;
}
@@ -72,7 +72,7 @@ KMPrinter::PrinterState LpcHelper::state(KMPrinter *prt) const
return state(prt->printerName());
}
-void LpcHelper::parsetqStatusLPR(TQTextStream &t)
+void LpcHelper::parseStatusLPR(TQTextStream &t)
{
QString printer, line;
int p(-1);
@@ -82,32 +82,32 @@ void LpcHelper::parsetqStatusLPR(TQTextStream &t)
line = t.readLine();
if (line.isEmpty())
continue;
- else if (!line[0].isSpace() && (p = line.tqfind(':')) != -1)
+ else if (!line[0].isSpace() && (p = line.find(':')) != -1)
{
printer = line.left(p);
m_state[printer] = KMPrinter::Idle;
}
- else if (line.tqfind("printing is disabled") != -1)
+ else if (line.find("printing is disabled") != -1)
{
if (!printer.isEmpty())
m_state[printer] = KMPrinter::PrinterState((KMPrinter::Stopped) | (m_state[printer] & ~KMPrinter::StateMask));
}
- else if (line.tqfind("queuing is disabled") != -1)
+ else if (line.find("queuing is disabled") != -1)
{
if (!printer.isEmpty())
m_state[printer] = KMPrinter::PrinterState((KMPrinter::Rejecting) | (m_state[printer] & KMPrinter::StateMask));
}
- else if (line.tqfind("entries") != -1)
+ else if (line.find("entries") != -1)
{
if (!printer.isEmpty() &&
(m_state[printer] & KMPrinter::StateMask) != KMPrinter::Stopped &&
- line.tqfind("no entries") == -1)
+ line.find("no entries") == -1)
m_state[printer] = KMPrinter::PrinterState((m_state[printer] & ~KMPrinter::StateMask) | KMPrinter::Processing);
}
}
}
-void LpcHelper::parsetqStatusLPRng(TQTextStream& t)
+void LpcHelper::parseStatusLPRng(TQTextStream& t)
{
QStringList l;
int p(-1);
@@ -121,7 +121,7 @@ void LpcHelper::parsetqStatusLPRng(TQTextStream& t)
l = TQStringList::split(TQRegExp("\\s"), t.readLine(), false);
if (l.count() < 4)
continue;
- p = l[0].tqfind('@');
+ p = l[0].find('@');
if (p == 0)
printer = l[0];
else
@@ -152,10 +152,10 @@ void LpcHelper::updateStates()
{
default:
case LprSettings::LPR:
- parsetqStatusLPR(t);
+ parseStatusLPR(t);
break;
case LprSettings::LPRng:
- parsetqStatusLPRng(t);
+ parseStatusLPRng(t);
break;
}
proc.close();
@@ -206,11 +206,11 @@ static TQString lprngAnswer(const TQString& result, const TQString& printer)
{
int p, q;
- p = result.tqfind("\n" + printer);
+ p = result.find("\n" + printer);
if (p != -1)
{
- q = result.tqfind(':', p)+2;
- p = result.tqfind('\n', q);
+ q = result.find(':', p)+2;
+ p = result.find('\n', q);
QString answer = result.mid(q, p-q).stripWhiteSpace();
return answer;
}
@@ -260,7 +260,7 @@ bool LpcHelper::changeState(const TQString& printer, const TQString& op, TQStrin
break;
default:
case 1:
- msg = i18n("Unknown error: %1").arg(result.tqreplace(TQRegExp("\\n"), " "));
+ msg = i18n("Unknown error: %1").arg(result.replace(TQRegExp("\\n"), " "));
break;
}
return (status == 0);
@@ -274,9 +274,9 @@ bool LpcHelper::removeJob(KMJob *job, TQString& msg)
return false;
}
QString result = execute(m_lprmpath + " -P " + KProcess::quote(job->printer()) + " " + TQString::number(job->id()));
- if (result.tqfind("dequeued") != -1)
+ if (result.find("dequeued") != -1)
return true;
- else if (result.tqfind("Permission denied") != -1 || result.tqfind("no permissions") != -1)
+ else if (result.find("Permission denied") != -1 || result.find("no permissions") != -1)
msg = i18n("Permission denied.");
else
msg = i18n("Execution of lprm failed: %1").arg(result);
diff --git a/kdeprint/lpr/lpchelper.h b/kdeprint/lpr/lpchelper.h
index ee0182a5a..d7e6c7897 100644
--- a/kdeprint/lpr/lpchelper.h
+++ b/kdeprint/lpr/lpchelper.h
@@ -27,7 +27,7 @@
class KMJob;
-class LpcHelper : public TQObject
+class LpcHelper : public QObject
{
public:
LpcHelper(TQObject *parent = 0, const char *name = 0);
@@ -46,8 +46,8 @@ public:
protected:
bool changeState(const TQString&, const TQString&, TQString&);
- void parsetqStatusLPR(TQTextStream&);
- void parsetqStatusLPRng(TQTextStream&);
+ void parseStatusLPR(TQTextStream&);
+ void parseStatusLPRng(TQTextStream&);
int parseStateChangeLPR(const TQString&, const TQString&);
int parseStateChangeLPRng(const TQString&, const TQString&);
diff --git a/kdeprint/lpr/lpqhelper.cpp b/kdeprint/lpr/lpqhelper.cpp
index aa8e19879..2675c9d41 100644
--- a/kdeprint/lpr/lpqhelper.cpp
+++ b/kdeprint/lpr/lpqhelper.cpp
@@ -46,7 +46,7 @@ KMJob* LpqHelper::parseLineLpr(const TQString& line)
job->setOwner(line.mid(7, 11).stripWhiteSpace());
job->setId(line.mid(18, 5).toInt());
job->setName(line.mid(23, 38).stripWhiteSpace());
- int p = line.tqfind(' ', 61);
+ int p = line.find(' ', 61);
if (p != -1)
{
job->setSize(line.mid(61, p-61).toInt() / 1000);
@@ -61,14 +61,14 @@ KMJob* LpqHelper::parseLineLPRng(const TQString& line)
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);
+ int p = line.find('@', 7), q = line.find(' ', 7);
job->setOwner(line.mid(7, QMIN(p,q)-7));
while (line[q].isSpace())
q++;
q++;
while (line[q].isSpace())
q++;
- p = line.tqfind(' ', q);
+ p = line.find(' ', q);
job->setId(line.mid(q, p-q).toInt());
while (line[p].isSpace())
p++;
diff --git a/kdeprint/lpr/lpqhelper.h b/kdeprint/lpr/lpqhelper.h
index d79903f57..b41521f66 100644
--- a/kdeprint/lpr/lpqhelper.h
+++ b/kdeprint/lpr/lpqhelper.h
@@ -25,7 +25,7 @@
class KMJob;
-class LpqHelper : public TQObject
+class LpqHelper : public QObject
{
public:
LpqHelper(TQObject *parent = 0, const char *name = 0);
diff --git a/kdeprint/lpr/lprhandler.cpp b/kdeprint/lpr/lprhandler.cpp
index 4a2a96b0f..600df4796 100644
--- a/kdeprint/lpr/lprhandler.cpp
+++ b/kdeprint/lpr/lprhandler.cpp
@@ -61,7 +61,7 @@ bool LprHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, bool)
KURL uri;
if (!val.isEmpty() && val != "/dev/null")
{
- int p = val.tqfind('@');
+ int p = val.find('@');
if (p != -1)
{
prt->setLocation(i18n("Remote queue (%1) on %2").arg(val.left(p)).arg(val.mid(p+1)));
@@ -69,7 +69,7 @@ bool LprHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, bool)
uri.setHost(val.mid(p+1));
uri.setPath("/" + val.left(p));
}
- else if ((p = val.tqfind('%')) != -1)
+ else if ((p = val.find('%')) != -1)
{
prt->setLocation(i18n("Network printer (%1)").arg("socket"));
uri.setProtocol("socket");
diff --git a/kdeprint/lpr/lprngtoolhandler.cpp b/kdeprint/lpr/lprngtoolhandler.cpp
index d4e448ad4..3710496a9 100644
--- a/kdeprint/lpr/lprngtoolhandler.cpp
+++ b/kdeprint/lpr/lprngtoolhandler.cpp
@@ -40,7 +40,7 @@ LPRngToolHandler::LPRngToolHandler(KMManager *mgr)
bool LPRngToolHandler::validate(PrintcapEntry *entry)
{
if (entry->comment.startsWith("##LPRNGTOOL##") &&
- entry->comment.tqfind("UNKNOWN") == -1)
+ entry->comment.find("UNKNOWN") == -1)
return true;
return false;
}
@@ -82,14 +82,14 @@ bool LPRngToolHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, boo
if (!(str=entry->field("ifhp")).isEmpty())
{
QString model;
- int p = str.tqfind("model");
+ int p = str.find("model");
if (p != -1)
{
- p = str.tqfind('=', p);
+ p = str.find('=', p);
if (p != -1)
{
p++;
- int q = str.tqfind(',', p);
+ int q = str.find(',', p);
if (q == -1)
model = str.mid(p);
else
@@ -142,7 +142,7 @@ void LPRngToolHandler::loadAuthFile(const TQString& filename, TQString& user, TQ
line = t.readLine().stripWhiteSpace();
if (line.isEmpty())
continue;
- int p = line.tqfind('=');
+ int p = line.find('=');
if (p != -1)
{
QString key = line.left(p);
@@ -182,7 +182,7 @@ DrMain* LPRngToolHandler::loadDriver(KMPrinter *prt, PrintcapEntry *entry, bool
DrMain* LPRngToolHandler::loadDbDriver(const TQString& s)
{
- int p = s.tqfind('/');
+ int p = s.find('/');
DrMain* driver = loadToolDriver(locate("data", "kdeprint/lprngtooldriver1"));
if (driver)
driver->set("driverID", s.mid(p+1));
@@ -207,15 +207,15 @@ TQValueList< QPair<TQString,TQStringList> > LPRngToolHandler::loadChoiceDict(con
dict << QPair<TQString,TQStringList>(key, l);
l.clear();
key = TQString::null;
- if (line.tqcontains('|') == 2 || line.right(7) == "BOOLEAN")
+ if (line.contains('|') == 2 || line.right(7) == "BOOLEAN")
{
- int p = line.tqfind('|', 7);
+ int p = line.find('|', 7);
key = line.mid(7, p-7);
}
}
else if (line.startsWith("CHOICE"))
{
- int p = line.tqfind('|', 7);
+ int p = line.find('|', 7);
l << line.mid(7, p-7);
}
}
@@ -239,7 +239,7 @@ TQMap<TQString,TQString> LPRngToolHandler::parseZOptions(const TQString& optstr)
bool found(false);
for (TQValueList< QPair<TQString,TQStringList> >::ConstIterator p=m_dict.begin(); p!=m_dict.end() && !found; ++p)
{
- if ((*p).second.tqfind(*it) != (*p).second.end())
+ if ((*p).second.find(*it) != (*p).second.end())
{
opts[(*p).first] = (*it);
found = true;
@@ -308,7 +308,7 @@ PrintcapEntry* LPRngToolHandler::createEntry(KMPrinter *prt)
QString 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));
+ entry->addField("xfer_options", Field::String, TQString::fromLatin1("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");
if (authfile.open(IO_WriteOnly))
{
@@ -331,8 +331,8 @@ PrintcapEntry* LPRngToolHandler::createEntry(KMPrinter *prt)
DrMain *driver = prt->driver();
comment.append("filtertype=IFHP ifhp_options=status@,sync@,pagecount@,waitend@ printerdb_entry=");
comment.append(driver->get("driverID"));
- 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")));
+ entry->addField("ifhp", Field::String, TQString::fromLatin1("model=%1,status@,sync@,pagecount@,waitend@").arg(driver->get("driverID")));
+ entry->addField("lprngtooloptions", Field::String, TQString::fromLatin1("FILTERTYPE=\"IFHP\" IFHP_OPTIONS=\"status@,sync@,pagecount@,waitend@\" PRINTERDB_ENTRY=\"%1\"").arg(driver->get("driverID")));
TQMap<TQString,TQString> opts;
QString optstr;
driver->getOptions(opts, false);
diff --git a/kdeprint/lpr/matichandler.cpp b/kdeprint/lpr/matichandler.cpp
index cf1a55f56..f3f0d4cdc 100644
--- a/kdeprint/lpr/matichandler.cpp
+++ b/kdeprint/lpr/matichandler.cpp
@@ -85,7 +85,7 @@ bool MaticHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, bool sh
{
prt->setLocation(i18n("Local printer on %1").arg(val));
KURL url(val);
- if (val.tqfind("usb") != -1)
+ if (val.find("usb") != -1)
url.setProtocol("usb");
else
url.setProtocol("parallel");
@@ -104,7 +104,7 @@ bool MaticHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, bool sh
KURL url ( parsePostpipe(postpipe) );
if (!url.isEmpty())
{
- QString ds = TQString::tqfromLatin1("%1 (%2)").arg(prt->location()).arg(url.protocol());
+ QString ds = TQString::fromLatin1("%1 (%2)").arg(prt->location()).arg(url.protocol());
prt->setDevice(url.url());
prt->setLocation(ds);
}
@@ -115,7 +115,7 @@ bool MaticHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, bool sh
{
prt->setManufacturer(m["make"].toString());
prt->setModel(m["model"].toString());
- prt->setDriverInfo(TQString::tqfromLatin1("%1 %2 (%3)").arg(prt->manufacturer()).arg(prt->model()).arg(m["driver"].toString()));
+ prt->setDriverInfo(TQString::fromLatin1("%1 %2 (%3)").arg(prt->manufacturer()).arg(prt->model()).arg(m["driver"].toString()));
}
}
}
@@ -126,7 +126,7 @@ bool MaticHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, bool sh
TQString MaticHandler::parsePostpipe(const TQString& s)
{
QString url;
- int p = s.tqfindRev('|');
+ int p = s.findRev('|');
QStringList args = TQStringList::split(" ", s.right(s.length()-p-1));
if (args.count() != 0)
@@ -167,7 +167,7 @@ TQString MaticHandler::parsePostpipe(const TQString& s)
else
{
QString host = (args[i].length() == 2 ? args[i+1] : args[i].right(args[i].length()-2));
- int p = host.tqfind("\\@");
+ int p = host.find("\\@");
if (p != -1)
{
url = "lpd://" + host.right(host.length()-p-2) + "/" + host.left(p);
@@ -247,11 +247,11 @@ DrMain* MaticHandler::loadDbDriver(const TQString& path)
}
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 PATH = getenv("PATH") + TQString::fromLatin1(":/usr/sbin:/usr/local/sbin:/opt/sbin:/opt/local/sbin");
QString exe = KStandardDirs::findExe("foomatic-datafile", PATH);
if (exe.isEmpty())
{
- manager()->setErrorMsg(i18n("Unable to tqfind the executable foomatic-datafile "
+ manager()->setErrorMsg(i18n("Unable to find the executable foomatic-datafile "
"in your PATH. Check that Foomatic is correctly installed."));
return NULL;
}
@@ -309,15 +309,15 @@ bool MaticHandler::savePrinterDriver(KMPrinter *prt, PrintcapEntry *entry, DrMai
line = tin.readLine();
if (line.stripWhiteSpace().startsWith("$postpipe"))
continue;
- else if ((p = line.tqfind("'name'")) != -1)
+ else if ((p = line.find("'name'")) != -1)
{
- p = line.tqfind('\'', p+6)+1;
- q = line.tqfind('\'', p);
+ p = line.find('\'', p+6)+1;
+ q = line.find('\'', p);
optname = line.mid(p, q-p);
}
- else if ((p = line.tqfind("'default'")) != -1)
+ else if ((p = line.find("'default'")) != -1)
{
- DrBase *opt = driver->tqfindOption(optname);
+ DrBase *opt = driver->findOption(optname);
if (opt)
{
tout << line.left(p+9) << " => '" << opt->valueText() << "'," << endl;
@@ -351,11 +351,11 @@ bool MaticHandler::savePpdFile(DrMain *driver, const TQString& filename)
if (mdriver.isEmpty() || mprinter.isEmpty())
return true;
- QString PATH = getenv("PATH") + TQString::tqfromLatin1(":/usr/sbin:/usr/local/sbin:/opt/sbin:/opt/local/sbin");
+ QString PATH = getenv("PATH") + TQString::fromLatin1(":/usr/sbin:/usr/local/sbin:/opt/sbin:/opt/local/sbin");
QString exe = KStandardDirs::findExe("foomatic-datafile", PATH);
if (exe.isEmpty())
{
- manager()->setErrorMsg(i18n("Unable to tqfind the executable foomatic-datafile "
+ manager()->setErrorMsg(i18n("Unable to find the executable foomatic-datafile "
"in your PATH. Check that Foomatic is correctly installed."));
return false;
}
@@ -372,12 +372,12 @@ bool MaticHandler::savePpdFile(DrMain *driver, const TQString& filename)
line = tin.readLine();
if (line.startsWith("*% COMDATA #"))
{
- if (line.tqfind("'default'") != -1)
+ if (line.find("'default'") != -1)
{
- DrBase *opt = (optname.isEmpty() ? NULL : driver->tqfindOption(optname));
+ DrBase *opt = (optname.isEmpty() ? NULL : driver->findOption(optname));
if (opt)
{
- line.tqreplace(foo2, "'"+opt->valueText()+"',");
+ line.replace(foo2, "'"+opt->valueText()+"',");
}
}
else if (foo.search(line) != -1)
@@ -385,7 +385,7 @@ bool MaticHandler::savePpdFile(DrMain *driver, const TQString& filename)
}
else if (re.search(line) != -1)
{
- DrBase *opt = driver->tqfindOption(re.cap(1));
+ DrBase *opt = driver->findOption(re.cap(1));
if (opt)
{
QString val = opt->valueText();
@@ -423,7 +423,7 @@ PrintcapEntry* MaticHandler::createEntry(KMPrinter *prt)
}
if (m_exematicpath.isEmpty())
{
- manager()->setErrorMsg(i18n("Unable to tqfind executable lpdomatic. "
+ manager()->setErrorMsg(i18n("Unable to find executable lpdomatic. "
"Check that Foomatic is correctly installed "
"and that lpdomatic is installed in a standard "
"location."));
diff --git a/kdeprint/lpr/matichelper.cpp b/kdeprint/lpr/matichelper.cpp
index 918d8f22d..544db8c71 100644
--- a/kdeprint/lpr/matichelper.cpp
+++ b/kdeprint/lpr/matichelper.cpp
@@ -29,7 +29,7 @@ TQString maticFile(PrintcapEntry *entry)
s = entry->field("filter_options");
if (!s.isEmpty())
{
- int p = s.tqfindRev(' ');
+ int p = s.findRev(' ');
if (p != -1)
s = s.mid(p+1);
}
diff --git a/kdeprint/lpr/printcapentry.h b/kdeprint/lpr/printcapentry.h
index e3617a34f..15adafddd 100644
--- a/kdeprint/lpr/printcapentry.h
+++ b/kdeprint/lpr/printcapentry.h
@@ -72,7 +72,7 @@ public:
TQMap<TQString,Field> fields;
QString postcomment;
- bool has(const TQString& f) const { return fields.tqcontains(f); }
+ bool has(const TQString& f) const { return fields.contains(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..a3ab30e8f 100644
--- a/kdeprint/lpr/printcapreader.cpp
+++ b/kdeprint/lpr/printcapreader.cpp
@@ -101,7 +101,7 @@ PrintcapEntry* PrintcapReader::nextEntry()
// now parse the entry
kdDebug() << "COMMENT: " << comment << endl;
kdDebug() << "LINE: " << buf << endl;
- int p = buf.tqfind(':');
+ int p = buf.find(':');
if (p == -1)
name = buf;
else
@@ -132,14 +132,14 @@ PrintcapEntry* PrintcapReader::nextEntry()
for (TQStringList::ConstIterator it=l.begin(); it!=l.end(); ++it)
{
Field f;
- int p = (*it).tqfind('=');
+ int p = (*it).find('=');
if (p == -1)
{
- p = (*it).tqfind('#');
+ p = (*it).find('#');
if (p == -1)
{
f.type = Field::Boolean;
- p = (*it).tqfind('@');
+ p = (*it).find('@');
if (p == -1)
{
f.name = (*it);