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
@@ -1,6 +1,8 @@
1 1
2 2
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
@@ -42,19 +42,19 @@
42#include <qlabel.h> 42#include <qlabel.h>
43#include <qtabwidget.h> 43#include <qtabwidget.h>
44#include <qlistview.h> 44#include <qlistview.h>
45 45
46//using namespace Opie::Core; 46//using namespace Opie::Core;
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 )
50{ 50{
51 mPickLineEdit = 0; 51 mPickLineEdit = 0;
52 connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), 52 connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)),
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 = "";
56 if ( KOPrefs::instance()->mUseKapi) { 56 if ( KOPrefs::instance()->mUseKapi) {
57 KConfig config( locateLocal("config", "kabcrc") ); 57 KConfig config( locateLocal("config", "kabcrc") );
58 config.setGroup( "General" ); 58 config.setGroup( "General" );
59 QString whoami_uid = config.readEntry( "WhoAmI" ); 59 QString whoami_uid = config.readEntry( "WhoAmI" );
60 60
@@ -162,25 +162,25 @@ void ComposeMail::fillSettings()
162 162
163 163
164void ComposeMail::saveAsDraft() 164void ComposeMail::saveAsDraft()
165{ 165{
166 166
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()) {
176 QStringList ids; 176 QStringList ids;
177 ids.append(m_replyid); 177 ids.append(m_replyid);
178 mail->setInreply(ids); 178 mail->setInreply(ids);
179 } 179 }
180 QString txt = message->text(); 180 QString txt = message->text().utf8 ();
181 if ( !sigMultiLine->text().isEmpty() ) { 181 if ( !sigMultiLine->text().isEmpty() ) {
182 txt.append( "\n--\n" ); 182 txt.append( "\n--\n" );
183 txt.append( sigMultiLine->text() ); 183 txt.append( sigMultiLine->text() );
184 } 184 }
185 mail->setMessage( txt ); 185 mail->setMessage( txt );
186 186
@@ -405,36 +405,36 @@ void ComposeMail::accept()
405 odebug << "Sending Mail with " 405 odebug << "Sending Mail with "
406 << smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() << oendl; 406 << smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() << oendl;
407#endif 407#endif
408 Opie::Core::OSmartPointer<Mail> mail=new Mail; 408 Opie::Core::OSmartPointer<Mail> mail=new Mail;
409 409
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 {
416 QMessageBox::warning(0,i18n("Sending mail"), 416 QMessageBox::warning(0,i18n("Sending mail"),
417 i18n("No Receiver spezified" ) ); 417 i18n("No Receiver spezified" ) );
418 return; 418 return;
419 } 419 }
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 }
436 mail->setMessage( txt ); 436 mail->setMessage( txt );
437 AttachViewItem *it = (AttachViewItem *) attList->firstChild(); 437 AttachViewItem *it = (AttachViewItem *) attList->firstChild();
438 while ( it != 0 ) { 438 while ( it != 0 ) {
439 mail->addAttachment( it->getAttachment() ); 439 mail->addAttachment( it->getAttachment() );
440 it = (AttachViewItem *) it->nextSibling(); 440 it = (AttachViewItem *) it->nextSibling();
@@ -480,18 +480,18 @@ ComposeMail::~ComposeMail()
480{ 480{
481} 481}
482 482
483void ComposeMail::reEditMail(const RecMailP&current) 483void ComposeMail::reEditMail(const RecMailP&current)
484{ 484{
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}
493 493
494AttachViewItem::AttachViewItem( QListView *parent, Attachment *att ) 494AttachViewItem::AttachViewItem( QListView *parent, Attachment *att )
495 : QListViewItem( parent ) 495 : QListViewItem( parent )
496{ 496{
497 attachment = att; 497 attachment = att;
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
@@ -748,12 +748,13 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&t
748 currentPart->setIdentifier(id); 748 currentPart->setIdentifier(id);
749 fillSinglePart(currentPart,part1); 749 fillSinglePart(currentPart,part1);
750 /* important: Check for is NULL 'cause a body can be empty! 750 /* important: Check for is NULL 'cause a body can be empty!
751 And we put it only into the mail if it is the FIRST part */ 751 And we put it only into the mail if it is the FIRST part */
752 if (part1->bd_type==MAILIMAP_BODY_TYPE_1PART_TEXT && target_body->Bodytext().isNull() && countlist[0]==1) { 752 if (part1->bd_type==MAILIMAP_BODY_TYPE_1PART_TEXT && target_body->Bodytext().isNull() && countlist[0]==1) {
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);
755 target_body->setBodytext(body_text); 756 target_body->setBodytext(body_text);
756 if (countlist.count()>1) { 757 if (countlist.count()>1) {
757 target_body->addPart(currentPart); 758 target_body->addPart(currentPart);
758 } 759 }
759 } else { 760 } else {
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
@@ -19,12 +19,13 @@
19 19
20 20
21Settings::Settings() 21Settings::Settings()
22 : QObject() 22 : QObject()
23{ 23{
24 updateAccounts(); 24 updateAccounts();
25 //qDebug("++++++++++++++++++new settings ");
25} 26}
26 27
27void Settings::checkDirectory() 28void Settings::checkDirectory()
28{ 29{
29 return; 30 return;
30 locateLocal("data", "kopiemail" ); 31 locateLocal("data", "kopiemail" );
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
@@ -162,12 +162,13 @@ private:
162class Settings : public QObject 162class Settings : public QObject
163{ 163{
164 Q_OBJECT 164 Q_OBJECT
165 165
166public: 166public:
167 Settings(); 167 Settings();
168 //~Settings(){qDebug("-------------------settings "); };
168 QList<Account> getAccounts(); 169 QList<Account> getAccounts();
169 void addAccount(Account *account); 170 void addAccount(Account *account);
170 void delAccount(Account *account); 171 void delAccount(Account *account);
171 void saveAccounts(); 172 void saveAccounts();
172 void readAccounts(); 173 void readAccounts();
173 static void checkDirectory(); 174 static void checkDirectory();
diff --git a/kmicromail/mailistviewitem.cpp b/kmicromail/mailistviewitem.cpp
index 484a635..5ef5b6a 100644
--- a/kmicromail/mailistviewitem.cpp
+++ b/kmicromail/mailistviewitem.cpp
@@ -52,14 +52,14 @@ void MailListViewItem::showEntry()
52 mKeyMap.insert(3, "k" + fsort); 52 mKeyMap.insert(3, "k" + fsort);
53 //setText(3, "kB" + fsort ); // test only 53 //setText(3, "kB" + fsort ); // test only
54 } else { 54 } else {
55 //setText(3, fsize + "MB"); 55 //setText(3, fsize + "MB");
56 mKeyMap.insert(3, "M" +fsort ); 56 mKeyMap.insert(3, "M" +fsort );
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
61 QString date = mail_data->getDate(); 61 QString date = mail_data->getDate();
62 62
63 int kom = date.find( ",")+2; 63 int kom = date.find( ",")+2;
64 if ( kom == 1 ) 64 if ( kom == 1 )
65 kom = 0; 65 kom = 0;
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp
index 4115276..98eb9a5 100644
--- a/kmicromail/mainwindow.cpp
+++ b/kmicromail/mainwindow.cpp
@@ -8,25 +8,29 @@
8//#include <kdialog.h> 8//#include <kdialog.h>
9#include <kiconloader.h> 9#include <kiconloader.h>
10#include <kapplication.h> 10#include <kapplication.h>
11 11
12#ifdef DESKTOP_VERSION 12#ifdef DESKTOP_VERSION
13#include <qapplication.h> 13#include <qapplication.h>
14#include <qstatusbar.h>
15extern QStatusBar* globalSstatusBarMainWindow;
14#else 16#else
15#include <qpe/qpeapplication.h> 17#include <qpe/qpeapplication.h>
16#endif 18#endif
17#include "defines.h" 19#include "defines.h"
18#include "mainwindow.h" 20#include "mainwindow.h"
19#include <KDGanttMinimizeSplitter.h> 21#include <KDGanttMinimizeSplitter.h>
20 22
21
22#include <kabc/stdaddressbook.h> 23#include <kabc/stdaddressbook.h>
23 24
24MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) 25MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
25 : QMainWindow( parent, name ) //, flags ) 26 : QMainWindow( parent, name ) //, flags )
26{ 27{
28#ifdef DESKTOP_VERSION
29 globalSstatusBarMainWindow = statusBar();
30#endif
27 setCaption( i18n( "KOpieMail/Pi" ) ); 31 setCaption( i18n( "KOpieMail/Pi" ) );
28 setToolBarsMovable( false ); 32 setToolBarsMovable( false );
29 //KABC::StdAddressBook::self(); 33 //KABC::StdAddressBook::self();
30 toolBar = new QToolBar( this ); 34 toolBar = new QToolBar( this );
31 menuBar = new QPEMenuBar( toolBar ); 35 menuBar = new QPEMenuBar( toolBar );
32 mailMenu = new QPopupMenu( menuBar ); 36 mailMenu = new QPopupMenu( menuBar );
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp
index ca3faaf..fe9df87 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -37,12 +37,13 @@
37 37
38OpieMail::OpieMail( QWidget *parent, const char *name ) 38OpieMail::OpieMail( QWidget *parent, const char *name )
39 : MainWindow( parent, name) //, WStyle_ContextHelp ) 39 : MainWindow( parent, name) //, WStyle_ContextHelp )
40{ 40{
41 settings = new Settings(); 41 settings = new Settings();
42 42
43 setIcon(SmallIcon( "kmicromail" ) );
43 folderView->populate( settings->getAccounts() ); 44 folderView->populate( settings->getAccounts() );
44 45
45} 46}
46 47
47OpieMail::~OpieMail() 48OpieMail::~OpieMail()
48{ 49{
@@ -237,13 +238,56 @@ void OpieMail::slotEditAccounts()
237 eaDialog.exec(); 238 eaDialog.exec();
238 if ( settings ) delete settings; 239 if ( settings ) delete settings;
239 settings = new Settings(); 240 settings = new Settings();
240 241
241 folderView->populate( settings->getAccounts() ); 242 folderView->populate( settings->getAccounts() );
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()
245{ 289{
246 QListViewItem*item = mailView->currentItem(); 290 QListViewItem*item = mailView->currentItem();
247 if (!item) return; 291 if (!item) return;
248 RecMailP mail = ((MailListViewItem*)item)->data(); 292 RecMailP mail = ((MailListViewItem*)item)->data();
249 RecBodyP body = folderView->fetchBody(mail); 293 RecBodyP body = folderView->fetchBody(mail);
@@ -337,12 +381,14 @@ void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int )
337 m->insertItem(i18n("Copy all selected postings"),this,SLOT(slotMoveCopyAllMail())); 381 m->insertItem(i18n("Copy all selected postings"),this,SLOT(slotMoveCopyAllMail()));
338 m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection())); 382 m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection()));
339 } else { 383 } else {
340 if (folderView->currentisDraft()) { 384 if (folderView->currentisDraft()) {
341 m->insertItem(i18n("Edit this mail"),this,SLOT(reEditMail())); 385 m->insertItem(i18n("Edit this mail"),this,SLOT(reEditMail()));
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()));
344 m->insertItem(i18n("Move/Copy this mail"),this,SLOT(slotMoveCopyMail())); 390 m->insertItem(i18n("Move/Copy this mail"),this,SLOT(slotMoveCopyMail()));
345 m->insertItem(i18n("Delete this mail"),this,SLOT(slotDeleteMail())); 391 m->insertItem(i18n("Delete this mail"),this,SLOT(slotDeleteMail()));
346 m->insertSeparator(); 392 m->insertSeparator();
347 m->insertItem(i18n("Move/Copy all selected mail"),this,SLOT(slotMoveCopyAllMail())); 393 m->insertItem(i18n("Move/Copy all selected mail"),this,SLOT(slotMoveCopyAllMail()));
348 m->insertItem(i18n("Delete all selected mails"),this,SLOT(slotDeleteAllMail())); 394 m->insertItem(i18n("Delete all selected mails"),this,SLOT(slotDeleteAllMail()));
diff --git a/kmicromail/opiemail.h b/kmicromail/opiemail.h
index 9de95f8..44ab1ec 100644
--- a/kmicromail/opiemail.h
+++ b/kmicromail/opiemail.h
@@ -27,12 +27,13 @@ public slots:
27protected slots: 27protected slots:
28 virtual void slotSendQueued(); 28 virtual void slotSendQueued();
29 virtual void slotSearchMails(); 29 virtual void slotSearchMails();
30 virtual void slotEditSettings(); 30 virtual void slotEditSettings();
31 virtual void slotEditAccounts(); 31 virtual void slotEditAccounts();
32 virtual void displayMail(); 32 virtual void displayMail();
33 virtual void replyMail();
33 virtual void slotDeleteMail(); 34 virtual void slotDeleteMail();
34 virtual void slotGetMail(); 35 virtual void slotGetMail();
35 virtual void slotGetAllMail(); 36 virtual void slotGetAllMail();
36 virtual void slotDeleteAllMail(); 37 virtual void slotDeleteAllMail();
37 virtual void mailHold(int, QListViewItem *,const QPoint&,int); 38 virtual void mailHold(int, QListViewItem *,const QPoint&,int);
38 virtual void slotShowFolders( bool show ); 39 virtual void slotShowFolders( bool show );
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
@@ -1,12 +1,14 @@
1 1
2#include "global.h" 2#include "global.h"
3 3#include <qstatusbar.h>
4QStatusBar* globalSstatusBarMainWindow = 0;
4namespace Global{ 5namespace Global{
5 6
6 void statusMessage(QString message) 7 void statusMessage(QString message)
7 { 8 {
8 9 if ( globalSstatusBarMainWindow )
10 globalSstatusBarMainWindow->message( message,15000 );
9 qDebug("statusMessage %s ", message.latin1()); 11 qDebug("statusMessage %s ", message.latin1());
10 } 12 }
11} 13}
12 14
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
@@ -20,14 +20,10 @@ class QDialog_hacked : public QDialog
20 20
21#define QDialog QDialog_hacked 21#define QDialog QDialog_hacked
22 22
23#endif 23#endif
24 24
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
31#include "/usr/local/qt/include/qdialog.h" 27#include "/usr/local/qt/include/qdialog.h"
32 28
33#endif 29#endif
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
@@ -6,17 +6,13 @@
6#ifdef QDialog 6#ifdef QDialog
7#undef QDialog 7#undef QDialog
8#endif 8#endif
9 QDialog_hacked::QDialog_hacked ( QWidget * parent, const char * name, bool modal, WFlags f ) 9 QDialog_hacked::QDialog_hacked ( QWidget * parent, const char * name, bool modal, WFlags f )
10 : QDialog( parent,name,modal, f) 10 : QDialog( parent,name,modal, f)
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()) );
18 14
19 setOrientation ( Vertical ); 15 setOrientation ( Vertical );
20 QHBox * hb = new QHBox ( this ); 16 QHBox * hb = new QHBox ( this );
21 QPushButton *ok = new QPushButton( i18n("OK"), hb ); 17 QPushButton *ok = new QPushButton( i18n("OK"), hb );
22 QPushButton *cancel = new QPushButton( i18n("Cancel"), hb ); 18 QPushButton *cancel = new QPushButton( i18n("Cancel"), hb );
diff --git a/kmicromail/viewmail.cpp b/kmicromail/viewmail.cpp
index f1e0225..2093678 100644
--- a/kmicromail/viewmail.cpp
+++ b/kmicromail/viewmail.cpp
@@ -95,13 +95,14 @@ AttachItem* ViewMail::lastChild(AttachItem*parent)
95} 95}
96 96
97void ViewMail::setBody(const RecBodyP&body ) 97void ViewMail::setBody(const RecBodyP&body )
98{ 98{
99 99
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);
103 attachments->setEnabled(body->Parts().count()>0); 104 attachments->setEnabled(body->Parts().count()>0);
104 if (body->Parts().count()==0) 105 if (body->Parts().count()==0)
105 { 106 {
106 return; 107 return;
107 } 108 }
@@ -297,16 +298,16 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int
297 298
298void ViewMail::setMail(const RecMailP&mail ) 299void ViewMail::setMail(const RecMailP&mail )
299{ 300{
300 301
301 m_recMail = mail; 302 m_recMail = 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
308 m_mail2[0] = mail->To(); 309 m_mail2[0] = mail->To();
309 m_mail2[1] = mail->CC(); 310 m_mail2[1] = mail->CC();
310 m_mail2[2] = mail->Bcc(); 311 m_mail2[2] = mail->Bcc();
311 312
312 setText(); 313 setText();
@@ -345,24 +346,17 @@ void ViewMail::setText()
345{ 346{
346 347
347 QString toString; 348 QString toString;
348 QString ccString; 349 QString ccString;
349 QString bccString; 350 QString bccString;
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
364 setCaption( i18n("E-Mail by %1").arg( m_mail[0] ) ); 358 setCaption( i18n("E-Mail by %1").arg( m_mail[0] ) );
365 359
366 m_mailHtml = "<html><body>" 360 m_mailHtml = "<html><body>"
367 "<table width=\"100%\" border=\"0\"><tr bgcolor=\"#FFDD76\"><td>" 361 "<table width=\"100%\" border=\"0\"><tr bgcolor=\"#FFDD76\"><td>"
368 "<div align=left><b>" + deHtml( m_mail[1] ) + "</b></div>" 362 "<div align=left><b>" + deHtml( m_mail[1] ) + "</b></div>"
@@ -453,26 +447,27 @@ void ViewMail::slotReply()
453 if ( m_mail[1].find(QRegExp("^Re: .*$")) != -1) prefix = ""; 447 if ( m_mail[1].find(QRegExp("^Re: .*$")) != -1) prefix = "";
454 else prefix = "Re: "; // no i18n on purpose 448 else prefix = "Re: "; // no i18n on purpose
455 449
456 Settings *settings = new Settings(); 450 Settings *settings = new Settings();
457 ComposeMail composer( settings ,this, 0, true); 451 ComposeMail composer( settings ,this, 0, true);
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 }
463 composer.setSubject( prefix + m_mail[1] ); 457 composer.setSubject( prefix + m_mail[1] );
464 composer.setMessage( rtext ); 458 composer.setMessage( rtext );
465 composer.setInReplyTo(m_recMail->Msgid()); 459 composer.setInReplyTo(m_recMail->Msgid());
466 460
467 if ( QDialog::Accepted == KApplication::execDialog( &composer ) ) 461 if ( QDialog::Accepted == KApplication::execDialog( &composer ) )
468 { 462 {
469 m_recMail->Wrapper()->answeredMail(m_recMail); 463 m_recMail->Wrapper()->answeredMail(m_recMail);
470 } 464 }
465 delete settings;
471} 466}
472 467
473void ViewMail::slotForward() 468void ViewMail::slotForward()
474{ 469{
475 if (!m_gotBody) 470 if (!m_gotBody)
476 { 471 {
477 QMessageBox::information(this, i18n("Error"), i18n("<p>The mail body is not yet downloaded, so you cannot forward yet."), i18n("Ok")); 472 QMessageBox::information(this, i18n("Error"), i18n("<p>The mail body is not yet downloaded, so you cannot forward yet."), i18n("Ok"));
478 return; 473 return;