Browse Source

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
tags/v3.5.13
tpearson 8 years ago
parent
commit
3021c04cf6
14 changed files with 49 additions and 49 deletions
  1. +3
    -3
      ksystemlog/src/acpid/acpidReader.cpp
  2. +9
    -9
      ksystemlog/src/apache/apacheAccessReader.cpp
  3. +7
    -7
      ksystemlog/src/apache/apacheReader.cpp
  4. +2
    -2
      ksystemlog/src/cron/cronReader.cpp
  5. +7
    -7
      ksystemlog/src/cups/cupsAccessReader.cpp
  6. +1
    -1
      ksystemlog/src/cups/cupsReader.cpp
  7. +4
    -4
      ksystemlog/src/defaultReader.cpp
  8. +1
    -1
      ksystemlog/src/findManager.cpp
  9. +3
    -3
      ksystemlog/src/itemFactory.cpp
  10. +1
    -1
      ksystemlog/src/ksystemlog.cpp
  11. +1
    -1
      ksystemlog/src/loggerDialog.cpp
  12. +2
    -2
      ksystemlog/src/parsingHelper.cpp
  13. +7
    -7
      ksystemlog/src/samba/sambaReader.cpp
  14. +1
    -1
      ksystemlog/src/xorg/xorgReader.cpp

+ 3
- 3
ksystemlog/src/acpid/acpidReader.cpp View File

