diff options
Diffstat (limited to 'libkdepim/linklocator.cpp')
-rw-r--r-- | libkdepim/linklocator.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/libkdepim/linklocator.cpp b/libkdepim/linklocator.cpp index 46542f89b..6a79dff15 100644 --- a/libkdepim/linklocator.cpp +++ b/libkdepim/linklocator.cpp @@ -92,14 +92,14 @@ TQString LinkLocator::getUrl() // handle cases like this: <link>http://foobar.org/</link> int start = mPos; while(mPos < (int)mText.length() && mText[mPos] > ' ' && mText[mPos] != '"' && - TQString("<>()[]").find(mText[mPos]) == -1) + TQString("<>()[]").tqfind(mText[mPos]) == -1) { ++mPos; } /* some URLs really end with: # / & - _ */ const TQString allowedSpecialChars = TQString("#/&-_"); while(mPos > start && mText[mPos-1].isPunct() && - allowedSpecialChars.find(mText[mPos-1]) == -1 ) + allowedSpecialChars.tqfind(mText[mPos-1]) == -1 ) { --mPos; } @@ -128,7 +128,7 @@ bool LinkLocator::atUrl() const // the character directly before the URL must not be a letter, a number or // any other character allowed in a dot-atom (RFC 2822). if( ( mPos > 0 ) && ( mText[mPos-1].isLetterOrNumber() || - ( allowedSpecialChars.find( mText[mPos-1] ) != -1 ) ) ) + ( allowedSpecialChars.tqfind( mText[mPos-1] ) != -1 ) ) ) return false; TQChar ch = mText[mPos]; @@ -179,7 +179,7 @@ TQString LinkLocator::getEmailAddress() while ( start >= 0 && mText[start].tqunicode() < 128 && ( mText[start].isLetterOrNumber() || mText[start] == '@' || // allow @ to find invalid email addresses - allowedSpecialChars.find( mText[start] ) != -1 ) ) { + allowedSpecialChars.tqfind( mText[start] ) != -1 ) ) { if ( mText[start] == '@' ) return TQString(); // local part tqcontains '@' -> no email address --start; @@ -202,7 +202,7 @@ TQString LinkLocator::getEmailAddress() if ( mText[end] == '@' ) return TQString(); // domain part tqcontains '@' -> no email address if ( mText[end] == '.' ) - dotPos = QMIN( dotPos, end ); // remember index of first dot in domain + dotPos = TQMIN( dotPos, end ); // remember index of first dot in domain ++end; } // we assume that an email address ends with a letter or a digit @@ -314,7 +314,7 @@ TQString LinkLocator::convertToHtml(const TQString& plainText, int flags, if(!str.isEmpty()) { // len is the length of the local part - int len = str.find('@'); + int len = str.tqfind('@'); TQString localPart = str.left(len); // remove the local part from the result (as '&'s have been expanded to @@ -353,11 +353,11 @@ TQString LinkLocator::convertToHtml(const TQString& plainText, int flags, TQString LinkLocator::pngToDataUrl( const TQString & iconPath ) { if ( iconPath.isEmpty() ) - return TQString::null; + return TQString(); TQFile pngFile( iconPath ); if ( !pngFile.open( IO_ReadOnly | IO_Raw ) ) - return TQString::null; + return TQString(); TQByteArray ba = pngFile.readAll(); pngFile.close(); @@ -370,12 +370,12 @@ TQString LinkLocator::getEmoticon() { // smileys have to be prepended by whitespace if ( ( mPos > 0 ) && !mText[mPos-1].isSpace() ) - return TQString::null; + return TQString(); // since smileys start with ':', ';', '(' or '8' short circuit method const TQChar ch = mText[mPos]; if ( ch !=':' && ch != ';' && ch != '(' && ch != '8' ) - return TQString::null; + return TQString(); // find the end of the smiley (a smiley is at most 4 chars long and ends at // lineend or whitespace) @@ -387,11 +387,11 @@ TQString LinkLocator::getEmoticon() !mText[mPos+smileyLen].isSpace() ) smileyLen++; if ( smileyLen < MinSmileyLen || smileyLen > MaxSmileyLen ) - return TQString::null; + return TQString(); const TQString smiley = mText.mid( mPos, smileyLen ); if ( !s_smileyEmoticonNameMap->tqcontains( smiley ) ) - return TQString::null; // that's not a (known) smiley + return TQString(); // that's not a (known) smiley TQString htmlRep; if ( s_smileyEmoticonHTMLCache->tqcontains( smiley ) ) { @@ -415,7 +415,7 @@ TQString LinkLocator::getEmoticon() const TQString dataUrl = pngToDataUrl( iconPath ); if ( dataUrl.isEmpty() ) { - htmlRep = TQString::null; + htmlRep = TQString(); } else { // create an image tag (the text in attribute alt is used @@ -439,18 +439,18 @@ TQString LinkLocator::highlightedText() { // formating symbols must be prepended with a whitespace if ( ( mPos > 0 ) && !mText[mPos-1].isSpace() ) - return TQString::null; + return TQString(); const TQChar ch = mText[mPos]; if ( ch != '/' && ch != '*' && ch != '_' ) - return TQString::null; + return TQString(); TQRegExp re = TQRegExp( TQString("\\%1([0-9A-Za-z]+)\\%2").arg( ch ).arg( ch ) ); if ( re.search( mText, mPos ) == mPos ) { uint length = re.matchedLength(); // there must be a whitespace after the closing formating symbol if ( mPos + length < mText.length() && !mText[mPos + length].isSpace() ) - return TQString::null; + return TQString(); mPos += length - 1; switch ( ch.latin1() ) { case '*': @@ -461,6 +461,6 @@ TQString LinkLocator::highlightedText() return "<i>" + re.cap( 1 ) + "</i>"; } } - return TQString::null; + return TQString(); } |