-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 | |||
@@ -14,25 +14,25 @@ | |||
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 | } |
@@ -55,24 +55,36 @@ void OpieMail::appMessage(const QCString &msg, const QByteArray &data) | |||
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); |