From 3320af5e47cdb4b54c4185c91d0332c013d90818 Mon Sep 17 00:00:00 2001 From: zautrix Date: Mon, 01 Nov 2004 14:15:56 +0000 Subject: ompi fixes --- (limited to 'kmicromail/libmailwrapper') diff --git a/kmicromail/libmailwrapper/generatemail.cpp b/kmicromail/libmailwrapper/generatemail.cpp index 49315ba..32311d7 100644 --- a/kmicromail/libmailwrapper/generatemail.cpp +++ b/kmicromail/libmailwrapper/generatemail.cpp @@ -9,7 +9,7 @@ #include using namespace Opie::Core; -const char* Generatemail::USER_AGENT="OpieMail v0.6"; +const char* Generatemail::USER_AGENT="KOpieMail 33 1/3"; Generatemail::Generatemail() { @@ -132,7 +132,6 @@ mailmime *Generatemail::buildFilePart(const QString&filename,const QString&mimet char*name = 0; char*file = 0; int err; - int pos = filename.findRev( '/' ); if (filename.length()>0) { @@ -171,7 +170,7 @@ mailmime *Generatemail::buildFilePart(const QString&filename,const QString&mimet if (filename.length()>0) { err = mailmime_set_body_file( filePart, file ); } else { - err = mailmime_set_body_text(filePart,strdup(TextContent.data()),TextContent.length()); + err = mailmime_set_body_text(filePart,strdup( TextContent.utf8()),TextContent.utf8().length()); } if (err != MAILIMF_NO_ERROR) { qDebug("Error setting body with file "); @@ -227,7 +226,7 @@ mailmime *Generatemail::buildTxtPart(const QString&str ) { mailmime_content *content; mailmime_parameter *param; int err; - + QCString __str; param = mailmime_parameter_new( strdup( "charset" ), strdup( "iso-8859-1" ) ); if ( param == NULL ) @@ -248,8 +247,10 @@ mailmime *Generatemail::buildTxtPart(const QString&str ) { txtPart = mailmime_new_empty( content, fields ); if ( txtPart == NULL ) goto err_free_fields; - - err = mailmime_set_body_text( txtPart, (char*)str.data(), str.length() ); + { + __str = str.utf8(); + err = mailmime_set_body_text( txtPart, __str.data(), __str.length() ); + } if ( err != MAILIMF_NO_ERROR ) goto err_free_txtPart; diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp index ae667ec..d90a8d2 100644 --- a/kmicromail/libmailwrapper/imapwrapper.cpp +++ b/kmicromail/libmailwrapper/imapwrapper.cpp @@ -75,7 +75,7 @@ void IMAPwrapper::progress( QString m ) bool IMAPwrapper::start_tls(bool force_tls) { int err; - bool try_tls; + bool try_tls = force_tls; mailimap_capability_data * cap_data = 0; err = mailimap_capability(m_imap,&cap_data); @@ -478,8 +478,8 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) continue; if ( head->env_date != NULL ) { m->setDate(head->env_date); - struct mailimf_date_time result; - struct mailimf_date_time* date = &result; + //struct mailimf_date_time result; + struct mailimf_date_time* date;// = &result; struct mailimf_date_time **re = &date; size_t length = m->getDate().length(); size_t index = 0; @@ -497,6 +497,7 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) dt.date().year(),dt.date().month(), dt.date().day(), dt.time().hour(), dt.time().minute(), dt.time().second() ); //qDebug("%d iso %s %s ", date->dt_zone, tmp, head->env_date); m->setIsoDate( QString( tmp ) ); + mailimf_date_time_free ( date ); } else { m->setIsoDate(head->env_date); } diff --git a/kmicromail/libmailwrapper/settings.cpp b/kmicromail/libmailwrapper/settings.cpp index 5d2c0ad..04afe7c 100644 --- a/kmicromail/libmailwrapper/settings.cpp +++ b/kmicromail/libmailwrapper/settings.cpp @@ -20,7 +20,8 @@ Settings::Settings() : QObject() -{ +{ + accounts.setAutoDelete( true ); ; updateAccounts(); //qDebug("++++++++++++++++++new settings "); } -- cgit v0.9.0.2