summaryrefslogtreecommitdiff
authorconber <conber>2002-06-15 10:25:10 (UTC)
committer conber <conber>2002-06-15 10:25:10 (UTC)
commit95af3cd6c1a68ddd9200d4f7e25baf5c560f071c (patch) (unidiff)
treec24008f1524e137b42d8762e2b73f353e17c9824
parent46a46dde707b08e1422757df00b1fb1941e49d4f (diff)
downloadopie-95af3cd6c1a68ddd9200d4f7e25baf5c560f071c.zip
opie-95af3cd6c1a68ddd9200d4f7e25baf5c560f071c.tar.gz
opie-95af3cd6c1a68ddd9200d4f7e25baf5c560f071c.tar.bz2
changed include error
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/mail2/libmail/miscfunctions.cpp3
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,57 +1,56 @@
1#include <qdatetime.h> 1#include <qdatetime.h>
2 2
3#include <stdlib.h> 3#include <stdlib.h>
4#include <stdio.h> 4#include <stdio.h>
5#include <time.h> 5#include <time.h>
6 6
7#include <openssl/md5.h>
8
9#include "miscfunctions.h" 7#include "miscfunctions.h"
8#include "md5.h"
10 9
11QString MiscFunctions::encodeQPrintable(const QString &src) 10QString MiscFunctions::encodeQPrintable(const QString &src)
12{ 11{
13 // TODO: implent encodeQPrintable 12 // TODO: implent encodeQPrintable
14 return src; 13 return src;
15} 14}
16 15
17QString MiscFunctions::decodeQPrintable(const QString &src) 16QString MiscFunctions::decodeQPrintable(const QString &src)
18{ 17{
19 QString out; 18 QString out;
20 19
21 for (unsigned int i = 0; i <= src.length(); i++) { 20 for (unsigned int i = 0; i <= src.length(); i++) {
22 if (src[i] == '=') { 21 if (src[i] == '=') {
23 if (src[i+1] == "\n") { 22 if (src[i+1] == "\n") {
24 i += 1; 23 i += 1;
25 } else { 24 } else {
26 QString temp = QString("%1%2").arg(src[i+1]).arg(src[i+2]); 25 QString temp = QString("%1%2").arg(src[i+1]).arg(src[i+2]);
27 int number = temp.toInt(0, 16); 26 int number = temp.toInt(0, 16);
28 27
29 out += QChar(number); 28 out += QChar(number);
30 i += 2; 29 i += 2;
31 } 30 }
32 } else { 31 } else {
33 out += src[i]; 32 out += src[i];
34 } 33 }
35 } 34 }
36 return out; 35 return out;
37} 36}
38 37
39QString MiscFunctions::encodeBase64(const QString &src) 38QString MiscFunctions::encodeBase64(const QString &src)
40{ 39{
41 char *dataPtr = (char *) src.latin1(); 40 char *dataPtr = (char *) src.latin1();
42 int len = src.length(); 41 int len = src.length();
43 int count = 0; 42 int count = 0;
44 QString temp = ""; 43 QString temp = "";
45 44
46 while (len > 0) { 45 while (len > 0) {
47 if (len < 3) { 46 if (len < 3) {
48 encodeBase64Base(dataPtr, &temp, len); 47 encodeBase64Base(dataPtr, &temp, len);
49 len = 0; 48 len = 0;
50 } else { 49 } else {
51 encodeBase64Base(dataPtr, &temp, 3); 50 encodeBase64Base(dataPtr, &temp, 3);
52 len -= 3; 51 len -= 3;
53 dataPtr += 3; 52 dataPtr += 3;
54 count += 4; 53 count += 4;
55 } 54 }
56 if (count > 72) { 55 if (count > 72) {
57 count = 0; 56 count = 0;