summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper/mailwrapper.cpp
Side-by-side diff
Diffstat (limited to 'kmicromail/libmailwrapper/mailwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/mailwrapper.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/kmicromail/libmailwrapper/mailwrapper.cpp b/kmicromail/libmailwrapper/mailwrapper.cpp
index 2ee1ab3..9c299e8 100644
--- a/kmicromail/libmailwrapper/mailwrapper.cpp
+++ b/kmicromail/libmailwrapper/mailwrapper.cpp
@@ -2,12 +2,14 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <qdir.h>
+//Added by qt3to4:
+#include <Q3CString>
#include "mailwrapper.h"
//#include "logindialog.h"
//#include "defines.h"
#define UNDEFINED 64
@@ -78,37 +80,37 @@ static unsigned char base64chars[] =
QString IMAPFolder::decodeFolderName( const QString &name )
{
unsigned char c, i, bitcount;
unsigned long ucs4, utf16, bitbuf;
unsigned char base64[256], utf8[6];
unsigned long srcPtr = 0;
- QCString dst = "";
- QCString src = name.ascii();
+ Q3CString dst = "";
+ Q3CString src = name.ascii();
/* initialize modified base64 decoding table */
memset(base64, UNDEFINED, sizeof(base64));
for (i = 0; i < sizeof(base64chars); ++i) {
base64[(int)base64chars[i]] = i;
}
/* loop until end of string */
while (srcPtr < src.length ()) {
- c = src[srcPtr++];
+ c = src.at(srcPtr++);
/* deal with literal characters and &- */
- if (c != '&' || src[srcPtr] == '-') {
+ if (c != '&' || src.at(srcPtr) == '-') {
/* encode literally */
dst += c;
/* skip over the '-' if this is an &- sequence */
if (c == '&')
srcPtr++;
} else {
/* convert modified UTF-7 -> UTF-16 -> UCS-4 -> UTF-8 -> HEX */
bitbuf = 0;
bitcount = 0;
ucs4 = 0;
- while ((c = base64[(unsigned char) src[srcPtr]]) != UNDEFINED) {
+ while ((c = base64[(unsigned char) src.at(srcPtr)]) != UNDEFINED) {
++srcPtr;
bitbuf = (bitbuf << 6) | c;
bitcount += 6;
/* enough bits for a UTF-16 character? */
if (bitcount >= 16) {
bitcount -= 16;
@@ -146,13 +148,13 @@ QString IMAPFolder::decodeFolderName( const QString &name )
for (c = 0; c < i; ++c) {
dst += utf8[c];
}
}
}
/* skip over trailing '-' in modified UTF-7 encoding */
- if (src[srcPtr] == '-')
+ if (src.at(srcPtr) == '-')
++srcPtr;
}
}
return QString::fromUtf8( dst.data() );
}