@@ -45,8 +45,8 @@ void AcpidReader::initColumns(LogViewColumns* columns) {

LogLine* AcpidReader::parseMessage(TQString& logLine, LogFile* logFile) {

int dateBegin=logLine.tqfind("[");
int dateEnd=logLine.tqfind("]");
int dateBegin=logLine.find("[");
int dateEnd=logLine.find("]");
TQString type;
TQString message;
@@ -82,7 +82,7 @@ LogLine* AcpidReader::parseMessage(TQString& logLine, LogFile* logFile) {
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 (endType==-1) {

+ 9
- 9
ksystemlog/src/apache/apacheAccessReader.cpp View File

@@ -49,20 +49,20 @@ void ApacheAccessReader::initColumns(LogViewColumns* columns) {
}

LogLine* ApacheAccessReader::parseMessage(TQString& logLine, LogFile* logFile) {
int spacePos=logLine.tqfind(' ');
int spacePos=logLine.find(' ');
TQString hostName=logLine.left(spacePos);
logLine=logLine.remove(0, spacePos+1);
spacePos=logLine.tqfind(' ');
spacePos=logLine.find(' ');
TQString identd=logLine.left(spacePos);
logLine=logLine.remove(0, spacePos+1);
spacePos=logLine.tqfind(' ');
spacePos=logLine.find(' ');
TQString userName=logLine.left(spacePos);
logLine=logLine.remove(0, spacePos+1);

int endDate=logLine.tqfind(']');
int endDate=logLine.find(']');
TQString strDateTime=logLine.left(endDate);
logLine=logLine.remove(0, endDate+3);
@@ -70,21 +70,21 @@ LogLine* ApacheAccessReader::parseMessage(TQString& logLine, LogFile* logFile) {
TQDate date=dateTime.date();
TQTime time=dateTime.time();
int endQuote=logLine.tqfind('\"');
int endQuote=logLine.find('\"');
TQString message=logLine.left(endQuote);
logLine=logLine.remove(0, endQuote+2);
spacePos=logLine.tqfind(' ');
spacePos=logLine.find(' ');
TQString httpResponse=ParsingHelper::parseHTTPResponse(logLine.left(spacePos));
logLine=logLine.remove(0, spacePos+1);

spacePos=logLine.tqfind(' ');
spacePos=logLine.find(' ');
TQString bytesSent=ParsingHelper::parseSize(logLine.left(spacePos));
logLine=logLine.remove(0, spacePos+2);
TQString url;
endQuote=logLine.tqfind('\"');
endQuote=logLine.find('\"');
if (endQuote!=-1) {
url=logLine.left(endQuote);
logLine=logLine.remove(0, endQuote+3);
@@ -93,7 +93,7 @@ LogLine* ApacheAccessReader::parseMessage(TQString& logLine, LogFile* logFile) {
TQString agent;
//TODO Convert this value to find a more simple name for the Agent
endQuote=logLine.tqfind('\"');
endQuote=logLine.find('\"');
if (endQuote!=-1) {
agent=ParsingHelper::parseAgent(logLine.left(endQuote));
}

+ 7
- 7
ksystemlog/src/apache/apacheReader.cpp View File

@@ -66,7 +66,7 @@ LogLine* ApacheReader::parseMessage(TQString& logLine, LogFile* logFile) {
int squareBracket;
//Special case which sometimes happens
if (logLine.tqfind("[client")==0) {
if (logLine.find("[client")==0) {
date=TQDate::tqcurrentDate();
time=TQTime::currentTime();
level="notice";
@@ -74,8 +74,8 @@ LogLine* ApacheReader::parseMessage(TQString& logLine, LogFile* logFile) {
else {
//The Date
int dateBegin=logLine.tqfind("[");
int dateEnd=logLine.tqfind("]");
int dateBegin=logLine.find("[");
int dateEnd=logLine.find("]");
TQString type;
TQString message;
@@ -101,14 +101,14 @@ LogLine* ApacheReader::parseMessage(TQString& logLine, LogFile* logFile) {

//The log level
squareBracket=logLine.tqfind("]");
squareBracket=logLine.find("]");
level=logLine.left(squareBracket);
logLine=logLine.remove(0, squareBracket+2);
}
//The client
int beginSquareBracket=logLine.tqfind("[client");
squareBracket=logLine.tqfind("]");
int beginSquareBracket=logLine.find("[client");
squareBracket=logLine.find("]");
TQString client;
if (beginSquareBracket==-1 || squareBracket==-1) {
client="";
@@ -140,7 +140,7 @@ void ApacheReader::initializeTypeLevels() {
LogLevel* ApacheReader::getTypeLevel(const TQString& type) {
TQMap<TQString, LogLevel*>::iterator it;
it=mapTypeLevels.tqfind(type);
it=mapTypeLevels.find(type);
if (it!=mapTypeLevels.end()) {
return(*it);
}

+ 2
- 2
ksystemlog/src/cron/cronReader.cpp View File

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

+ 7
- 7
ksystemlog/src/cups/cupsAccessReader.cpp View File

@@ -47,20 +47,20 @@ void CupsAccessReader::initColumns(LogViewColumns* columns) {
}

LogLine* CupsAccessReader::parseMessage(TQString& logLine, LogFile* logFile) {
int spacePos=logLine.tqfind(' ');
int spacePos=logLine.find(' ');
TQString hostName=logLine.left(spacePos);
logLine=logLine.remove(0, spacePos+1);
spacePos=logLine.tqfind(' ');
spacePos=logLine.find(' ');
TQString identd=logLine.left(spacePos);
logLine=logLine.remove(0, spacePos+1);
spacePos=logLine.tqfind(' ');
spacePos=logLine.find(' ');
TQString userName=logLine.left(spacePos);
logLine=logLine.remove(0, spacePos+1);

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

spacePos=logLine.tqfind(' ');
spacePos=logLine.find(' ');
TQString bytesSent=ParsingHelper::parseSize(logLine.left(spacePos));

+ 1
- 1
ksystemlog/src/cups/cupsReader.cpp View File

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

+ 4
- 4
ksystemlog/src/defaultReader.cpp View File

@@ -94,7 +94,7 @@ void DefaultReader::readFile(LogFile* logFile) {
emit statusbarChanged(message);

//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
@@ -399,7 +399,7 @@ LogLine* DefaultReader::parseMessage(TQString& logLine, LogFile* originalFile) {
logLine=logLine.remove(0, 9);
int nextSpace;
nextSpace=logLine.tqfind(' ');
nextSpace=logLine.find(' ');
//Host name
TQString hostname;
@@ -413,13 +413,13 @@ LogLine* DefaultReader::parseMessage(TQString& logLine, LogFile* originalFile) {
TQString message;
//Process name
nextSpace=logLine.tqfind(':');
nextSpace=logLine.find(':');
if (nextSpace!=-1) {
process=logLine.left(nextSpace);
//If the delete process identifier option is enabled
if (tmpDeleteProcessId==true) {
int squareBracket=process.tqfind('[');
int squareBracket=process.find('[');
//If we find a bracket, we remove the useless part
if (squareBracket!=-1) {

+ 1
- 1
ksystemlog/src/findManager.cpp View File

@@ -77,7 +77,7 @@ void FindManager::slotFirstFind() {
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);
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()));

+ 3
- 3
ksystemlog/src/itemFactory.cpp View File

@@ -487,8 +487,8 @@ TQString ItemFactory::labelMessageFormat(TQString label, TQString value) {

TQString ItemFactory::messageFormat(TQString& message) {
TQString transformation(message);
transformation.tqreplace(TQRegExp("&"), "&amp;");
transformation.tqreplace(TQRegExp("<"), "&lt;");
transformation.tqreplace(TQRegExp(">"), "&gt;");
transformation.replace(TQRegExp("&"), "&amp;");
transformation.replace(TQRegExp("<"), "&lt;");
transformation.replace(TQRegExp(">"), "&gt;");
return(transformation);
}

+ 1
- 1
ksystemlog/src/ksystemlog.cpp View File

@@ -318,7 +318,7 @@ void KSystemLog::setupActions() {
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."));
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");

//TODO Find a solution to display at the right place this action (see Akregator interface)

+ 1
- 1
ksystemlog/src/loggerDialog.cpp View File

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

+ 2
- 2
ksystemlog/src/parsingHelper.cpp View File

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

+ 7
- 7
ksystemlog/src/samba/sambaReader.cpp View File

@@ -65,8 +65,8 @@ LogLine* SambaReader::parseMessage(TQString& logLine, LogFile* logFile) {
*/
//The Date
int dateBegin=logLine.tqfind("[");
int dateEnd=logLine.tqfind("]");
int dateBegin=logLine.find("[");
int dateEnd=logLine.find("]");
TQString strDate=logLine.mid(dateBegin+1, dateEnd-dateBegin-1);
@@ -86,17 +86,17 @@ LogLine* SambaReader::parseMessage(TQString& logLine, LogFile* logFile) {

//The source file
int doubleDot;
doubleDot=logLine.tqfind(":");
doubleDot=logLine.find(":");
TQString file=logLine.left(doubleDot);
logLine=logLine.remove(0, doubleDot+1);
//The function
int bracket=logLine.tqfind("(");
int bracket=logLine.find("(");
TQString function=logLine.left(bracket);
logLine=logLine.remove(0, bracket+1);
//The line number
bracket=logLine.tqfind(")");
bracket=logLine.find(")");
TQString lineNumber=logLine.left(bracket);
//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
logLine=logLine.left(logLine.length()-1);
//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;
list.push_back(file);

+ 1
- 1
ksystemlog/src/xorg/xorgReader.cpp View File

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

Loading…
Cancel
Save