rename the following methods:

tqfind find
tqreplace replace
tqcontains contains


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ksystemlog@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent 255b65585b
commit 3021c04cf6

@ -45,8 +45,8 @@ void AcpidReader::initColumns(LogViewColumns* columns) {
LogLine* AcpidReader::parseMessage(TQString& logLine, LogFile* logFile) { LogLine* AcpidReader::parseMessage(TQString& logLine, LogFile* logFile) {
int dateBegin=logLine.tqfind("["); int dateBegin=logLine.find("[");
int dateEnd=logLine.tqfind("]"); int dateEnd=logLine.find("]");
TQString type; TQString type;
TQString message; TQString message;
@ -82,7 +82,7 @@ LogLine* AcpidReader::parseMessage(TQString& logLine, LogFile* logFile) {
logLine=logLine.remove(0, dateEnd+2); logLine=logLine.remove(0, dateEnd+2);
int endType=logLine.tqfind("\""); int endType=logLine.find("\"");
//If the " character does not exist, it means that there is no Type category //If the " character does not exist, it means that there is no Type category
if (endType==-1) { if (endType==-1) {

@ -49,20 +49,20 @@ void ApacheAccessReader::initColumns(LogViewColumns* columns) {
} }
LogLine* ApacheAccessReader::parseMessage(TQString& logLine, LogFile* logFile) { LogLine* ApacheAccessReader::parseMessage(TQString& logLine, LogFile* logFile) {
int spacePos=logLine.tqfind(' '); int spacePos=logLine.find(' ');
TQString hostName=logLine.left(spacePos); TQString hostName=logLine.left(spacePos);
logLine=logLine.remove(0, spacePos+1); logLine=logLine.remove(0, spacePos+1);
spacePos=logLine.tqfind(' '); spacePos=logLine.find(' ');
TQString identd=logLine.left(spacePos); TQString identd=logLine.left(spacePos);
logLine=logLine.remove(0, spacePos+1); logLine=logLine.remove(0, spacePos+1);
spacePos=logLine.tqfind(' '); spacePos=logLine.find(' ');
TQString userName=logLine.left(spacePos); TQString userName=logLine.left(spacePos);
logLine=logLine.remove(0, spacePos+1); logLine=logLine.remove(0, spacePos+1);
int endDate=logLine.tqfind(']'); int endDate=logLine.find(']');
TQString strDateTime=logLine.left(endDate); TQString strDateTime=logLine.left(endDate);
logLine=logLine.remove(0, endDate+3); logLine=logLine.remove(0, endDate+3);
@ -70,21 +70,21 @@ LogLine* ApacheAccessReader::parseMessage(TQString& logLine, LogFile* logFile) {
TQDate date=dateTime.date(); TQDate date=dateTime.date();
TQTime time=dateTime.time(); TQTime time=dateTime.time();
int endQuote=logLine.tqfind('\"'); int endQuote=logLine.find('\"');
TQString message=logLine.left(endQuote); TQString message=logLine.left(endQuote);
logLine=logLine.remove(0, endQuote+2); logLine=logLine.remove(0, endQuote+2);
spacePos=logLine.tqfind(' '); spacePos=logLine.find(' ');
TQString httpResponse=ParsingHelper::parseHTTPResponse(logLine.left(spacePos)); TQString httpResponse=ParsingHelper::parseHTTPResponse(logLine.left(spacePos));
logLine=logLine.remove(0, spacePos+1); logLine=logLine.remove(0, spacePos+1);
spacePos=logLine.tqfind(' '); spacePos=logLine.find(' ');
TQString bytesSent=ParsingHelper::parseSize(logLine.left(spacePos)); TQString bytesSent=ParsingHelper::parseSize(logLine.left(spacePos));
logLine=logLine.remove(0, spacePos+2); logLine=logLine.remove(0, spacePos+2);
TQString url; TQString url;
endQuote=logLine.tqfind('\"'); endQuote=logLine.find('\"');
if (endQuote!=-1) { if (endQuote!=-1) {
url=logLine.left(endQuote); url=logLine.left(endQuote);
logLine=logLine.remove(0, endQuote+3); logLine=logLine.remove(0, endQuote+3);
@ -93,7 +93,7 @@ LogLine* ApacheAccessReader::parseMessage(TQString& logLine, LogFile* logFile) {
TQString agent; TQString agent;
//TODO Convert this value to find a more simple name for the Agent //TODO Convert this value to find a more simple name for the Agent
endQuote=logLine.tqfind('\"'); endQuote=logLine.find('\"');
if (endQuote!=-1) { if (endQuote!=-1) {
agent=ParsingHelper::parseAgent(logLine.left(endQuote)); agent=ParsingHelper::parseAgent(logLine.left(endQuote));
} }

@ -66,7 +66,7 @@ LogLine* ApacheReader::parseMessage(TQString& logLine, LogFile* logFile) {
int squareBracket; int squareBracket;
//Special case which sometimes happens //Special case which sometimes happens
if (logLine.tqfind("[client")==0) { if (logLine.find("[client")==0) {
date=TQDate::tqcurrentDate(); date=TQDate::tqcurrentDate();
time=TQTime::currentTime(); time=TQTime::currentTime();
level="notice"; level="notice";
@ -74,8 +74,8 @@ LogLine* ApacheReader::parseMessage(TQString& logLine, LogFile* logFile) {
else { else {
//The Date //The Date
int dateBegin=logLine.tqfind("["); int dateBegin=logLine.find("[");
int dateEnd=logLine.tqfind("]"); int dateEnd=logLine.find("]");
TQString type; TQString type;
TQString message; TQString message;
@ -101,14 +101,14 @@ LogLine* ApacheReader::parseMessage(TQString& logLine, LogFile* logFile) {
//The log level //The log level
squareBracket=logLine.tqfind("]"); squareBracket=logLine.find("]");
level=logLine.left(squareBracket); level=logLine.left(squareBracket);
logLine=logLine.remove(0, squareBracket+2); logLine=logLine.remove(0, squareBracket+2);
} }
//The client //The client
int beginSquareBracket=logLine.tqfind("[client"); int beginSquareBracket=logLine.find("[client");
squareBracket=logLine.tqfind("]"); squareBracket=logLine.find("]");
TQString client; TQString client;
if (beginSquareBracket==-1 || squareBracket==-1) { if (beginSquareBracket==-1 || squareBracket==-1) {
client=""; client="";
@ -140,7 +140,7 @@ void ApacheReader::initializeTypeLevels() {
LogLevel* ApacheReader::getTypeLevel(const TQString& type) { LogLevel* ApacheReader::getTypeLevel(const TQString& type) {
TQMap<TQString, LogLevel*>::iterator it; TQMap<TQString, LogLevel*>::iterator it;
it=mapTypeLevels.tqfind(type); it=mapTypeLevels.find(type);
if (it!=mapTypeLevels.end()) { if (it!=mapTypeLevels.end()) {
return(*it); return(*it);
} }

@ -59,8 +59,8 @@ LogLine* CronReader::parseMessage(TQString& line, LogFile* logFile) {
TQString message=list.back(); TQString message=list.back();
list.pop_back(); list.pop_back();
int leftBracket=message.tqfind('('); int leftBracket=message.find('(');
int rightBracket=message.tqfind(')'); int rightBracket=message.find(')');
TQString user=message.mid(leftBracket+1, rightBracket-leftBracket-1); TQString user=message.mid(leftBracket+1, rightBracket-leftBracket-1);

@ -47,20 +47,20 @@ void CupsAccessReader::initColumns(LogViewColumns* columns) {
} }
LogLine* CupsAccessReader::parseMessage(TQString& logLine, LogFile* logFile) { LogLine* CupsAccessReader::parseMessage(TQString& logLine, LogFile* logFile) {
int spacePos=logLine.tqfind(' '); int spacePos=logLine.find(' ');
TQString hostName=logLine.left(spacePos); TQString hostName=logLine.left(spacePos);
logLine=logLine.remove(0, spacePos+1); logLine=logLine.remove(0, spacePos+1);
spacePos=logLine.tqfind(' '); spacePos=logLine.find(' ');
TQString identd=logLine.left(spacePos); TQString identd=logLine.left(spacePos);
logLine=logLine.remove(0, spacePos+1); logLine=logLine.remove(0, spacePos+1);
spacePos=logLine.tqfind(' '); spacePos=logLine.find(' ');
TQString userName=logLine.left(spacePos); TQString userName=logLine.left(spacePos);
logLine=logLine.remove(0, spacePos+1); logLine=logLine.remove(0, spacePos+1);
int endDate=logLine.tqfind(']'); int endDate=logLine.find(']');
TQString strDateTime=logLine.left(endDate); TQString strDateTime=logLine.left(endDate);
logLine=logLine.remove(0, endDate+3); logLine=logLine.remove(0, endDate+3);
@ -68,15 +68,15 @@ LogLine* CupsAccessReader::parseMessage(TQString& logLine, LogFile* logFile) {
TQDate date=dateTime.date(); TQDate date=dateTime.date();
TQTime time=dateTime.time(); TQTime time=dateTime.time();
int endQuote=logLine.tqfind('\"'); int endQuote=logLine.find('\"');
TQString message=logLine.left(endQuote); TQString message=logLine.left(endQuote);
logLine=logLine.remove(0, endQuote+2); logLine=logLine.remove(0, endQuote+2);
spacePos=logLine.tqfind(' '); spacePos=logLine.find(' ');
TQString httpResponse=ParsingHelper::parseHTTPResponse(logLine.left(spacePos)); TQString httpResponse=ParsingHelper::parseHTTPResponse(logLine.left(spacePos));
logLine=logLine.remove(0, spacePos+1); logLine=logLine.remove(0, spacePos+1);
spacePos=logLine.tqfind(' '); spacePos=logLine.find(' ');
TQString bytesSent=ParsingHelper::parseSize(logLine.left(spacePos)); TQString bytesSent=ParsingHelper::parseSize(logLine.left(spacePos));

@ -91,7 +91,7 @@ void CupsReader::initializeTypeLevels() {
LogLevel* CupsReader::getTypeLevel(const TQChar& type) { LogLevel* CupsReader::getTypeLevel(const TQChar& type) {
TQMap<TQChar, LogLevel*>::iterator it; TQMap<TQChar, LogLevel*>::iterator it;
it=mapTypeLevels.tqfind(type); it=mapTypeLevels.find(type);
if (it!=mapTypeLevels.end()) { if (it!=mapTypeLevels.end()) {
return(*it); return(*it);
} }

@ -94,7 +94,7 @@ void DefaultReader::readFile(LogFile* logFile) {
emit statusbarChanged(message); emit statusbarChanged(message);
//Inform connected TQObject that we are now reading the "index" file //Inform connected TQObject that we are now reading the "index" file
emit readingFile(logManager->getLogFiles().count() - logManager->getLogFiles().tqfindIndex(logFile)); emit readingFile(logManager->getLogFiles().count() - logManager->getLogFiles().findIndex(logFile));
//We initialize these values from configuration to be used by the insert methods //We initialize these values from configuration to be used by the insert methods
@ -399,7 +399,7 @@ LogLine* DefaultReader::parseMessage(TQString& logLine, LogFile* originalFile) {
logLine=logLine.remove(0, 9); logLine=logLine.remove(0, 9);
int nextSpace; int nextSpace;
nextSpace=logLine.tqfind(' '); nextSpace=logLine.find(' ');
//Host name //Host name
TQString hostname; TQString hostname;
@ -413,13 +413,13 @@ LogLine* DefaultReader::parseMessage(TQString& logLine, LogFile* originalFile) {
TQString message; TQString message;
//Process name //Process name
nextSpace=logLine.tqfind(':'); nextSpace=logLine.find(':');
if (nextSpace!=-1) { if (nextSpace!=-1) {
process=logLine.left(nextSpace); process=logLine.left(nextSpace);
//If the delete process identifier option is enabled //If the delete process identifier option is enabled
if (tmpDeleteProcessId==true) { if (tmpDeleteProcessId==true) {
int squareBracket=process.tqfind('['); int squareBracket=process.find('[');
//If we find a bracket, we remove the useless part //If we find a bracket, we remove the useless part
if (squareBracket!=-1) { if (squareBracket!=-1) {

@ -77,7 +77,7 @@ void FindManager::slotFirstFind() {
list->setSelected(previousItemFound, false); list->setSelected(previousItemFound, false);
} }
//This creates a tqfind-next-prompt dialog if needed. //This creates a find-next-prompt dialog if needed.
findManager=new KFind(findDialog->pattern(), findDialog->options(), main, findDialog); findManager=new KFind(findDialog->pattern(), findDialog->options(), main, findDialog);
connect(findManager, TQT_SIGNAL(highlight(const TQString&, int, int)), this, TQT_SLOT(highlightSearch(const TQString&, int, int))); connect(findManager, TQT_SIGNAL(highlight(const TQString&, int, int)), this, TQT_SLOT(highlightSearch(const TQString&, int, int)));
connect(findManager, TQT_SIGNAL(findNext()), this, TQT_SLOT(slotFindNext())); connect(findManager, TQT_SIGNAL(findNext()), this, TQT_SLOT(slotFindNext()));

@ -487,8 +487,8 @@ TQString ItemFactory::labelMessageFormat(TQString label, TQString value) {
TQString ItemFactory::messageFormat(TQString& message) { TQString ItemFactory::messageFormat(TQString& message) {
TQString transformation(message); TQString transformation(message);
transformation.tqreplace(TQRegExp("&"), "&amp;"); transformation.replace(TQRegExp("&"), "&amp;");
transformation.tqreplace(TQRegExp("<"), "&lt;"); transformation.replace(TQRegExp("<"), "&lt;");
transformation.tqreplace(TQRegExp(">"), "&gt;"); transformation.replace(TQRegExp(">"), "&gt;");
return(transformation); return(transformation);
} }

@ -318,7 +318,7 @@ void KSystemLog::setupActions() {
actionCollection()->action("select_all")->setToolTip(i18n("Select all lines of the current log")); actionCollection()->action("select_all")->setToolTip(i18n("Select all lines of the current log"));
actionCollection()->action("select_all")->setWhatsThis(i18n("Selects all lines of the current log. This action is useful if you want, for example, to save all the content of the current log in a file.")); actionCollection()->action("select_all")->setWhatsThis(i18n("Selects all lines of the current log. This action is useful if you want, for example, to save all the content of the current log in a file."));
KStdAction::find(findManager, TQT_SLOT(slotFind()), actionCollection(), "tqfind"); KStdAction::find(findManager, TQT_SLOT(slotFind()), actionCollection(), "find");
KStdAction::findNext(findManager, TQT_SLOT(slotFindNext()), actionCollection(), "find_next"); KStdAction::findNext(findManager, TQT_SLOT(slotFindNext()), actionCollection(), "find_next");
//TODO Find a solution to display at the right place this action (see Akregator interface) //TODO Find a solution to display at the right place this action (see Akregator interface)

@ -213,7 +213,7 @@ void LoggerDialog::sendMessage() {
//Else, the user types the content of its message //Else, the user types the content of its message
else { else {
//Remove bad "\n" characters //Remove bad "\n" characters
TQString msg=message->text().tqreplace("\n", " "); TQString msg=message->text().replace("\n", " ");
process << msg; process << msg;
} }

@ -71,7 +71,7 @@ int ParsingHelper::parseMonthNumber(TQString& string) {
TQMap<TQString, int>::Iterator it; TQMap<TQString, int>::Iterator it;
//Search the month name in the map //Search the month name in the map
it=ParsingHelper::mapMonths.tqfind(string); it=ParsingHelper::mapMonths.find(string);
if (it!=ParsingHelper::mapMonths.end()) if (it!=ParsingHelper::mapMonths.end())
return(*it); return(*it);
@ -154,7 +154,7 @@ TQString ParsingHelper::parseHTTPResponse(const TQString& response) {
} }
//Search the response string in the map //Search the response string in the map
TQMap<TQString, TQString>::Iterator it=ParsingHelper::mapHTTPResponse.tqfind(response); TQMap<TQString, TQString>::Iterator it=ParsingHelper::mapHTTPResponse.find(response);
if (it!=ParsingHelper::mapHTTPResponse.end()) if (it!=ParsingHelper::mapHTTPResponse.end())
return(TQString("%1 %2").tqarg(response).tqarg(*it)); return(TQString("%1 %2").tqarg(response).tqarg(*it));
else else

@ -65,8 +65,8 @@ LogLine* SambaReader::parseMessage(TQString& logLine, LogFile* logFile) {
*/ */
//The Date //The Date
int dateBegin=logLine.tqfind("["); int dateBegin=logLine.find("[");
int dateEnd=logLine.tqfind("]"); int dateEnd=logLine.find("]");
TQString strDate=logLine.mid(dateBegin+1, dateEnd-dateBegin-1); TQString strDate=logLine.mid(dateBegin+1, dateEnd-dateBegin-1);
@ -86,17 +86,17 @@ LogLine* SambaReader::parseMessage(TQString& logLine, LogFile* logFile) {
//The source file //The source file
int doubleDot; int doubleDot;
doubleDot=logLine.tqfind(":"); doubleDot=logLine.find(":");
TQString file=logLine.left(doubleDot); TQString file=logLine.left(doubleDot);
logLine=logLine.remove(0, doubleDot+1); logLine=logLine.remove(0, doubleDot+1);
//The function //The function
int bracket=logLine.tqfind("("); int bracket=logLine.find("(");
TQString function=logLine.left(bracket); TQString function=logLine.left(bracket);
logLine=logLine.remove(0, bracket+1); logLine=logLine.remove(0, bracket+1);
//The line number //The line number
bracket=logLine.tqfind(")"); bracket=logLine.find(")");
TQString lineNumber=logLine.left(bracket); TQString lineNumber=logLine.left(bracket);
//Remove the first return character and the two useless space of the first message line //Remove the first return character and the two useless space of the first message line
@ -106,9 +106,9 @@ LogLine* SambaReader::parseMessage(TQString& logLine, LogFile* logFile) {
//Remove the last \n //Remove the last \n
logLine=logLine.left(logLine.length()-1); logLine=logLine.left(logLine.length()-1);
//Remove return characters and 2 first spaces at each lines //Remove return characters and 2 first spaces at each lines
TQString message=logLine.tqreplace("\n ", " / "); TQString message=logLine.replace("\n ", " / ");
//TQString message=logLine.tqreplace("\n", " / "); //TQString message=logLine.replace("\n", " / ");
TQStringList list; TQStringList list;
list.push_back(file); list.push_back(file);

@ -108,7 +108,7 @@ void XorgReader::initializeTypeName() {
LogLevel* XorgReader::getTypeName(const TQString type) { LogLevel* XorgReader::getTypeName(const TQString type) {
TQMap<TQString, LogLevel*>::iterator it; TQMap<TQString, LogLevel*>::iterator it;
it=xorgLevels.tqfind(type); it=xorgLevels.find(type);
if (it!=xorgLevels.end()) if (it!=xorgLevels.end())
return(*it); return(*it);
else else

Loading…
Cancel
Save