summaryrefslogtreecommitdiff
authoralwin <alwin>2004-03-11 15:57:38 (UTC)
committer alwin <alwin>2004-03-11 15:57:38 (UTC)
commit8ef5f33241db5e717daf6732d4db881918b0a46b (patch) (unidiff)
tree928d52d17bf28fa60f1a891f4671599e5344892b
parent4a54ba05ce4ff36bf90264e239c531e879fa47c0 (diff)
downloadopie-8ef5f33241db5e717daf6732d4db881918b0a46b.zip
opie-8ef5f33241db5e717daf6732d4db881918b0a46b.tar.gz
opie-8ef5f33241db5e717daf6732d4db881918b0a46b.tar.bz2
workaround of a libetpan bug :(
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/abstractmail.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.cpp b/noncore/net/mail/libmailwrapper/abstractmail.cpp
index d71d35c..ac6f380 100644
--- a/noncore/net/mail/libmailwrapper/abstractmail.cpp
+++ b/noncore/net/mail/libmailwrapper/abstractmail.cpp
@@ -70,46 +70,46 @@ encodedString* AbstractMail::decode_String(const encodedString*text,const QStrin
70 70
71 int err = mailmime_part_parse(text->Content(),text->Length(),&index,mimetype, 71 int err = mailmime_part_parse(text->Content(),text->Length(),&index,mimetype,
72 &result_text,&target_length); 72 &result_text,&target_length);
73 73
74 encodedString* result = new encodedString(); 74 encodedString* result = new encodedString();
75 if (err == MAILIMF_NO_ERROR) { 75 if (err == MAILIMF_NO_ERROR) {
76 result->setContent(result_text,target_length); 76 result->setContent(result_text,target_length);
77 } 77 }
78 qDebug("Decode string finished"); 78 qDebug("Decode string finished");
79 return result; 79 return result;
80} 80}
81 81
82QString AbstractMail::convert_String(const char*text) 82QString AbstractMail::convert_String(const char*text)
83{ 83{
84 size_t index = 0; 84 size_t index = 0;
85 char*res = 0; 85 char*res = 0;
86 int err = MAILIMF_NO_ERROR;
86 87
87 /* attention - doesn't work with arm systems! */ 88 QString result(text);
88 int err = mailmime_encoded_phrase_parse("iso-8859-1", 89
89 text, strlen(text),&index, "iso-8859-1",&res); 90 /* due a bug in libetpan it isn't usable this moment */
90 if (err != MAILIMF_NO_ERROR) { 91/* int err = mailmime_encoded_phrase_parse("iso-8859-1",
91 if (res) free(res); 92 text, strlen(text),&index, "iso-8859-1",&res);*/
92 return QString(text); 93 //qDebug("Input: %s",text);
93 } 94 if (err == MAILIMF_NO_ERROR && res && strlen(res)) {
94 if (res) { 95// result = QString(res);
95 QString result(res); 96// qDebug("Res: %s, length: %i",res,strlen(res));
96 free(res);
97 return result;
98 } 97 }
99 return QString(text); 98 if (res) free(res);
99 return result;
100} 100}
101 101
102/* cp & paste from launcher */ 102/* cp & paste from launcher */
103QString AbstractMail::gen_attachment_id() 103QString AbstractMail::gen_attachment_id()
104{ 104{
105 QFile file( "/proc/sys/kernel/random/uuid" ); 105 QFile file( "/proc/sys/kernel/random/uuid" );
106 if (!file.open(IO_ReadOnly ) ) 106 if (!file.open(IO_ReadOnly ) )
107 return QString::null; 107 return QString::null;
108 108
109 QTextStream stream(&file); 109 QTextStream stream(&file);
110 110
111 return "{" + stream.read().stripWhiteSpace() + "}"; 111 return "{" + stream.read().stripWhiteSpace() + "}";
112} 112}
113 113
114int AbstractMail::createMbox(const QString&,const Folder*,const QString& delemiter,bool) 114int AbstractMail::createMbox(const QString&,const Folder*,const QString& delemiter,bool)
115{ 115{