author | alwin <alwin> | 2004-03-10 22:44:44 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-10 22:44:44 (UTC) |
commit | 9454ac48a53f3b49e03288311b71436ccacd2d04 (patch) (unidiff) | |
tree | e05d40f575c87431d84c5ac374ff8ce656e6a419 /noncore/net/mail/libmailwrapper/abstractmail.cpp | |
parent | a72855867dedd2b4c16f703fa104b5c6175ce484 (diff) | |
download | opie-9454ac48a53f3b49e03288311b71436ccacd2d04.zip opie-9454ac48a53f3b49e03288311b71436ccacd2d04.tar.gz opie-9454ac48a53f3b49e03288311b71436ccacd2d04.tar.bz2 |
some bugfixes
When edit a mail to send and cancel is pressed the mail can stored in a draft
folder and later edit again. This moment we will not store attachments into
drafts.
Diffstat (limited to 'noncore/net/mail/libmailwrapper/abstractmail.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/abstractmail.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.cpp b/noncore/net/mail/libmailwrapper/abstractmail.cpp index 9960f88..d71d35c 100644 --- a/noncore/net/mail/libmailwrapper/abstractmail.cpp +++ b/noncore/net/mail/libmailwrapper/abstractmail.cpp | |||
@@ -22,24 +22,42 @@ AbstractMail* AbstractMail::getWrapper(POP3account *a) | |||
22 | } | 22 | } |
23 | 23 | ||
24 | AbstractMail* AbstractMail::getWrapper(NNTPaccount *a) | 24 | AbstractMail* AbstractMail::getWrapper(NNTPaccount *a) |
25 | { | 25 | { |
26 | return new NNTPwrapper(a); | 26 | return new NNTPwrapper(a); |
27 | } | 27 | } |
28 | 28 | ||
29 | AbstractMail* AbstractMail::getWrapper(const QString&a,const QString&name) | 29 | AbstractMail* AbstractMail::getWrapper(const QString&a,const QString&name) |
30 | { | 30 | { |
31 | return new MHwrapper(a,name); | 31 | return new MHwrapper(a,name); |
32 | } | 32 | } |
33 | 33 | ||
34 | AbstractMail* AbstractMail::getWrapper(Account*a) | ||
35 | { | ||
36 | if (!a) return 0; | ||
37 | switch (a->getType()) { | ||
38 | case MAILLIB::A_IMAP: | ||
39 | return new IMAPwrapper((IMAPaccount*)a); | ||
40 | break; | ||
41 | case MAILLIB::A_POP3: | ||
42 | return new POP3wrapper((POP3account*)a); | ||
43 | break; | ||
44 | case MAILLIB::A_NNTP: | ||
45 | return new NNTPwrapper((NNTPaccount*)a); | ||
46 | break; | ||
47 | default: | ||
48 | return 0; | ||
49 | } | ||
50 | } | ||
51 | |||
34 | encodedString* AbstractMail::decode_String(const encodedString*text,const QString&enc) | 52 | encodedString* AbstractMail::decode_String(const encodedString*text,const QString&enc) |
35 | { | 53 | { |
36 | qDebug("Decode string start"); | 54 | qDebug("Decode string start"); |
37 | char*result_text; | 55 | char*result_text; |
38 | size_t index = 0; | 56 | size_t index = 0; |
39 | /* reset for recursive use! */ | 57 | /* reset for recursive use! */ |
40 | size_t target_length = 0; | 58 | size_t target_length = 0; |
41 | result_text = 0; | 59 | result_text = 0; |
42 | int mimetype = MAILMIME_MECHANISM_7BIT; | 60 | int mimetype = MAILMIME_MECHANISM_7BIT; |
43 | if (enc.lower()=="quoted-printable") { | 61 | if (enc.lower()=="quoted-printable") { |
44 | mimetype = MAILMIME_MECHANISM_QUOTED_PRINTABLE; | 62 | mimetype = MAILMIME_MECHANISM_QUOTED_PRINTABLE; |
45 | } else if (enc.lower()=="base64") { | 63 | } else if (enc.lower()=="base64") { |
@@ -96,24 +114,29 @@ QString AbstractMail::gen_attachment_id() | |||
96 | int AbstractMail::createMbox(const QString&,const Folder*,const QString& delemiter,bool) | 114 | int AbstractMail::createMbox(const QString&,const Folder*,const QString& delemiter,bool) |
97 | { | 115 | { |
98 | return 0; | 116 | return 0; |
99 | } | 117 | } |
100 | 118 | ||
101 | QString AbstractMail::defaultLocalfolder() | 119 | QString AbstractMail::defaultLocalfolder() |
102 | { | 120 | { |
103 | QString f = getenv( "HOME" ); | 121 | QString f = getenv( "HOME" ); |
104 | f += "/Applications/opiemail/localmail"; | 122 | f += "/Applications/opiemail/localmail"; |
105 | return f; | 123 | return f; |
106 | } | 124 | } |
107 | 125 | ||
126 | QString AbstractMail::draftFolder() | ||
127 | { | ||
128 | return QString("Drafts"); | ||
129 | } | ||
130 | |||
108 | /* temporary - will be removed when implemented in all classes */ | 131 | /* temporary - will be removed when implemented in all classes */ |
109 | void AbstractMail::deleteMails(const QString &,QList<RecMail> &) | 132 | void AbstractMail::deleteMails(const QString &,QList<RecMail> &) |
110 | { | 133 | { |
111 | } | 134 | } |
112 | 135 | ||
113 | void AbstractMail::mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) | 136 | void AbstractMail::mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) |
114 | { | 137 | { |
115 | QList<RecMail> t; | 138 | QList<RecMail> t; |
116 | listMessages(fromFolder->getName(),t); | 139 | listMessages(fromFolder->getName(),t); |
117 | encodedString*st = 0; | 140 | encodedString*st = 0; |
118 | while (t.count()>0) { | 141 | while (t.count()>0) { |
119 | RecMail*r = t.at(0); | 142 | RecMail*r = t.at(0); |