-rw-r--r-- | kmicromail/libetpan/mime/mailmime_decode.c | 3 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/generatemail.cpp | 13 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/imapwrapper.cpp | 7 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/settings.cpp | 3 | ||||
-rw-r--r-- | kmicromail/opiemail.cpp | 11 | ||||
-rw-r--r-- | libkdepim/kprefswidget.cpp | 1 |
6 files changed, 25 insertions, 13 deletions
diff --git a/kmicromail/libetpan/mime/mailmime_decode.c b/kmicromail/libetpan/mime/mailmime_decode.c index e48ec19..dbaeb68 100644 --- a/kmicromail/libetpan/mime/mailmime_decode.c +++ b/kmicromail/libetpan/mime/mailmime_decode.c @@ -203,13 +203,14 @@ int mailmime_encoded_phrase_parse(const char * default_fromcode, if (mmap_string_append(gphrase, wordutf8) == NULL) { free(wordutf8); free(raw_word); res = MAILIMF_ERROR_MEMORY; goto free; } - + // LUTZ fix + free(wordutf8); free(raw_word); first = FALSE; } else if (r == MAILIMF_ERROR_PARSE) { break; } 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 @@ -6,13 +6,13 @@ //#include <qt.h> #include <stdlib.h> #include <qfileinfo.h> using namespace Opie::Core; -const char* Generatemail::USER_AGENT="OpieMail v0.6"; +const char* Generatemail::USER_AGENT="KOpieMail 33 1/3"; Generatemail::Generatemail() { } Generatemail::~Generatemail() @@ -129,13 +129,12 @@ mailmime *Generatemail::buildFilePart(const QString&filename,const QString&mimet mailmime_fields * fields = 0; mailmime_content * content = 0; mailmime_parameter * param = 0; char*name = 0; char*file = 0; int err; - int pos = filename.findRev( '/' ); if (filename.length()>0) { QString tmp = filename.right( filename.length() - ( pos + 1 ) ); name = strdup( tmp.latin1() ); // just filename file = strdup( filename.latin1() ); // full name with path @@ -168,13 +167,13 @@ mailmime *Generatemail::buildFilePart(const QString&filename,const QString&mimet filePart = mailmime_new_empty( content, fields ); } if (filePart) { 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 "); mailmime_free( filePart ); filePart = 0; } @@ -224,13 +223,13 @@ void Generatemail::addFileParts( mailmime *message,const QList<Attachment>&files mailmime *Generatemail::buildTxtPart(const QString&str ) { mailmime *txtPart; mailmime_fields *fields; mailmime_content *content; mailmime_parameter *param; int err; - + QCString __str; param = mailmime_parameter_new( strdup( "charset" ), strdup( "iso-8859-1" ) ); if ( param == NULL ) goto err_free; content = mailmime_content_new_with_str( "text/plain" ); @@ -245,14 +244,16 @@ mailmime *Generatemail::buildTxtPart(const QString&str ) { if ( fields == NULL ) goto err_free_content; 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; return txtPart; // Success :) 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 @@ -72,13 +72,13 @@ void IMAPwrapper::progress( QString m ) //qDebug("Progress %s %s", mess.latin1(), m.latin1()); qApp->processEvents(); } 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); if (err != MAILIMAP_NO_ERROR) { Global::statusMessage("error getting capabilities!"); return false; @@ -475,14 +475,14 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_ENVELOPE) { mailimap_envelope * head = item->att_data.att_static->att_data.att_env; if ( head == NULL ) 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; if ( mailimf_date_time_parse(head->env_date, length,&index, re ) == MAILIMF_NO_ERROR ) { QDateTime dt = Genericwrapper::parseDateTime( date ); QString ret; @@ -494,12 +494,13 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) m->setDate( ret ); char tmp[20]; snprintf( tmp, 20, "%04i-%02i-%02i %02i:%02i:%02i", 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); } } if ( head->env_subject != NULL ) m->setSubject(convert_String((const char*)head->env_subject)); 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 @@ -17,13 +17,14 @@ #define NNTP_PORT "119" #define NNTP_SSL_PORT "563" Settings::Settings() : QObject() -{ +{ + accounts.setAutoDelete( true ); ; updateAccounts(); //qDebug("++++++++++++++++++new settings "); } void Settings::checkDirectory() { diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index 8d16ae7..af5376f 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp @@ -20,12 +20,13 @@ #include "klocale.h" #include <qmessagebox.h> #include <qtimer.h> #include <qcursor.h> #include <qregexp.h> +#include <qpe/global.h> #ifdef DESKTOP_VERSION #include <qapplication.h> #else #include <qpe/qpeapplication.h> #endif @@ -186,12 +187,14 @@ void OpieMail::slotSendQueued() } if (smtpList.count()==0) { QMessageBox::information(0,i18n("Info"),i18n("Define a smtp account first!\n")); return; } + if ( QMessageBox::warning(this, i18n("Sending all mails"), i18n("Do you really want to send\nall queued mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No ) + return; if (smtpList.count()==1) { smtp = smtpList.at(0); } else { @@ -205,19 +208,22 @@ void OpieMail::slotSendQueued() { smtp = selsmtp.selected_smtp(); } } if (smtp) { + + Global::statusMessage("Sending mails...!"); SMTPwrapper * wrap = new SMTPwrapper(smtp); if ( wrap->flushOutbox() ) { - QMessageBox::information(0,i18n("Info"),i18n("Mail queue flushed")); - } + Global::statusMessage("Mails sent!"); + } delete wrap; } + // pending refresh list view, if outgoing is displayed } void OpieMail::slotSearchMails() { qDebug("OpieMail::slotSearchMails():not implemented "); } @@ -427,12 +433,13 @@ void OpieMail::refreshMailView(const QValueList<RecMailP>&list) for (it = list.begin(); it != list.end();++it) { item = new MailListViewItem(mailView,item); item->storeData((*it)); item->showEntry(); } + mailView->setSorting ( 4, false ); } void OpieMail::mailLeftClicked( QListViewItem *item ) { mailView->clearSelection(); /* just LEFT button - or tap with stylus on pda */ diff --git a/libkdepim/kprefswidget.cpp b/libkdepim/kprefswidget.cpp index be9ad30..f6a0b38 100644 --- a/libkdepim/kprefswidget.cpp +++ b/libkdepim/kprefswidget.cpp @@ -285,12 +285,13 @@ QLineEdit *KPrefsWidString::lineEdit() KPrefsWidget::KPrefsWidget(KPrefs *prefs,QWidget *parent,const char *name) : QWidget(parent, name ) { mPrefs = prefs; + mPrefsWids.setAutoDelete( true ); } KPrefsWidget::~KPrefsWidget() { } |