-rw-r--r-- | noncore/net/mail/opiemail.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp index 2f87e44..b153292 100644 --- a/noncore/net/mail/opiemail.cpp +++ b/noncore/net/mail/opiemail.cpp | |||
@@ -10,33 +10,33 @@ | |||
10 | 10 | ||
11 | #include <libmailwrapper/smtpwrapper.h> | 11 | #include <libmailwrapper/smtpwrapper.h> |
12 | #include <libmailwrapper/mailtypes.h> | 12 | #include <libmailwrapper/mailtypes.h> |
13 | #include <libmailwrapper/abstractmail.h> | 13 | #include <libmailwrapper/abstractmail.h> |
14 | /* OPIE */ | 14 | /* OPIE */ |
15 | #include <opie2/odebug.h> | 15 | #include <opie2/odebug.h> |
16 | #include <qpe/resource.h> | 16 | #include <qpe/resource.h> |
17 | #include <qpe/qpeapplication.h> | 17 | #include <qpe/qpeapplication.h> |
18 | 18 | ||
19 | /* QT */ | 19 | /* QT */ |
20 | 20 | ||
21 | /* UNIX */ | 21 | /* UNIX */ |
22 | #include <signal.h> | 22 | #include <signal.h> |
23 | 23 | ||
24 | using namespace Opie::Core; | 24 | using namespace Opie::Core; |
25 | 25 | ||
26 | OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags ) | 26 | OpieMail::OpieMail( QWidget *parent, const char *name, WFlags ) |
27 | : MainWindow( parent, name, WStyle_ContextHelp ) | 27 | : MainWindow( parent, name, WStyle_ContextHelp ) |
28 | { | 28 | { |
29 | setup_signalblocking(); | 29 | setup_signalblocking(); |
30 | settings = new Settings(); | 30 | settings = new Settings(); |
31 | 31 | ||
32 | folderView->populate( settings->getAccounts() ); | 32 | folderView->populate( settings->getAccounts() ); |
33 | } | 33 | } |
34 | 34 | ||
35 | OpieMail::~OpieMail() | 35 | OpieMail::~OpieMail() |
36 | { | 36 | { |
37 | if (settings) delete settings; | 37 | if (settings) delete settings; |
38 | } | 38 | } |
39 | 39 | ||
40 | void OpieMail::setup_signalblocking() | 40 | void OpieMail::setup_signalblocking() |
41 | { | 41 | { |
42 | /* for networking we must block SIGPIPE and Co. */ | 42 | /* for networking we must block SIGPIPE and Co. */ |
@@ -51,32 +51,44 @@ void OpieMail::appMessage(const QCString &msg, const QByteArray &data) | |||
51 | { | 51 | { |
52 | // copied from old mail2 | 52 | // copied from old mail2 |
53 | if (msg == "writeMail(QString,QString)") | 53 | if (msg == "writeMail(QString,QString)") |
54 | { | 54 | { |
55 | QDataStream stream(data,IO_ReadOnly); | 55 | QDataStream stream(data,IO_ReadOnly); |
56 | QString name, email; | 56 | QString name, email; |
57 | stream >> name >> email; | 57 | stream >> name >> email; |
58 | // removing the whitespaces at beginning and end is needed! | 58 | // removing the whitespaces at beginning and end is needed! |
59 | slotwriteMail(name.stripWhiteSpace(),email.stripWhiteSpace()); | 59 | slotwriteMail(name.stripWhiteSpace(),email.stripWhiteSpace()); |
60 | } | 60 | } |
61 | else if (msg == "newMail()") | 61 | else if (msg == "newMail()") |
62 | { | 62 | { |
63 | slotComposeMail(); | 63 | slotComposeMail(); |
64 | } | 64 | } |
65 | } | 65 | } |
66 | 66 | ||
67 | /** | ||
68 | * Konqueror calls us with the mailto:name@address | ||
69 | */ | ||
70 | void OpieMail::setDocument(const QString& mail) | ||
71 | { | ||
72 | /* | ||
73 | * It looks like a mailto address, lets try it | ||
74 | */ | ||
75 | if( mail.startsWith(QString::fromLatin1("mailto:")) ) | ||
76 | slotwriteMail(QString::null, mail.mid(7)); | ||
77 | } | ||
78 | |||
67 | void OpieMail::slotwriteMail(const QString&name,const QString&email) | 79 | void OpieMail::slotwriteMail(const QString&name,const QString&email) |
68 | { | 80 | { |
69 | ComposeMail compose( settings, this, 0, true , WStyle_ContextHelp ); | 81 | ComposeMail compose( settings, this, 0, true , WStyle_ContextHelp ); |
70 | if (!email.isEmpty()) | 82 | if (!email.isEmpty()) |
71 | { | 83 | { |
72 | if (!name.isEmpty()) | 84 | if (!name.isEmpty()) |
73 | { | 85 | { |
74 | compose.setTo("\"" + name + "\"" + " " + "<"+ email + ">"); | 86 | compose.setTo("\"" + name + "\"" + " " + "<"+ email + ">"); |
75 | } | 87 | } |
76 | else | 88 | else |
77 | { | 89 | { |
78 | compose.setTo(email); | 90 | compose.setTo(email); |
79 | } | 91 | } |
80 | } | 92 | } |
81 | compose.slotAdjustColumns(); | 93 | compose.slotAdjustColumns(); |
82 | QPEApplication::execDialog( &compose ); | 94 | QPEApplication::execDialog( &compose ); |