summaryrefslogtreecommitdiffstats
path: root/kdeprint/lpr
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 06:08:18 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 06:08:18 +0000
commit6e21bc798ba1066147d69dcc2d5c222ffafb9a90 (patch)
tree36613dfe2f86f8ccb96a30f3880507341228eeb0 /kdeprint/lpr
parent1e9fe867b0def399c63c42f35e83c3575e91ff83 (diff)
downloadtdelibs-6e21bc798ba1066147d69dcc2d5c222ffafb9a90.tar.gz
tdelibs-6e21bc798ba1066147d69dcc2d5c222ffafb9a90.zip
rename the following methods:
tqfind find tqreplace replace tqcontains contains git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdeprint/lpr')
-rw-r--r--kdeprint/lpr/apshandler.cpp8
-rw-r--r--kdeprint/lpr/kmlprmanager.cpp14
-rw-r--r--kdeprint/lpr/lpchelper.cpp24
-rw-r--r--kdeprint/lpr/lpqhelper.cpp6
-rw-r--r--kdeprint/lpr/lprhandler.cpp4
-rw-r--r--kdeprint/lpr/lprngtoolhandler.cpp18
-rw-r--r--kdeprint/lpr/matichandler.cpp16
-rw-r--r--kdeprint/lpr/matichelper.cpp2
-rw-r--r--kdeprint/lpr/printcapentry.h2
-rw-r--r--kdeprint/lpr/printcapreader.cpp8
10 files changed, 51 insertions, 51 deletions
diff --git a/kdeprint/lpr/apshandler.cpp b/kdeprint/lpr/apshandler.cpp
index 57ac45311..641ff5e07 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.tqcontains("PRINTER"))
+ if (opts.contains("PRINTER"))
{
prt->setDescription(i18n("APS Driver (%1)").arg(opts["PRINTER"]));
prt->setDriverInfo(prt->description());
@@ -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;
TQString variable = line.left(p).stripWhiteSpace();
TQString 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
@@ -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));
diff --git a/kdeprint/lpr/kmlprmanager.cpp b/kdeprint/lpr/kmlprmanager.cpp
index d9bcae5e1..64e593590 100644
--- a/kdeprint/lpr/kmlprmanager.cpp
+++ b/kdeprint/lpr/kmlprmanager.cpp
@@ -160,7 +160,7 @@ LprHandler* KMLprManager::findHandler(KMPrinter *prt)
{
TQString 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::findHandler(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;
@@ -230,9 +230,9 @@ DrMain* KMLprManager::loadPrinterDriver(KMPrinter *prt, bool config)
DrMain* KMLprManager::loadFileDriver(const TQString& filename)
{
- int p = filename.tqfind('/');
+ int p = filename.find('/');
TQString handler_str = (p != -1 ? filename.left(p) : TQString::tqfromLatin1("default"));
- LprHandler *handler = m_handlers.tqfind(handler_str);
+ LprHandler *handler = m_handlers.find(handler_str);
if (handler)
{
DrMain *driver = handler->loadDbDriver(filename);
@@ -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 = findHandler(prt);
else
- handler = m_handlers.tqfind("default");
+ handler = m_handlers.find("default");
if (!handler)
{
setErrorMsg(i18n("Internal error: no handler defined."));
diff --git a/kdeprint/lpr/lpchelper.cpp b/kdeprint/lpr/lpchelper.cpp
index 4fa32b8e0..7cf0bfebf 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;
}
@@ -82,26 +82,26 @@ void LpcHelper::parseStatusLPR(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);
}
}
@@ -121,7 +121,7 @@ void LpcHelper::parseStatusLPRng(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
@@ -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);
TQString answer = result.mid(q, p-q).stripWhiteSpace();
return answer;
}
@@ -274,9 +274,9 @@ bool LpcHelper::removeJob(KMJob *job, TQString& msg)
return false;
}
TQString 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/lpqhelper.cpp b/kdeprint/lpr/lpqhelper.cpp
index bbc70da3a..3bd1c514b 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, TQMIN(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/lprhandler.cpp b/kdeprint/lpr/lprhandler.cpp
index 1cacfae85..d3fc4ee94 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 aea703ea5..2d94e9b18 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())
{
TQString 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)
{
TQString 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));
@@ -209,13 +209,13 @@ TQValueList< TQPair<TQString,TQStringList> > LPRngToolHandler::loadChoiceDict(co
key = TQString::null;
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< TQPair<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;
diff --git a/kdeprint/lpr/matichandler.cpp b/kdeprint/lpr/matichandler.cpp
index 1625571d7..bd3307ad5 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");
@@ -126,7 +126,7 @@ bool MaticHandler::completePrinter(KMPrinter *prt, PrintcapEntry *entry, bool sh
TQString MaticHandler::parsePostpipe(const TQString& s)
{
TQString url;
- int p = s.tqfindRev('|');
+ int p = s.findRev('|');
TQStringList args = TQStringList::split(" ", s.right(s.length()-p-1));
if (args.count() != 0)
@@ -167,7 +167,7 @@ TQString MaticHandler::parsePostpipe(const TQString& s)
else
{
TQString 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);
@@ -309,13 +309,13 @@ 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->findOption(optname);
if (opt)
@@ -372,7 +372,7 @@ 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->findOption(optname));
if (opt)
diff --git a/kdeprint/lpr/matichelper.cpp b/kdeprint/lpr/matichelper.cpp
index acc968331..1da5f6313 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 e1c785760..a7f2cabcf 100644
--- a/kdeprint/lpr/printcapentry.h
+++ b/kdeprint/lpr/printcapentry.h
@@ -72,7 +72,7 @@ public:
TQMap<TQString,Field> fields;
TQString 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 4a5ce5ea7..72a6e2903 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);