summaryrefslogtreecommitdiff
path: root/noncore/net/mail/libmailwrapper/generatemail.cpp
Unidiff
Diffstat (limited to 'noncore/net/mail/libmailwrapper/generatemail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/generatemail.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/noncore/net/mail/libmailwrapper/generatemail.cpp b/noncore/net/mail/libmailwrapper/generatemail.cpp
index cb58d82..36ec232 100644
--- a/noncore/net/mail/libmailwrapper/generatemail.cpp
+++ b/noncore/net/mail/libmailwrapper/generatemail.cpp
@@ -97,7 +97,7 @@ mailimf_address_list *Generatemail::parseAddresses(const QString&addr ) {
97 s = addr.mid(startpos,i-startpos); 97 s = addr.mid(startpos,i-startpos);
98 if (!s.isEmpty()) { 98 if (!s.isEmpty()) {
99 list.append(s); 99 list.append(s);
100 qDebug("Appended %s",s.latin1()); 100 odebug << "Appended " << s.latin1() << "" << oendl;
101 } 101 }
102 // !!!! this is a MUST BE! 102 // !!!! this is a MUST BE!
103 startpos = ++i; 103 startpos = ++i;
@@ -110,16 +110,16 @@ mailimf_address_list *Generatemail::parseAddresses(const QString&addr ) {
110 s = addr.mid(startpos,i-startpos); 110 s = addr.mid(startpos,i-startpos);
111 if (!s.isEmpty()) { 111 if (!s.isEmpty()) {
112 list.append(s); 112 list.append(s);
113 qDebug("Appended %s",s.latin1()); 113 odebug << "Appended " << s.latin1() << "" << oendl;
114 } 114 }
115 QStringList::Iterator it; 115 QStringList::Iterator it;
116 for ( it = list.begin(); it != list.end(); it++ ) { 116 for ( it = list.begin(); it != list.end(); it++ ) {
117 int err = mailimf_address_list_add_parse( addresses, (char*)(*it).latin1() ); 117 int err = mailimf_address_list_add_parse( addresses, (char*)(*it).latin1() );
118 if ( err != MAILIMF_NO_ERROR ) { 118 if ( err != MAILIMF_NO_ERROR ) {
119 qDebug( "Error parsing" ); 119 odebug << "Error parsing" << oendl;
120 qDebug( *it ); 120 odebug << *it << oendl;
121 } else { 121 } else {
122 qDebug( "Parse success! %s",(*it).latin1()); 122 odebug << "Parse success! " << (*it).latin1() << "" << oendl;
123 } 123 }
124 } 124 }
125 return addresses; 125 return addresses;
@@ -175,7 +175,7 @@ mailmime *Generatemail::buildFilePart(const QString&filename,const QString&mimet
175 err = mailmime_set_body_text(filePart,strdup(TextContent.data()),TextContent.length()); 175 err = mailmime_set_body_text(filePart,strdup(TextContent.data()),TextContent.length());
176 } 176 }
177 if (err != MAILIMF_NO_ERROR) { 177 if (err != MAILIMF_NO_ERROR) {
178 qDebug("Error setting body with file %s",file); 178 odebug << "Error setting body with file " << file << "" << oendl;
179 mailmime_free( filePart ); 179 mailmime_free( filePart );
180 filePart = 0; 180 filePart = 0;
181 } 181 }
@@ -206,23 +206,23 @@ mailmime *Generatemail::buildFilePart(const QString&filename,const QString&mimet
206void Generatemail::addFileParts( mailmime *message,const QList<Attachment>&files ) { 206void Generatemail::addFileParts( mailmime *message,const QList<Attachment>&files ) {
207 const Attachment *it; 207 const Attachment *it;
208 unsigned int count = files.count(); 208 unsigned int count = files.count();
209 qDebug("List contains %i values",count); 209 odebug << "List contains " << count << " values" << oendl;
210 for ( unsigned int i = 0; i < count; ++i ) { 210 for ( unsigned int i = 0; i < count; ++i ) {
211 qDebug( "Adding file" ); 211 odebug << "Adding file" << oendl;
212 mailmime *filePart; 212 mailmime *filePart;
213 int err; 213 int err;
214 it = ((QList<Attachment>)files).at(i); 214 it = ((QList<Attachment>)files).at(i);
215 215
216 filePart = buildFilePart( it->getFileName(), it->getMimeType(),"" ); 216 filePart = buildFilePart( it->getFileName(), it->getMimeType(),"" );
217 if ( filePart == NULL ) { 217 if ( filePart == NULL ) {
218 qDebug( "addFileParts: error adding file:" ); 218 odebug << "addFileParts: error adding file:" << oendl;
219 qDebug( it->getFileName() ); 219 odebug << it->getFileName() << oendl;
220 continue; 220 continue;
221 } 221 }
222 err = mailmime_smart_add_part( message, filePart ); 222 err = mailmime_smart_add_part( message, filePart );
223 if ( err != MAILIMF_NO_ERROR ) { 223 if ( err != MAILIMF_NO_ERROR ) {
224 mailmime_free( filePart ); 224 mailmime_free( filePart );
225 qDebug("error smart add"); 225 odebug << "error smart add" << oendl;
226 } 226 }
227 } 227 }
228} 228}
@@ -270,7 +270,7 @@ err_free_content:
270err_free_param: 270err_free_param:
271 mailmime_parameter_free( param ); 271 mailmime_parameter_free( param );
272err_free: 272err_free:
273 qDebug( "buildTxtPart - error" ); 273 odebug << "buildTxtPart - error" << oendl;
274 274
275 return NULL; // Error :( 275 return NULL; // Error :(
276} 276}
@@ -345,7 +345,7 @@ mailimf_fields *Generatemail::createImfFields(const Opie::Core::OSmartPointer<Ma
345 memset(c_reply,0,nsize+1); 345 memset(c_reply,0,nsize+1);
346 memcpy(c_reply,h.latin1(),nsize); 346 memcpy(c_reply,h.latin1(),nsize);
347 clist_append(in_reply_to,c_reply); 347 clist_append(in_reply_to,c_reply);
348 qDebug("In reply to: %s",c_reply); 348 odebug << "In reply to: " << c_reply << "" << oendl;
349 } 349 }
350 } 350 }
351 351
@@ -353,7 +353,7 @@ mailimf_fields *Generatemail::createImfFields(const Opie::Core::OSmartPointer<Ma
353 fields = mailimf_fields_new_with_data( from, sender, reply, to, cc, bcc, 353 fields = mailimf_fields_new_with_data( from, sender, reply, to, cc, bcc,
354 in_reply_to, NULL, subject ); 354 in_reply_to, NULL, subject );
355 if ( fields == NULL ) { 355 if ( fields == NULL ) {
356 qDebug("Error creating mailimf fields"); 356 odebug << "Error creating mailimf fields" << oendl;
357 res = 0; 357 res = 0;
358 } 358 }
359 } 359 }
@@ -435,7 +435,7 @@ err_free_message:
435err_free_fields: 435err_free_fields:
436 mailimf_fields_free( fields ); 436 mailimf_fields_free( fields );
437err_free: 437err_free:
438 qDebug( "createMimeMail: error" ); 438 odebug << "createMimeMail: error" << oendl;
439 439
440 return NULL; // Error :( 440 return NULL; // Error :(
441} 441}