summaryrefslogtreecommitdiffabout
path: root/kmicromail/opiemail.cpp
authorzautrix <zautrix>2004-10-30 11:40:54 (UTC)
committer zautrix <zautrix>2004-10-30 11:40:54 (UTC)
commit632b43950f1ac2980c281eb8901d797deb0ba971 (patch) (unidiff)
tree72534bf865fbef61a29d5e8b2e65672c15b432c0 /kmicromail/opiemail.cpp
parent0057c2a8e90346583f606491730cae819d2313ac (diff)
downloadkdepimpi-632b43950f1ac2980c281eb8901d797deb0ba971.zip
kdepimpi-632b43950f1ac2980c281eb8901d797deb0ba971.tar.gz
kdepimpi-632b43950f1ac2980c281eb8901d797deb0ba971.tar.bz2
made ompi compiling on desktop
Diffstat (limited to 'kmicromail/opiemail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/opiemail.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp
index a32983c..153c7c0 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -1,117 +1,123 @@
1// CHANGED 2004-09-31 Lutz Rogowski 1// CHANGED 2004-09-31 Lutz Rogowski
2// CHANGED 2004-08-06 Lutz Rogowski 2// CHANGED 2004-08-06 Lutz Rogowski
3 3
4#include "settingsdialog.h" 4#include "settingsdialog.h"
5#include "opiemail.h" 5#include "opiemail.h"
6#include "editaccounts.h" 6#include "editaccounts.h"
7#include "composemail.h" 7#include "composemail.h"
8#include "mailistviewitem.h" 8#include "mailistviewitem.h"
9#include "viewmail.h" 9#include "viewmail.h"
10#include "selectstore.h" 10#include "selectstore.h"
11#include "selectsmtp.h" 11#include "selectsmtp.h"
12#include "accountitem.h" 12#include "accountitem.h"
13#include "koprefsdialog.h" 13#include "koprefsdialog.h"
14#include "klocale.h" 14#include "klocale.h"
15 15
16#include <qmessagebox.h> 16#include <qmessagebox.h>
17#include <qtimer.h> 17#include <qtimer.h>
18#include <qcursor.h>
19#include <qregexp.h>
18#include <libkdepim/externalapphandler.h> 20#include <libkdepim/externalapphandler.h>
19#include <libkdepim/kpimglobalprefs.h> 21#include <libkdepim/kpimglobalprefs.h>
20 22
23#ifdef DESKTOP_VERSION
24#include <qapplication.h>
25#else
21#include <qpe/qpeapplication.h> 26#include <qpe/qpeapplication.h>
27#endif
22#include <libmailwrapper/smtpwrapper.h> 28#include <libmailwrapper/smtpwrapper.h>
23#include <libmailwrapper/mailtypes.h> 29#include <libmailwrapper/mailtypes.h>
24#include <libmailwrapper/abstractmail.h> 30#include <libmailwrapper/abstractmail.h>
25/* OPIE */ 31/* OPIE */
26//#include <qpe/resource.h> 32//#include <qpe/resource.h>
27//#include <qpe/qpeapplication.h> 33//#include <qpe/qpeapplication.h>
28 34
29/* QT */ 35/* QT */
30 36
31//using namespace Opie::Core; 37//using namespace Opie::Core;
32 38
33OpieMail::OpieMail( QWidget *parent, const char *name ) 39OpieMail::OpieMail( QWidget *parent, const char *name )
34 : MainWindow( parent, name) //, WStyle_ContextHelp ) 40 : MainWindow( parent, name) //, WStyle_ContextHelp )
35{ 41{
36 settings = new Settings(); 42 settings = new Settings();
37 43
38 folderView->populate( settings->getAccounts() ); 44 folderView->populate( settings->getAccounts() );
39 45
40} 46}
41 47
42OpieMail::~OpieMail() 48OpieMail::~OpieMail()
43{ 49{
44 if (settings) delete settings; 50 if (settings) delete settings;
45} 51}
46 52
47void OpieMail::appMessage(const QCString &msg, const QByteArray &data) 53void OpieMail::appMessage(const QCString &msg, const QByteArray &data)
48{ 54{
49 55
50} 56}
51#include <stdlib.h> 57#include <stdlib.h>
52void OpieMail::message(const QCString &msg, const QByteArray &data) 58void OpieMail::message(const QCString &msg, const QByteArray &data)
53{ 59{
54 // copied from old mail2 60 // copied from old mail2
55 static int ii = 0; 61 static int ii = 0;
56 //qDebug("QCOP CALL ############################# %d ", ii); 62 //qDebug("QCOP CALL ############################# %d ", ii);
57 //QString mess ( msg ); 63 //QString mess ( msg );
58 //qDebug("Message = %s ",mess.latin1()); 64 //qDebug("Message = %s ",mess.latin1());
59 ++ii; 65 ++ii;
60 //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this); 66 //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this);
61 67
62 mPendingEmail = QString::null; 68 mPendingEmail = QString::null;
63 mPendingName = QString::null; 69 mPendingName = QString::null;
64 if (msg == "writeMail(QString,QString)") 70 if (msg == "writeMail(QString,QString)")
65 { 71 {
66 //qDebug("writeMail(QString,QString) "); 72 //qDebug("writeMail(QString,QString) ");
67 QDataStream stream(data,IO_ReadOnly); 73 QDataStream stream(data,IO_ReadOnly);
68 stream >> mPendingName >> mPendingEmail; 74 stream >> mPendingName >> mPendingEmail;
69 // removing the whitespaces at beginning and end is needed! 75 // removing the whitespaces at beginning and end is needed!
70 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); 76 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) );
71 } 77 }
72 else if (msg == "newMail()") 78 else if (msg == "newMail()")
73 { 79 {
74 //qDebug("slotComposeMail() "); 80 //qDebug("slotComposeMail() ");
75 // we cannot call slotComposeMail(); directly, because may be executing a QCOP call 81 // we cannot call slotComposeMail(); directly, because may be executing a QCOP call
76 // and a QCOP call does not like a processevents in his execution 82 // and a QCOP call does not like a processevents in his execution
77 // with the Qtimer we call slotComposeMail() after we reached the main event loop 83 // with the Qtimer we call slotComposeMail() after we reached the main event loop
78 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); 84 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) );
79 // slotComposeMail(); 85 // slotComposeMail();
80 } 86 }
81 else if (msg == "newMail(QString)") 87 else if (msg == "newMail(QString)")
82 { 88 {
83 //qDebug(" newMail(QString)"); 89 //qDebug(" newMail(QString)");
84 QDataStream stream(data,IO_ReadOnly); 90 QDataStream stream(data,IO_ReadOnly);
85 stream >> mPendingName; 91 stream >> mPendingName;
86 // the format is 92 // the format is
87 // NAME <EMAIL>:SUBJECT 93 // NAME <EMAIL>:SUBJECT
88 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); 94 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) );
89 } else { 95 } else {
90 mPendingData = data; 96 mPendingData = data;
91 mPendingMessage = msg; 97 mPendingMessage = msg;
92 QTimer::singleShot ( 50, this, SLOT(slotExtAppHandler() ) ); 98 QTimer::singleShot ( 50, this, SLOT(slotExtAppHandler() ) );
93 } 99 }
94 100
95 //qDebug("END OpieMail::message "); 101 //qDebug("END OpieMail::message ");
96} 102}
97void OpieMail::slotExtAppHandler() 103void OpieMail::slotExtAppHandler()
98{ 104{
99 ExternalAppHandler::instance()->appMessage ( mPendingMessage, mPendingData ); 105 ExternalAppHandler::instance()->appMessage ( mPendingMessage, mPendingData );
100} 106}
101void OpieMail::slotwriteMail2(const QString& namemail ) 107void OpieMail::slotwriteMail2(const QString& namemail )
102{ 108{
103 //qDebug("OpieMail::slotwriteMail2 "); 109 //qDebug("OpieMail::slotwriteMail2 ");
104 //qApp->processEvents(); 110 //qApp->processEvents();
105 ComposeMail compose( settings, this, 0, true ); 111 ComposeMail compose( settings, this, 0, true );
106 if ( !namemail.isEmpty() ) { 112 if ( !namemail.isEmpty() ) {
107 QString to = namemail; 113 QString to = namemail;
108 if ( namemail.find( " <") > 1 ) { 114 if ( namemail.find( " <") > 1 ) {
109 to = "\"" +to.replace( QRegExp( " <"), "\" <") ; 115 to = "\"" +to.replace( QRegExp( " <"), "\" <") ;
110 } else 116 } else
111 if ( namemail.find( "<") > 1 ) { 117 if ( namemail.find( "<") > 1 ) {
112 to = "\"" +to.replace( QRegExp( "<"), "\" <") ; 118 to = "\"" +to.replace( QRegExp( "<"), "\" <") ;
113 } 119 }
114 int sub = to.find( ">:"); 120 int sub = to.find( ">:");
115 if ( sub > 0 ) { 121 if ( sub > 0 ) {
116 compose.setTo( to.left(sub+1) ); 122 compose.setTo( to.left(sub+1) );
117 compose.setSubject( to.mid(sub+2) ); 123 compose.setSubject( to.mid(sub+2) );