summaryrefslogtreecommitdiffstats
path: root/libkmime/kmime_util.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-13 00:46:47 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-13 00:46:47 +0000
commit67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 (patch)
tree5f52a9eada2e9f3654fc327d7c14dfef570a6ecb /libkmime/kmime_util.cpp
parent2ee4bf4fd5eff93b2fbef0ff8e8063edffc5da5c (diff)
downloadtdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.tar.gz
tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.zip
Initial conversion of kdepim to TQt
This will probably require some tweaking before it will build under Qt4, however Qt3 builds are OK. Any alterations this commit makes to kdepim behaviour under Qt3 are unintentional and should be fixed. git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1227832 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkmime/kmime_util.cpp')
-rw-r--r--libkmime/kmime_util.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/libkmime/kmime_util.cpp b/libkmime/kmime_util.cpp
index 2f0d04a1f..167ac78d7 100644
--- a/libkmime/kmime_util.cpp
+++ b/libkmime/kmime_util.cpp
@@ -30,7 +30,7 @@
#endif
#include <tqtextcodec.h>
-#include <tqstrlist.h> // for QStrIList
+#include <tqstrlist.h> // for TQStrIList
#include <tqregexp.h>
#include <stdlib.h>
@@ -47,7 +47,7 @@ TQStrIList l_anguageCache;
const char* cachedCharset(const TQCString &name)
{
- int idx=c_harsetCache.find(name.data());
+ int idx=c_harsetCache.tqfind(name.data());
if(idx>-1)
return c_harsetCache.at(idx);
@@ -58,7 +58,7 @@ const char* cachedCharset(const TQCString &name)
const char* cachedLanguage(const TQCString &name)
{
- int idx=l_anguageCache.find(name.data());
+ int idx=l_anguageCache.tqfind(name.data());
if(idx>-1)
return l_anguageCache.at(idx);
@@ -132,7 +132,7 @@ TQString decodeRFC2047String(const TQCString &src, const char **usedCS,
const int maxLen=400;
int i;
- if(src.find("=?") < 0)
+ if(src.tqfind("=?") < 0)
result = src.copy();
else {
result.truncate(src.length());
@@ -217,7 +217,7 @@ TQString decodeRFC2047String(const TQCString &src, const char **usedCS,
*dest = '\0';
}
- //find suitable QTextCodec
+ //find suitable TQTextCodec
TQTextCodec *codec=0;
bool ok=true;
if (forceCS || declaredCS.isEmpty()) {
@@ -248,7 +248,7 @@ TQCString encodeRFC2047String(const TQString &src, const char *charset,
{
TQCString encoded8Bit, result, usedCS;
unsigned int start=0,end=0;
- bool nonAscii=false, ok=true, useQEncoding=false;
+ bool nonAscii=false, ok=true, useTQEncoding=false;
TQTextCodec *codec=0;
usedCS=charset;
@@ -260,8 +260,8 @@ TQCString encodeRFC2047String(const TQString &src, const char *charset,
codec=KGlobal::charsets()->codecForName(usedCS, ok);
}
- if (usedCS.find("8859-")>=0) // use "B"-Encoding for non iso-8859-x charsets
- useQEncoding=true;
+ if (usedCS.tqfind("8859-")>=0) // use "B"-Encoding for non iso-8859-x charsets
+ useTQEncoding=true;
encoded8Bit=codec->fromUnicode(src);
@@ -297,7 +297,7 @@ TQCString encodeRFC2047String(const TQString &src, const char *charset,
result = encoded8Bit.left(start)+"=?"+usedCS;
- if (useQEncoding) {
+ if (useTQEncoding) {
result += "?Q?";
char c,hexcode; // implementation of the "Q"-encoding described in RFC 2047
@@ -335,7 +335,7 @@ TQCString encodeRFC2047String(const TQString &src, const char *charset,
TQCString uniqueString()
{
- static char chars[] = "0123456789abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ static char chars[] = "0123456789abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPTQRSTUVWXYZ";
time_t now;
TQCString ret;
char p[11];
@@ -375,7 +375,7 @@ TQCString extractHeader(const TQCString &src, const char *name)
pos1 = 0;
} else {
n.prepend("\n");
- pos1 = src.find(n,0,false);
+ pos1 = src.tqfind(n,0,false);
}
if (pos1>-1) { //there is a header with the given name
@@ -387,7 +387,7 @@ TQCString extractHeader(const TQCString &src, const char *name)
if (src[pos2]!='\n') { // check if the header is not empty
while(1) {
- pos2=src.find("\n", pos2+1);
+ pos2=src.tqfind("\n", pos2+1);
if(pos2==-1 || pos2==len || ( src[pos2+1]!=' ' && src[pos2+1]!='\t') ) //break if we reach the end of the string, honor folded lines
break;
else
@@ -506,7 +506,7 @@ DateFormatter::setFormat( FormatType t )
mFormat = t;
}
-QString
+TQString
DateFormatter::dateString( time_t otime , const TQString& lang ,
bool shortFormat, bool includeSecs ) const
{
@@ -527,17 +527,17 @@ DateFormatter::dateString( time_t otime , const TQString& lang ,
return custom( otime );
break;
}
- return TQString::null;
+ return TQString();
}
-QString
+TQString
DateFormatter::dateString(const TQDateTime& dtime, const TQString& lang,
bool shortFormat, bool includeSecs ) const
{
return DateFormatter::dateString( qdateToTimeT(dtime), lang, shortFormat, includeSecs );
}
-QCString
+TQCString
DateFormatter::rfc2822(time_t otime) const
{
TQDateTime tmp;
@@ -551,13 +551,13 @@ DateFormatter::rfc2822(time_t otime) const
return ret;
}
-QString
+TQString
DateFormatter::custom(time_t t) const
{
if ( mCustomFormat.isEmpty() )
- return TQString::null;
+ return TQString();
- int z = mCustomFormat.find("Z");
+ int z = mCustomFormat.tqfind("Z");
TQDateTime d;
TQString ret = mCustomFormat;
@@ -578,14 +578,14 @@ DateFormatter::setCustomFormat(const TQString& format)
mFormat = Custom;
}
-QString
+TQString
DateFormatter::getCustomFormat() const
{
return mCustomFormat;
}
-QCString
+TQCString
DateFormatter::zone(time_t otime) const
{
TQCString ret;
@@ -658,7 +658,7 @@ DateFormatter::qdateToTimeT(const TQDateTime& dt) const
return drf;
}
-QString
+TQString
DateFormatter::fancy(time_t otime) const
{
KLocale *locale = KGlobal::locale();
@@ -710,7 +710,7 @@ DateFormatter::fancy(time_t otime) const
}
-QString
+TQString
DateFormatter::localized(time_t otime, bool shortFormat, bool includeSecs,
const TQString& localeLanguage ) const
{
@@ -734,13 +734,13 @@ DateFormatter::localized(time_t otime, bool shortFormat, bool includeSecs,
return ret;
}
-QString
+TQString
DateFormatter::cTime(time_t otime) const
{
return TQString::tqfromLatin1( ctime( &otime ) ).stripWhiteSpace() ;
}
-QString
+TQString
DateFormatter::isoDate(time_t otime) const
{
char cstr[64];
@@ -755,7 +755,7 @@ DateFormatter::reset()
mCurrentTime = 0;
}
-QString
+TQString
DateFormatter::formatDate(DateFormatter::FormatType t, time_t otime,
const TQString& data, bool shortFormat, bool includeSecs )
{
@@ -766,7 +766,7 @@ DateFormatter::formatDate(DateFormatter::FormatType t, time_t otime,
return f.dateString( otime, data, shortFormat, includeSecs );
}
-QString
+TQString
DateFormatter::formatCurrentDate( DateFormatter::FormatType t, const TQString& data,
bool shortFormat, bool includeSecs )
{
@@ -777,7 +777,7 @@ DateFormatter::formatCurrentDate( DateFormatter::FormatType t, const TQString& d
return f.dateString( time(0), data, shortFormat, includeSecs );
}
-QCString
+TQCString
DateFormatter::rfc2822FormatDate( time_t t )
{
DateFormatter f;