-rw-r--r-- | noncore/unsupported/mail2/libmail/miscfunctions.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/noncore/unsupported/mail2/libmail/miscfunctions.cpp b/noncore/unsupported/mail2/libmail/miscfunctions.cpp index 0edbfa8..c81b101 100644 --- a/noncore/unsupported/mail2/libmail/miscfunctions.cpp +++ b/noncore/unsupported/mail2/libmail/miscfunctions.cpp @@ -1,73 +1,72 @@ #include <qdatetime.h> #include <stdlib.h> #include <stdio.h> #include <time.h> -#include <openssl/md5.h> - #include "miscfunctions.h" +#include "md5.h" QString MiscFunctions::encodeQPrintable(const QString &src) { // TODO: implent encodeQPrintable return src; } QString MiscFunctions::decodeQPrintable(const QString &src) { QString out; for (unsigned int i = 0; i <= src.length(); i++) { if (src[i] == '=') { if (src[i+1] == "\n") { i += 1; } else { QString temp = QString("%1%2").arg(src[i+1]).arg(src[i+2]); int number = temp.toInt(0, 16); out += QChar(number); i += 2; } } else { out += src[i]; } } return out; } QString MiscFunctions::encodeBase64(const QString &src) { char *dataPtr = (char *) src.latin1(); int len = src.length(); int count = 0; QString temp = ""; while (len > 0) { if (len < 3) { encodeBase64Base(dataPtr, &temp, len); len = 0; } else { encodeBase64Base(dataPtr, &temp, 3); len -= 3; dataPtr += 3; count += 4; } if (count > 72) { count = 0; temp += "\n"; } } return temp; } void MiscFunctions::encodeBase64Base(char *src, QString *dest, int len) { QString temp; uchar c; uchar bufOut[4]; bufOut[0] = src[0]; bufOut[0] >>= 2; |