summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-10-31 12:28:03 (UTC)
committer zautrix <zautrix>2004-10-31 12:28:03 (UTC)
commitbed831cc1a38d38a4c5b9329bf37b1c663142c23 (patch) (unidiff)
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 @@
3TEMPLATE = subdirs 3TEMPLATE = subdirs
4SUBDIRS = 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 4SUBDIRS = 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
5#kalarmd 5unix:{
6SUBDIRS += kmicromail/libetpan kmicromail/libmailwrapper kmicromail pwmanager/libcrypt/cipher pwmanager/libcrypt/error pwmanager/libcrypt/mpi pwmanager/libcrypt/zlib pwmanager/pwmanager
7}
6 8
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 @@
47//using namespace Opie::Ui; 47//using namespace Opie::Ui;
48ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal ) 48ComposeMail::ComposeMail( Settings *sett, QWidget *parent, const char *name, bool modal )
49 : ComposeMailUI( parent, name, modal ) 49 : ComposeMailUI( parent, name, modal )
@@ -53,3 +53,3 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m
53 this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); 53 this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&)));
54 settings = s; 54 settings = sett;
55 m_replyid = ""; 55 m_replyid = "";
@@ -167,9 +167,9 @@ void ComposeMail::saveAsDraft()
167 Opie::Core::OSmartPointer<Mail> mail= new Mail(); 167 Opie::Core::OSmartPointer<Mail> mail= new Mail();
168 mail->setMail(fromBox->currentText()); 168 mail->setMail(fromBox->currentText().utf8 ());
169 mail->setTo( toLine->text() ); 169 mail->setTo( toLine->text().utf8 () );
170 mail->setName(senderNameEdit->text()); 170 mail->setName(senderNameEdit->text().utf8 ());
171 mail->setCC( ccLine->text() ); 171 mail->setCC( ccLine->text().utf8 () );
172 mail->setBCC( bccLine->text() ); 172 mail->setBCC( bccLine->text().utf8 () );
173 mail->setReply( replyLine->text() ); 173 mail->setReply( replyLine->text().utf8 () );
174 mail->setSubject( subjectLine->text() ); 174 mail->setSubject( subjectLine->text().utf8 () );
175 if (!m_replyid.isEmpty()) { 175 if (!m_replyid.isEmpty()) {
@@ -179,3 +179,3 @@ void ComposeMail::saveAsDraft()
179 } 179 }
180 QString txt = message->text(); 180 QString txt = message->text().utf8 ();
181 if ( !sigMultiLine->text().isEmpty() ) { 181 if ( !sigMultiLine->text().isEmpty() ) {
@@ -410,6 +410,6 @@ void ComposeMail::accept()
410 SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() ); 410 SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() );
411 mail->setMail(fromBox->currentText()); 411 mail->setMail(fromBox->currentText().utf8 ());
412 412
413 if ( !toLine->text().isEmpty() ) { 413 if ( !toLine->text().isEmpty() ) {
414 mail->setTo( toLine->text() ); 414 mail->setTo( toLine->text().utf8 () );
415 } else { 415 } else {
@@ -420,16 +420,16 @@ void ComposeMail::accept()
420 420
421 mail->setName(senderNameEdit->text()); 421 mail->setName(senderNameEdit->text().utf8 ());
422 mail->setCC( ccLine->text() ); 422 mail->setCC( ccLine->text().utf8 () );
423 mail->setBCC( bccLine->text() ); 423 mail->setBCC( bccLine->text().utf8 () );
424 mail->setReply( replyLine->text() ); 424 mail->setReply( replyLine->text().utf8 () );
425 mail->setSubject( subjectLine->text() ); 425 mail->setSubject( subjectLine->text().utf8 () );
426 if (!m_replyid.isEmpty()) { 426 if (!m_replyid.isEmpty()) {
427 QStringList ids; 427 QStringList ids;
428 ids.append(m_replyid); 428 ids.append(m_replyid.utf8 ());
429 mail->setInreply(ids); 429 mail->setInreply(ids);
430 } 430 }
431 QString txt = message->text(); 431 QString txt = message->text().utf8 ();
432 if ( !sigMultiLine->text().isEmpty() ) { 432 if ( !sigMultiLine->text().isEmpty() ) {
433 txt.append( "\n--\n" ); 433 txt.append( "\n--\n" );
434 txt.append( sigMultiLine->text() ); 434 txt.append( sigMultiLine->text().utf8 () );
435 } 435 }
@@ -485,8 +485,8 @@ void ComposeMail::reEditMail(const RecMailP&current)
485 RecMailP data = current; 485 RecMailP data = current;
486 message->setText(data->Wrapper()->fetchBody(current)->Bodytext()); 486 message->setText(QString::fromUtf8( data->Wrapper()->fetchBody(current)->Bodytext().latin1() ));
487 subjectLine->setText( data->getSubject()); 487 subjectLine->setText( QString::fromUtf8( data->getSubject().latin1() ));
488 toLine->setText(data->To().join(",")); 488 toLine->setText(QString::fromUtf8( data->To().join(",").latin1() ));
489 ccLine->setText(data->CC().join(",")); 489 ccLine->setText(QString::fromUtf8( data->CC().join(",").latin1() ));
490 bccLine->setText(data->Bcc().join(",")); 490 bccLine->setText(QString::fromUtf8( data->Bcc().join(",").latin1() ));
491 replyLine->setText(data->Replyto()); 491 replyLine->setText(QString::fromUtf8( data->Replyto().latin1() ));
492} 492}
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
753 QString body_text = fetchTextPart(mail,countlist,true,currentPart->Encoding()); 753 QString body_text = fetchTextPart(mail,countlist,true,currentPart->Encoding());
754 //qDebug("encoding %d text %s ",currentPart->Encoding().latin1(), body_text.latin1() );
754 target_body->setDescription(currentPart); 755 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()
24 updateAccounts(); 24 updateAccounts();
25 //qDebug("++++++++++++++++++new settings ");
25} 26}
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:
167 Settings(); 167 Settings();
168 //~Settings(){qDebug("-------------------settings "); };
168 QList<Account> getAccounts(); 169 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()
57 } 57 }
58 setText(1,mail_data->getSubject()); 58 setText(1,QString::fromUtf8( mail_data->getSubject().latin1()));
59 setText(2,mail_data->getFrom()); 59 setText(2,QString::fromUtf8( mail_data->getFrom().latin1()));
60#if 0 60#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 @@
13#include <qapplication.h> 13#include <qapplication.h>
14#include <qstatusbar.h>
15extern QStatusBar* globalSstatusBarMainWindow;
14#else 16#else
@@ -20,3 +22,2 @@
20 22
21
22#include <kabc/stdaddressbook.h> 23#include <kabc/stdaddressbook.h>
@@ -26,2 +27,5 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
26{ 27{
28#ifdef DESKTOP_VERSION
29 globalSstatusBarMainWindow = statusBar();
30#endif
27 setCaption( i18n( "KOpieMail/Pi" ) ); 31 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 )
42 42
43 setIcon(SmallIcon( "kmicromail" ) );
43 folderView->populate( settings->getAccounts() ); 44 folderView->populate( settings->getAccounts() );
@@ -242,3 +243,46 @@ void OpieMail::slotEditAccounts()
242} 243}
244void OpieMail::replyMail()
245{
246
247 QListViewItem*item = mailView->currentItem();
248 if (!item) return;
249 RecMailP mail = ((MailListViewItem*)item)->data();
250 RecBodyP body = folderView->fetchBody(mail);
251
252 QString rtext;
253 rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose
254 .arg( QString::fromUtf8( mail->getFrom().latin1()))
255 .arg( QString::fromUtf8( mail->getDate().latin1() ));
256
257 QString text = QString::fromUtf8( body->Bodytext().latin1() );
258 QStringList lines = QStringList::split(QRegExp("\\n"), text);
259 QStringList::Iterator it;
260 for (it = lines.begin(); it != lines.end(); it++)
261 {
262 rtext += "> " + *it + "\n";
263 }
264 rtext += "\n";
243 265
266 QString prefix;
267 if ( mail->getSubject().find(QRegExp("^Re: .*$")) != -1) prefix = "";
268 else prefix = "Re: "; // no i18n on purpose
269
270 Settings *settings = new Settings();
271 ComposeMail composer( settings ,this, 0, true);
272 if (mail->Replyto().isEmpty()) {
273 composer.setTo( QString::fromUtf8( mail->getFrom().latin1()));
274 } else {
275 composer.setTo( QString::fromUtf8(mail->Replyto().latin1()));
276 }
277 composer.setSubject( prefix + QString::fromUtf8( mail->getSubject().latin1() ) );
278 composer.setMessage( rtext );
279 composer.setInReplyTo( QString::fromUtf8(mail->Msgid().latin1()));
280
281 if ( QDialog::Accepted == KApplication::execDialog( &composer ) )
282 {
283 mail->Wrapper()->answeredMail(mail);
284 }
285 delete settings;
286
287}
244void OpieMail::displayMail() 288void OpieMail::displayMail()
@@ -342,2 +386,4 @@ void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int )
342 } 386 }
387 m->insertItem(i18n("Reply to this mail"),this,SLOT(replyMail()));
388 m->insertSeparator();
343 m->insertItem(i18n("Read this mail"),this,SLOT(displayMail())); 389 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:
32 virtual void displayMail(); 32 virtual void displayMail();
33 virtual void replyMail();
33 virtual void slotDeleteMail(); 34 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 @@
2#include "global.h" 2#include "global.h"
3 3#include <qstatusbar.h>
4QStatusBar* globalSstatusBarMainWindow = 0;
4namespace Global{ 5namespace Global{
@@ -7,3 +8,4 @@ namespace Global{
7 { 8 {
8 9 if ( globalSstatusBarMainWindow )
10 globalSstatusBarMainWindow->message( message,15000 );
9 qDebug("statusMessage %s ", message.latin1()); 11 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
25#else 25#else
26#warning ******************************************
27#warning ******************************************
28#warning ******************************************
29#warning ******************************************
30#warning "/usr/local/qt/include/qdialog.h" for KDialog 26#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 @@
11 { 11 {
12 qDebug("******************** "); 12 qDebug("New hacked QDialog for ompi desktop");
13 qDebug("******************** ");
14 qDebug("******************** ");
15 qDebug("******************** ");
16 qDebug("New hacked QDialog for ompi ");
17 //QTimer::singleShot( 1, this,SLOT(addaddbuttons()) ); 13 //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 )
100 m_body = body; 100 m_body = body;
101 m_mail[2] = body->Bodytext(); 101 m_mail[2] = QString::fromUtf8( body->Bodytext().latin1() );
102 // qDebug("********text %s ",m_mail[2].latin1() );
102 attachbutton->setEnabled(body->Parts().count()>0); 103 attachbutton->setEnabled(body->Parts().count()>0);
@@ -302,6 +303,6 @@ void ViewMail::setMail(const RecMailP&mail )
302 303
303 m_mail[0] = mail->getFrom(); 304 m_mail[0] = QString::fromUtf8( mail->getFrom().latin1() );
304 m_mail[1] = mail->getSubject(); 305 m_mail[1] = QString::fromUtf8( mail->getSubject().latin1() );
305 m_mail[3] = mail->getDate(); 306 m_mail[3] = QString::fromUtf8( mail->getDate().latin1() );
306 m_mail[4] = mail->Msgid(); 307 m_mail[4] = QString::fromUtf8( mail->Msgid().latin1() );
307 308
@@ -350,14 +351,7 @@ void ViewMail::setText()
350 351
351 for ( QStringList::Iterator it = ( m_mail2[0] ).begin(); it != ( m_mail2[0] ).end(); ++it ) 352
352 { 353 toString = QString::fromUtf8(m_mail2[0].join(",").latin1());
353 toString += (*it); 354 ccString = QString::fromUtf8(m_mail2[1].join(",").latin1());
354 } 355 bccString = QString::fromUtf8(m_mail2[2].join(",").latin1());
355 for ( QStringList::Iterator it = ( m_mail2[1] ).begin(); it != ( m_mail2[1] ).end(); ++it ) 356
356 {
357 ccString += (*it);
358 }
359 for ( QStringList::Iterator it = ( m_mail2[2] ).begin(); it != ( m_mail2[2] ).end(); ++it )
360 {
361 bccString += (*it);
362 }
363 357
@@ -458,5 +452,5 @@ void ViewMail::slotReply()
458 if (m_recMail->Replyto().isEmpty()) { 452 if (m_recMail->Replyto().isEmpty()) {
459 composer.setTo( m_recMail->getFrom()); 453 composer.setTo( QString::fromUtf8( m_recMail->getFrom().latin1()));
460 } else { 454 } else {
461 composer.setTo( m_recMail->Replyto()); 455 composer.setTo( QString::fromUtf8( m_recMail->Replyto().latin1()));
462 } 456 }
@@ -470,4 +464,5 @@ void ViewMail::slotReply()
470 } 464 }
465 delete settings;
471} 466}
472 467
473void ViewMail::slotForward() 468void ViewMail::slotForward()