summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-10-31 12:28:03 (UTC)
committer zautrix <zautrix>2004-10-31 12:28:03 (UTC)
commitbed831cc1a38d38a4c5b9329bf37b1c663142c23 (patch) (side-by-side diff)
treedb12b81ea6cee0cac347c801798d759dfe24acfb
parent553bd9acf9879a77c5fa925155f73afbe8a9af41 (diff)
downloadkdepimpi-bed831cc1a38d38a4c5b9329bf37b1c663142c23.zip
kdepimpi-bed831cc1a38d38a4c5b9329bf37b1c663142c23.tar.gz
kdepimpi-bed831cc1a38d38a4c5b9329bf37b1c663142c23.tar.bz2
ompi utf8 fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kdepim-desktop.pro6
-rw-r--r--kmicromail/composemail.cpp52
-rw-r--r--kmicromail/libmailwrapper/imapwrapper.cpp1
-rw-r--r--kmicromail/libmailwrapper/settings.cpp1
-rw-r--r--kmicromail/libmailwrapper/settings.h1
-rw-r--r--kmicromail/mailistviewitem.cpp4
-rw-r--r--kmicromail/mainwindow.cpp6
-rw-r--r--kmicromail/opiemail.cpp46
-rw-r--r--kmicromail/opiemail.h1
-rw-r--r--kmicromail/qpe/global.cpp6
-rw-r--r--kmicromail/qpe/qdialog.h4
-rw-r--r--kmicromail/qpe/qdialog_hacked.cpp6
-rw-r--r--kmicromail/viewmail.cpp35
13 files changed, 107 insertions, 62 deletions
diff --git a/kdepim-desktop.pro b/kdepim-desktop.pro
index 6d04a45..b0d60b7 100644
--- a/kdepim-desktop.pro
+++ b/kdepim-desktop.pro
@@ -3,4 +3,6 @@
TEMPLATE = subdirs
-SUBDIRS = libical libkcal kabc libkdepim microkde kmicromail/libetpan kmicromail/libmailwrapper kmicromail korganizer kaddressbook kabc/plugins/file kabc/plugins/dir kabc/plugins/file kabc/plugins/qtopia gammu/emb/common gammu/emb/gammu pwmanager/libcrypt/cipher pwmanager/libcrypt/error pwmanager/libcrypt/mpi pwmanager/libcrypt/zlib pwmanager/pwmanager
-#kalarmd
+SUBDIRS = libical libkcal kabc libkdepim microkde korganizer kaddressbook kabc/plugins/file kabc/plugins/dir kabc/plugins/file kabc/plugins/qtopia gammu/emb/common gammu/emb/gammu
+unix:{
+SUBDIRS += kmicromail/libetpan kmicromail/libmailwrapper kmicromail pwmanager/libcrypt/cipher pwmanager/libcrypt/error pwmanager/libcrypt/mpi pwmanager/libcrypt/zlib pwmanager/pwmanager
+}
diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp
index 5945b7f..2dcbc75 100644
--- a/kmicromail/composemail.cpp
+++ b/kmicromail/composemail.cpp
@@ -47,3 +47,3 @@
//using namespace Opie::Ui;
-ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal )
+ComposeMail::ComposeMail( Settings *sett, QWidget *parent, const char *name, bool modal )
: ComposeMailUI( parent, name, modal )
@@ -53,3 +53,3 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m
this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&)));
- settings = s;
+ settings = sett;
m_replyid = "";
@@ -167,9 +167,9 @@ void ComposeMail::saveAsDraft()
Opie::Core::OSmartPointer<Mail> mail= new Mail();
- mail->setMail(fromBox->currentText());
- mail->setTo( toLine->text() );
- mail->setName(senderNameEdit->text());
- mail->setCC( ccLine->text() );
- mail->setBCC( bccLine->text() );
- mail->setReply( replyLine->text() );
- mail->setSubject( subjectLine->text() );
+ mail->setMail(fromBox->currentText().utf8 ());
+ mail->setTo( toLine->text().utf8 () );
+ mail->setName(senderNameEdit->text().utf8 ());
+ mail->setCC( ccLine->text().utf8 () );
+ mail->setBCC( bccLine->text().utf8 () );
+ mail->setReply( replyLine->text().utf8 () );
+ mail->setSubject( subjectLine->text().utf8 () );
if (!m_replyid.isEmpty()) {
@@ -179,3 +179,3 @@ void ComposeMail::saveAsDraft()
}
- QString txt = message->text();
+ QString txt = message->text().utf8 ();
if ( !sigMultiLine->text().isEmpty() ) {
@@ -410,6 +410,6 @@ void ComposeMail::accept()
SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() );
- mail->setMail(fromBox->currentText());
+ mail->setMail(fromBox->currentText().utf8 ());
if ( !toLine->text().isEmpty() ) {
- mail->setTo( toLine->text() );
+ mail->setTo( toLine->text().utf8 () );
} else {
@@ -420,16 +420,16 @@ void ComposeMail::accept()
- mail->setName(senderNameEdit->text());
- mail->setCC( ccLine->text() );
- mail->setBCC( bccLine->text() );
- mail->setReply( replyLine->text() );
- mail->setSubject( subjectLine->text() );
+ mail->setName(senderNameEdit->text().utf8 ());
+ mail->setCC( ccLine->text().utf8 () );
+ mail->setBCC( bccLine->text().utf8 () );
+ mail->setReply( replyLine->text().utf8 () );
+ mail->setSubject( subjectLine->text().utf8 () );
if (!m_replyid.isEmpty()) {
QStringList ids;
- ids.append(m_replyid);
+ ids.append(m_replyid.utf8 ());
mail->setInreply(ids);
}
- QString txt = message->text();
+ QString txt = message->text().utf8 ();
if ( !sigMultiLine->text().isEmpty() ) {
txt.append( "\n--\n" );
- txt.append( sigMultiLine->text() );
+ txt.append( sigMultiLine->text().utf8 () );
}
@@ -485,8 +485,8 @@ void ComposeMail::reEditMail(const RecMailP&current)
RecMailP data = current;
- message->setText(data->Wrapper()->fetchBody(current)->Bodytext());
- subjectLine->setText( data->getSubject());
- toLine->setText(data->To().join(","));
- ccLine->setText(data->CC().join(","));
- bccLine->setText(data->Bcc().join(","));
- replyLine->setText(data->Replyto());
+ message->setText(QString::fromUtf8( data->Wrapper()->fetchBody(current)->Bodytext().latin1() ));
+ subjectLine->setText( QString::fromUtf8( data->getSubject().latin1() ));
+ toLine->setText(QString::fromUtf8( data->To().join(",").latin1() ));
+ ccLine->setText(QString::fromUtf8( data->CC().join(",").latin1() ));
+ bccLine->setText(QString::fromUtf8( data->Bcc().join(",").latin1() ));
+ replyLine->setText(QString::fromUtf8( data->Replyto().latin1() ));
}
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp
index 110583f..ae667ec 100644
--- a/kmicromail/libmailwrapper/imapwrapper.cpp
+++ b/kmicromail/libmailwrapper/imapwrapper.cpp
@@ -753,2 +753,3 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&t
QString body_text = fetchTextPart(mail,countlist,true,currentPart->Encoding());
+ //qDebug("encoding %d text %s ",currentPart->Encoding().latin1(), body_text.latin1() );
target_body->setDescription(currentPart);
diff --git a/kmicromail/libmailwrapper/settings.cpp b/kmicromail/libmailwrapper/settings.cpp
index 40b5591..5d2c0ad 100644
--- a/kmicromail/libmailwrapper/settings.cpp
+++ b/kmicromail/libmailwrapper/settings.cpp
@@ -24,2 +24,3 @@ Settings::Settings()
updateAccounts();
+ //qDebug("++++++++++++++++++new settings ");
}
diff --git a/kmicromail/libmailwrapper/settings.h b/kmicromail/libmailwrapper/settings.h
index 79567ef..c996fe0 100644
--- a/kmicromail/libmailwrapper/settings.h
+++ b/kmicromail/libmailwrapper/settings.h
@@ -167,2 +167,3 @@ public:
Settings();
+ //~Settings(){qDebug("-------------------settings "); };
QList<Account> getAccounts();
diff --git a/kmicromail/mailistviewitem.cpp b/kmicromail/mailistviewitem.cpp
index 484a635..5ef5b6a 100644
--- a/kmicromail/mailistviewitem.cpp
+++ b/kmicromail/mailistviewitem.cpp
@@ -57,4 +57,4 @@ void MailListViewItem::showEntry()
}
- setText(1,mail_data->getSubject());
- setText(2,mail_data->getFrom());
+ setText(1,QString::fromUtf8( mail_data->getSubject().latin1()));
+ setText(2,QString::fromUtf8( mail_data->getFrom().latin1()));
#if 0
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp
index 4115276..98eb9a5 100644
--- a/kmicromail/mainwindow.cpp
+++ b/kmicromail/mainwindow.cpp
@@ -13,2 +13,4 @@
#include <qapplication.h>
+#include <qstatusbar.h>
+extern QStatusBar* globalSstatusBarMainWindow;
#else
@@ -20,3 +22,2 @@
-
#include <kabc/stdaddressbook.h>
@@ -26,2 +27,5 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
{
+#ifdef DESKTOP_VERSION
+ globalSstatusBarMainWindow = statusBar();
+#endif
setCaption( i18n( "KOpieMail/Pi" ) );
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp
index ca3faaf..fe9df87 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -42,2 +42,3 @@ OpieMail::OpieMail( QWidget *parent, const char *name )
+ setIcon(SmallIcon( "kmicromail" ) );
folderView->populate( settings->getAccounts() );
@@ -242,3 +243,46 @@ void OpieMail::slotEditAccounts()
}
+void OpieMail::replyMail()
+{
+
+ QListViewItem*item = mailView->currentItem();
+ if (!item) return;
+ RecMailP mail = ((MailListViewItem*)item)->data();
+ RecBodyP body = folderView->fetchBody(mail);
+
+ QString rtext;
+ rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose
+ .arg( QString::fromUtf8( mail->getFrom().latin1()))
+ .arg( QString::fromUtf8( mail->getDate().latin1() ));
+
+ QString text = QString::fromUtf8( body->Bodytext().latin1() );
+ QStringList lines = QStringList::split(QRegExp("\\n"), text);
+ QStringList::Iterator it;
+ for (it = lines.begin(); it != lines.end(); it++)
+ {
+ rtext += "> " + *it + "\n";
+ }
+ rtext += "\n";
+ QString prefix;
+ if ( mail->getSubject().find(QRegExp("^Re: .*$")) != -1) prefix = "";
+ else prefix = "Re: "; // no i18n on purpose
+
+ Settings *settings = new Settings();
+ ComposeMail composer( settings ,this, 0, true);
+ if (mail->Replyto().isEmpty()) {
+ composer.setTo( QString::fromUtf8( mail->getFrom().latin1()));
+ } else {
+ composer.setTo( QString::fromUtf8(mail->Replyto().latin1()));
+ }
+ composer.setSubject( prefix + QString::fromUtf8( mail->getSubject().latin1() ) );
+ composer.setMessage( rtext );
+ composer.setInReplyTo( QString::fromUtf8(mail->Msgid().latin1()));
+
+ if ( QDialog::Accepted == KApplication::execDialog( &composer ) )
+ {
+ mail->Wrapper()->answeredMail(mail);
+ }
+ delete settings;
+
+}
void OpieMail::displayMail()
@@ -342,2 +386,4 @@ void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int )
}
+ m->insertItem(i18n("Reply to this mail"),this,SLOT(replyMail()));
+ m->insertSeparator();
m->insertItem(i18n("Read this mail"),this,SLOT(displayMail()));
diff --git a/kmicromail/opiemail.h b/kmicromail/opiemail.h
index 9de95f8..44ab1ec 100644
--- a/kmicromail/opiemail.h
+++ b/kmicromail/opiemail.h
@@ -32,2 +32,3 @@ protected slots:
virtual void displayMail();
+ virtual void replyMail();
virtual void slotDeleteMail();
diff --git a/kmicromail/qpe/global.cpp b/kmicromail/qpe/global.cpp
index f4c6f60..8314f23 100644
--- a/kmicromail/qpe/global.cpp
+++ b/kmicromail/qpe/global.cpp
@@ -2,3 +2,4 @@
#include "global.h"
-
+#include <qstatusbar.h>
+QStatusBar* globalSstatusBarMainWindow = 0;
namespace Global{
@@ -7,3 +8,4 @@ namespace Global{
{
-
+ if ( globalSstatusBarMainWindow )
+ globalSstatusBarMainWindow->message( message,15000 );
qDebug("statusMessage %s ", message.latin1());
diff --git a/kmicromail/qpe/qdialog.h b/kmicromail/qpe/qdialog.h
index aafdf80..c63133d 100644
--- a/kmicromail/qpe/qdialog.h
+++ b/kmicromail/qpe/qdialog.h
@@ -25,6 +25,2 @@ class QDialog_hacked : public QDialog
#else
-#warning ******************************************
-#warning ******************************************
-#warning ******************************************
-#warning ******************************************
#warning "/usr/local/qt/include/qdialog.h" for KDialog
diff --git a/kmicromail/qpe/qdialog_hacked.cpp b/kmicromail/qpe/qdialog_hacked.cpp
index 3669312..0a34cec 100644
--- a/kmicromail/qpe/qdialog_hacked.cpp
+++ b/kmicromail/qpe/qdialog_hacked.cpp
@@ -11,7 +11,3 @@
{
- qDebug("******************** ");
- qDebug("******************** ");
- qDebug("******************** ");
- qDebug("******************** ");
- qDebug("New hacked QDialog for ompi ");
+ qDebug("New hacked QDialog for ompi desktop");
//QTimer::singleShot( 1, this,SLOT(addaddbuttons()) );
diff --git a/kmicromail/viewmail.cpp b/kmicromail/viewmail.cpp
index f1e0225..2093678 100644
--- a/kmicromail/viewmail.cpp
+++ b/kmicromail/viewmail.cpp
@@ -100,3 +100,4 @@ void ViewMail::setBody(const RecBodyP&body )
m_body = body;
- m_mail[2] = body->Bodytext();
+ m_mail[2] = QString::fromUtf8( body->Bodytext().latin1() );
+ // qDebug("********text %s ",m_mail[2].latin1() );
attachbutton->setEnabled(body->Parts().count()>0);
@@ -302,6 +303,6 @@ void ViewMail::setMail(const RecMailP&mail )
- m_mail[0] = mail->getFrom();
- m_mail[1] = mail->getSubject();
- m_mail[3] = mail->getDate();
- m_mail[4] = mail->Msgid();
+ m_mail[0] = QString::fromUtf8( mail->getFrom().latin1() );
+ m_mail[1] = QString::fromUtf8( mail->getSubject().latin1() );
+ m_mail[3] = QString::fromUtf8( mail->getDate().latin1() );
+ m_mail[4] = QString::fromUtf8( mail->Msgid().latin1() );
@@ -350,14 +351,7 @@ void ViewMail::setText()
- for ( QStringList::Iterator it = ( m_mail2[0] ).begin(); it != ( m_mail2[0] ).end(); ++it )
- {
- toString += (*it);
- }
- for ( QStringList::Iterator it = ( m_mail2[1] ).begin(); it != ( m_mail2[1] ).end(); ++it )
- {
- ccString += (*it);
- }
- for ( QStringList::Iterator it = ( m_mail2[2] ).begin(); it != ( m_mail2[2] ).end(); ++it )
- {
- bccString += (*it);
- }
+
+ toString = QString::fromUtf8(m_mail2[0].join(",").latin1());
+ ccString = QString::fromUtf8(m_mail2[1].join(",").latin1());
+ bccString = QString::fromUtf8(m_mail2[2].join(",").latin1());
+
@@ -458,5 +452,5 @@ void ViewMail::slotReply()
if (m_recMail->Replyto().isEmpty()) {
- composer.setTo( m_recMail->getFrom());
+ composer.setTo( QString::fromUtf8( m_recMail->getFrom().latin1()));
} else {
- composer.setTo( m_recMail->Replyto());
+ composer.setTo( QString::fromUtf8( m_recMail->Replyto().latin1()));
}
@@ -470,4 +464,5 @@ void ViewMail::slotReply()
}
+ delete settings;
}
-
+
void ViewMail::slotForward()