-rw-r--r-- | noncore/net/mail/imapwrapper.cpp | 1 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 1 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailtypes.cpp | 17 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailtypes.h | 7 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/pop3wrapper.cpp | 1 | ||||
-rw-r--r-- | noncore/net/mail/mailtypes.cpp | 17 | ||||
-rw-r--r-- | noncore/net/mail/mailtypes.h | 7 | ||||
-rw-r--r-- | noncore/net/mail/pop3wrapper.cpp | 1 |
8 files changed, 50 insertions, 2 deletions
diff --git a/noncore/net/mail/imapwrapper.cpp b/noncore/net/mail/imapwrapper.cpp index e5eb335..3222c7e 100644 --- a/noncore/net/mail/imapwrapper.cpp +++ b/noncore/net/mail/imapwrapper.cpp | |||
@@ -122,24 +122,25 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target ) | |||
122 | 122 | ||
123 | if ( err == MAILIMAP_NO_ERROR ) { | 123 | if ( err == MAILIMAP_NO_ERROR ) { |
124 | 124 | ||
125 | mailimap_msg_att * msg_att; | 125 | mailimap_msg_att * msg_att; |
126 | int i = 0; | 126 | int i = 0; |
127 | for (current = clist_begin(result); current != 0; current=clist_next(current)) { | 127 | for (current = clist_begin(result); current != 0; current=clist_next(current)) { |
128 | ++i; | 128 | ++i; |
129 | msg_att = (mailimap_msg_att*)current->data; | 129 | msg_att = (mailimap_msg_att*)current->data; |
130 | RecMail*m = parse_list_result(msg_att); | 130 | RecMail*m = parse_list_result(msg_att); |
131 | if (m) { | 131 | if (m) { |
132 | m->setNumber(i); | 132 | m->setNumber(i); |
133 | m->setMbox(mailbox); | 133 | m->setMbox(mailbox); |
134 | m->setWrapper(this); | ||
134 | target.append(m); | 135 | target.append(m); |
135 | } | 136 | } |
136 | } | 137 | } |
137 | } else { | 138 | } else { |
138 | qDebug("Error fetching headers: %s",m_imap->imap_response); | 139 | qDebug("Error fetching headers: %s",m_imap->imap_response); |
139 | } | 140 | } |
140 | mailimap_fetch_list_free(result); | 141 | mailimap_fetch_list_free(result); |
141 | } | 142 | } |
142 | 143 | ||
143 | QList<Folder>* IMAPwrapper::listFolders() | 144 | QList<Folder>* IMAPwrapper::listFolders() |
144 | { | 145 | { |
145 | const char *path, *mask; | 146 | const char *path, *mask; |
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index e5eb335..3222c7e 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp | |||
@@ -122,24 +122,25 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target ) | |||
122 | 122 | ||
123 | if ( err == MAILIMAP_NO_ERROR ) { | 123 | if ( err == MAILIMAP_NO_ERROR ) { |
124 | 124 | ||
125 | mailimap_msg_att * msg_att; | 125 | mailimap_msg_att * msg_att; |
126 | int i = 0; | 126 | int i = 0; |
127 | for (current = clist_begin(result); current != 0; current=clist_next(current)) { | 127 | for (current = clist_begin(result); current != 0; current=clist_next(current)) { |
128 | ++i; | 128 | ++i; |
129 | msg_att = (mailimap_msg_att*)current->data; | 129 | msg_att = (mailimap_msg_att*)current->data; |
130 | RecMail*m = parse_list_result(msg_att); | 130 | RecMail*m = parse_list_result(msg_att); |
131 | if (m) { | 131 | if (m) { |
132 | m->setNumber(i); | 132 | m->setNumber(i); |
133 | m->setMbox(mailbox); | 133 | m->setMbox(mailbox); |
134 | m->setWrapper(this); | ||
134 | target.append(m); | 135 | target.append(m); |
135 | } | 136 | } |
136 | } | 137 | } |
137 | } else { | 138 | } else { |
138 | qDebug("Error fetching headers: %s",m_imap->imap_response); | 139 | qDebug("Error fetching headers: %s",m_imap->imap_response); |
139 | } | 140 | } |
140 | mailimap_fetch_list_free(result); | 141 | mailimap_fetch_list_free(result); |
141 | } | 142 | } |
142 | 143 | ||
143 | QList<Folder>* IMAPwrapper::listFolders() | 144 | QList<Folder>* IMAPwrapper::listFolders() |
144 | { | 145 | { |
145 | const char *path, *mask; | 146 | const char *path, *mask; |
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.cpp b/noncore/net/mail/libmailwrapper/mailtypes.cpp index 5cd45ed..94f5d6f 100644 --- a/noncore/net/mail/libmailwrapper/mailtypes.cpp +++ b/noncore/net/mail/libmailwrapper/mailtypes.cpp | |||
@@ -6,44 +6,61 @@ RecMail::RecMail() | |||
6 | { | 6 | { |
7 | init(); | 7 | init(); |
8 | } | 8 | } |
9 | 9 | ||
10 | RecMail::RecMail(const RecMail&old) | 10 | RecMail::RecMail(const RecMail&old) |
11 | :subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7) | 11 | :subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7) |
12 | { | 12 | { |
13 | init(); | 13 | init(); |
14 | copy_old(old); | 14 | copy_old(old); |
15 | qDebug("Copy constructor RecMail"); | 15 | qDebug("Copy constructor RecMail"); |
16 | } | 16 | } |
17 | 17 | ||
18 | RecMail::~RecMail() | ||
19 | { | ||
20 | wrapper = 0; | ||
21 | } | ||
22 | |||
18 | void RecMail::copy_old(const RecMail&old) | 23 | void RecMail::copy_old(const RecMail&old) |
19 | { | 24 | { |
20 | subject = old.subject; | 25 | subject = old.subject; |
21 | date = old.date; | 26 | date = old.date; |
22 | mbox = old.mbox; | 27 | mbox = old.mbox; |
23 | msg_id = old.msg_id; | 28 | msg_id = old.msg_id; |
24 | msg_size = old.msg_size; | 29 | msg_size = old.msg_size; |
25 | msg_number = old.msg_number; | 30 | msg_number = old.msg_number; |
26 | from = old.from; | 31 | from = old.from; |
27 | msg_flags = old.msg_flags; | 32 | msg_flags = old.msg_flags; |
28 | to = old.to; | 33 | to = old.to; |
29 | cc = old.cc; | 34 | cc = old.cc; |
30 | bcc = old.bcc; | 35 | bcc = old.bcc; |
36 | wrapper = old.wrapper; | ||
31 | } | 37 | } |
32 | 38 | ||
33 | void RecMail::init() | 39 | void RecMail::init() |
34 | { | 40 | { |
35 | to.clear(); | 41 | to.clear(); |
36 | cc.clear(); | 42 | cc.clear(); |
37 | bcc.clear(); | 43 | bcc.clear(); |
44 | wrapper = 0; | ||
45 | } | ||
46 | |||
47 | void RecMail::setWrapper(AbstractMail*awrapper) | ||
48 | { | ||
49 | wrapper = awrapper; | ||
50 | } | ||
51 | |||
52 | AbstractMail* RecMail::Wrapper() | ||
53 | { | ||
54 | return wrapper; | ||
38 | } | 55 | } |
39 | 56 | ||
40 | void RecMail::setTo(const QStringList&list) | 57 | void RecMail::setTo(const QStringList&list) |
41 | { | 58 | { |
42 | to = list; | 59 | to = list; |
43 | } | 60 | } |
44 | 61 | ||
45 | const QStringList&RecMail::To()const | 62 | const QStringList&RecMail::To()const |
46 | { | 63 | { |
47 | return to; | 64 | return to; |
48 | } | 65 | } |
49 | 66 | ||
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.h b/noncore/net/mail/libmailwrapper/mailtypes.h index 24518cf..9ef762d 100644 --- a/noncore/net/mail/libmailwrapper/mailtypes.h +++ b/noncore/net/mail/libmailwrapper/mailtypes.h | |||
@@ -6,42 +6,43 @@ | |||
6 | #define FLAG_DELETED 2 | 6 | #define FLAG_DELETED 2 |
7 | #define FLAG_SEEN 3 | 7 | #define FLAG_SEEN 3 |
8 | #define FLAG_DRAFT 4 | 8 | #define FLAG_DRAFT 4 |
9 | #define FLAG_RECENT 5 | 9 | #define FLAG_RECENT 5 |
10 | 10 | ||
11 | #include <qlist.h> | 11 | #include <qlist.h> |
12 | #include <qbitarray.h> | 12 | #include <qbitarray.h> |
13 | #include <qstring.h> | 13 | #include <qstring.h> |
14 | #include <qstringlist.h> | 14 | #include <qstringlist.h> |
15 | #include <qmap.h> | 15 | #include <qmap.h> |
16 | #include <qvaluelist.h> | 16 | #include <qvaluelist.h> |
17 | 17 | ||
18 | class AbstractMail; | ||
18 | /* a class to describe mails in a mailbox */ | 19 | /* a class to describe mails in a mailbox */ |
19 | /* Attention! | 20 | /* Attention! |
20 | From programmers point of view it would make sense to | 21 | From programmers point of view it would make sense to |
21 | store the mail body into this class, too. | 22 | store the mail body into this class, too. |
22 | But: not from the point of view of the device. | 23 | But: not from the point of view of the device. |
23 | Mailbodies can be real large. So we request them when | 24 | Mailbodies can be real large. So we request them when |
24 | needed from the mail-wrapper class direct from the server itself | 25 | needed from the mail-wrapper class direct from the server itself |
25 | (imap) or from a file-based cache (pop3?) | 26 | (imap) or from a file-based cache (pop3?) |
26 | So there is no interface "const QString&body()" but you should | 27 | So there is no interface "const QString&body()" but you should |
27 | make a request to the mailwrapper with this class as parameter to | 28 | make a request to the mailwrapper with this class as parameter to |
28 | get the body. Same words for the attachments. | 29 | get the body. Same words for the attachments. |
29 | */ | 30 | */ |
30 | class RecMail | 31 | class RecMail |
31 | { | 32 | { |
32 | public: | 33 | public: |
33 | RecMail(); | 34 | RecMail(); |
34 | RecMail(const RecMail&old); | 35 | RecMail(const RecMail&old); |
35 | virtual ~RecMail(){} | 36 | virtual ~RecMail(); |
36 | 37 | ||
37 | const int getNumber()const{return msg_number;} | 38 | const int getNumber()const{return msg_number;} |
38 | void setNumber(int number){msg_number=number;} | 39 | void setNumber(int number){msg_number=number;} |
39 | const QString&getDate()const{ return date; } | 40 | const QString&getDate()const{ return date; } |
40 | void setDate( const QString&a ) { date = a; } | 41 | void setDate( const QString&a ) { date = a; } |
41 | const QString&getFrom()const{ return from; } | 42 | const QString&getFrom()const{ return from; } |
42 | void setFrom( const QString&a ) { from = a; } | 43 | void setFrom( const QString&a ) { from = a; } |
43 | const QString&getSubject()const { return subject; } | 44 | const QString&getSubject()const { return subject; } |
44 | void setSubject( const QString&s ) { subject = s; } | 45 | void setSubject( const QString&s ) { subject = s; } |
45 | const QString&getMbox()const{return mbox;} | 46 | const QString&getMbox()const{return mbox;} |
46 | void setMbox(const QString&box){mbox = box;} | 47 | void setMbox(const QString&box){mbox = box;} |
47 | void setMsgid(const QString&id){msg_id=id;} | 48 | void setMsgid(const QString&id){msg_id=id;} |
@@ -51,30 +52,34 @@ public: | |||
51 | void setMsgsize(int size){msg_size = size;} | 52 | void setMsgsize(int size){msg_size = size;} |
52 | const int Msgsize()const{return msg_size;} | 53 | const int Msgsize()const{return msg_size;} |
53 | 54 | ||
54 | 55 | ||
55 | void setTo(const QStringList&list); | 56 | void setTo(const QStringList&list); |
56 | const QStringList&To()const; | 57 | const QStringList&To()const; |
57 | void setCC(const QStringList&list); | 58 | void setCC(const QStringList&list); |
58 | const QStringList&CC()const; | 59 | const QStringList&CC()const; |
59 | void setBcc(const QStringList&list); | 60 | void setBcc(const QStringList&list); |
60 | const QStringList&Bcc()const; | 61 | const QStringList&Bcc()const; |
61 | const QBitArray&getFlags()const{return msg_flags;} | 62 | const QBitArray&getFlags()const{return msg_flags;} |
62 | void setFlags(const QBitArray&flags){msg_flags = flags;} | 63 | void setFlags(const QBitArray&flags){msg_flags = flags;} |
64 | |||
65 | void setWrapper(AbstractMail*wrapper); | ||
66 | AbstractMail* Wrapper(); | ||
63 | 67 | ||
64 | protected: | 68 | protected: |
65 | QString subject,date,from,mbox,msg_id,replyto; | 69 | QString subject,date,from,mbox,msg_id,replyto; |
66 | int msg_number,msg_size; | 70 | int msg_number,msg_size; |
67 | QBitArray msg_flags; | 71 | QBitArray msg_flags; |
68 | QStringList to,cc,bcc; | 72 | QStringList to,cc,bcc; |
73 | AbstractMail*wrapper; | ||
69 | void init(); | 74 | void init(); |
70 | void copy_old(const RecMail&old); | 75 | void copy_old(const RecMail&old); |
71 | }; | 76 | }; |
72 | 77 | ||
73 | typedef QMap<QString,QString> part_plist_t; | 78 | typedef QMap<QString,QString> part_plist_t; |
74 | 79 | ||
75 | class RecPart | 80 | class RecPart |
76 | { | 81 | { |
77 | protected: | 82 | protected: |
78 | QString m_type,m_subtype,m_identifier,m_encoding; | 83 | QString m_type,m_subtype,m_identifier,m_encoding; |
79 | unsigned int m_lines,m_size; | 84 | unsigned int m_lines,m_size; |
80 | part_plist_t m_Parameters; | 85 | part_plist_t m_Parameters; |
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp index 49c3b7a..903ef4d 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp | |||
@@ -72,24 +72,25 @@ void POP3wrapper::listMessages(const QString &, QList<RecMail> &target ) | |||
72 | 72 | ||
73 | for ( int i = carray_count( messages ); i > 0; i-- ) { | 73 | for ( int i = carray_count( messages ); i > 0; i-- ) { |
74 | mailpop3_msg_info *info = (mailpop3_msg_info *) carray_get( messages, i - 1 ); | 74 | mailpop3_msg_info *info = (mailpop3_msg_info *) carray_get( messages, i - 1 ); |
75 | 75 | ||
76 | err = mailpop3_header( m_pop3, info->msg_index, &header, &length ); | 76 | err = mailpop3_header( m_pop3, info->msg_index, &header, &length ); |
77 | if ( err != MAILPOP3_NO_ERROR ) { | 77 | if ( err != MAILPOP3_NO_ERROR ) { |
78 | qDebug( "POP3: error retrieving header msgid: %i", info->msg_index ); | 78 | qDebug( "POP3: error retrieving header msgid: %i", info->msg_index ); |
79 | logout(); | 79 | logout(); |
80 | return; | 80 | return; |
81 | } | 81 | } |
82 | RecMail *mail = parseHeader( header ); | 82 | RecMail *mail = parseHeader( header ); |
83 | mail->setNumber( info->msg_index ); | 83 | mail->setNumber( info->msg_index ); |
84 | mail->setWrapper(this); | ||
84 | target.append( mail ); | 85 | target.append( mail ); |
85 | } | 86 | } |
86 | 87 | ||
87 | logout(); | 88 | logout(); |
88 | } | 89 | } |
89 | 90 | ||
90 | RecMail *POP3wrapper::parseHeader( const char *header ) | 91 | RecMail *POP3wrapper::parseHeader( const char *header ) |
91 | { | 92 | { |
92 | int err = MAILIMF_NO_ERROR; | 93 | int err = MAILIMF_NO_ERROR; |
93 | size_t curTok; | 94 | size_t curTok; |
94 | RecMail *mail = new RecMail(); | 95 | RecMail *mail = new RecMail(); |
95 | mailimf_fields *fields; | 96 | mailimf_fields *fields; |
diff --git a/noncore/net/mail/mailtypes.cpp b/noncore/net/mail/mailtypes.cpp index 5cd45ed..94f5d6f 100644 --- a/noncore/net/mail/mailtypes.cpp +++ b/noncore/net/mail/mailtypes.cpp | |||
@@ -6,44 +6,61 @@ RecMail::RecMail() | |||
6 | { | 6 | { |
7 | init(); | 7 | init(); |
8 | } | 8 | } |
9 | 9 | ||
10 | RecMail::RecMail(const RecMail&old) | 10 | RecMail::RecMail(const RecMail&old) |
11 | :subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7) | 11 | :subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7) |
12 | { | 12 | { |
13 | init(); | 13 | init(); |
14 | copy_old(old); | 14 | copy_old(old); |
15 | qDebug("Copy constructor RecMail"); | 15 | qDebug("Copy constructor RecMail"); |
16 | } | 16 | } |
17 | 17 | ||
18 | RecMail::~RecMail() | ||
19 | { | ||
20 | wrapper = 0; | ||
21 | } | ||
22 | |||
18 | void RecMail::copy_old(const RecMail&old) | 23 | void RecMail::copy_old(const RecMail&old) |
19 | { | 24 | { |
20 | subject = old.subject; | 25 | subject = old.subject; |
21 | date = old.date; | 26 | date = old.date; |
22 | mbox = old.mbox; | 27 | mbox = old.mbox; |
23 | msg_id = old.msg_id; | 28 | msg_id = old.msg_id; |
24 | msg_size = old.msg_size; | 29 | msg_size = old.msg_size; |
25 | msg_number = old.msg_number; | 30 | msg_number = old.msg_number; |
26 | from = old.from; | 31 | from = old.from; |
27 | msg_flags = old.msg_flags; | 32 | msg_flags = old.msg_flags; |
28 | to = old.to; | 33 | to = old.to; |
29 | cc = old.cc; | 34 | cc = old.cc; |
30 | bcc = old.bcc; | 35 | bcc = old.bcc; |
36 | wrapper = old.wrapper; | ||
31 | } | 37 | } |
32 | 38 | ||
33 | void RecMail::init() | 39 | void RecMail::init() |
34 | { | 40 | { |
35 | to.clear(); | 41 | to.clear(); |
36 | cc.clear(); | 42 | cc.clear(); |
37 | bcc.clear(); | 43 | bcc.clear(); |
44 | wrapper = 0; | ||
45 | } | ||
46 | |||
47 | void RecMail::setWrapper(AbstractMail*awrapper) | ||
48 | { | ||
49 | wrapper = awrapper; | ||
50 | } | ||
51 | |||
52 | AbstractMail* RecMail::Wrapper() | ||
53 | { | ||
54 | return wrapper; | ||
38 | } | 55 | } |
39 | 56 | ||
40 | void RecMail::setTo(const QStringList&list) | 57 | void RecMail::setTo(const QStringList&list) |
41 | { | 58 | { |
42 | to = list; | 59 | to = list; |
43 | } | 60 | } |
44 | 61 | ||
45 | const QStringList&RecMail::To()const | 62 | const QStringList&RecMail::To()const |
46 | { | 63 | { |
47 | return to; | 64 | return to; |
48 | } | 65 | } |
49 | 66 | ||
diff --git a/noncore/net/mail/mailtypes.h b/noncore/net/mail/mailtypes.h index 24518cf..9ef762d 100644 --- a/noncore/net/mail/mailtypes.h +++ b/noncore/net/mail/mailtypes.h | |||
@@ -6,42 +6,43 @@ | |||
6 | #define FLAG_DELETED 2 | 6 | #define FLAG_DELETED 2 |
7 | #define FLAG_SEEN 3 | 7 | #define FLAG_SEEN 3 |
8 | #define FLAG_DRAFT 4 | 8 | #define FLAG_DRAFT 4 |
9 | #define FLAG_RECENT 5 | 9 | #define FLAG_RECENT 5 |
10 | 10 | ||
11 | #include <qlist.h> | 11 | #include <qlist.h> |
12 | #include <qbitarray.h> | 12 | #include <qbitarray.h> |
13 | #include <qstring.h> | 13 | #include <qstring.h> |
14 | #include <qstringlist.h> | 14 | #include <qstringlist.h> |
15 | #include <qmap.h> | 15 | #include <qmap.h> |
16 | #include <qvaluelist.h> | 16 | #include <qvaluelist.h> |
17 | 17 | ||
18 | class AbstractMail; | ||
18 | /* a class to describe mails in a mailbox */ | 19 | /* a class to describe mails in a mailbox */ |
19 | /* Attention! | 20 | /* Attention! |
20 | From programmers point of view it would make sense to | 21 | From programmers point of view it would make sense to |
21 | store the mail body into this class, too. | 22 | store the mail body into this class, too. |
22 | But: not from the point of view of the device. | 23 | But: not from the point of view of the device. |
23 | Mailbodies can be real large. So we request them when | 24 | Mailbodies can be real large. So we request them when |
24 | needed from the mail-wrapper class direct from the server itself | 25 | needed from the mail-wrapper class direct from the server itself |
25 | (imap) or from a file-based cache (pop3?) | 26 | (imap) or from a file-based cache (pop3?) |
26 | So there is no interface "const QString&body()" but you should | 27 | So there is no interface "const QString&body()" but you should |
27 | make a request to the mailwrapper with this class as parameter to | 28 | make a request to the mailwrapper with this class as parameter to |
28 | get the body. Same words for the attachments. | 29 | get the body. Same words for the attachments. |
29 | */ | 30 | */ |
30 | class RecMail | 31 | class RecMail |
31 | { | 32 | { |
32 | public: | 33 | public: |
33 | RecMail(); | 34 | RecMail(); |
34 | RecMail(const RecMail&old); | 35 | RecMail(const RecMail&old); |
35 | virtual ~RecMail(){} | 36 | virtual ~RecMail(); |
36 | 37 | ||
37 | const int getNumber()const{return msg_number;} | 38 | const int getNumber()const{return msg_number;} |
38 | void setNumber(int number){msg_number=number;} | 39 | void setNumber(int number){msg_number=number;} |
39 | const QString&getDate()const{ return date; } | 40 | const QString&getDate()const{ return date; } |
40 | void setDate( const QString&a ) { date = a; } | 41 | void setDate( const QString&a ) { date = a; } |
41 | const QString&getFrom()const{ return from; } | 42 | const QString&getFrom()const{ return from; } |
42 | void setFrom( const QString&a ) { from = a; } | 43 | void setFrom( const QString&a ) { from = a; } |
43 | const QString&getSubject()const { return subject; } | 44 | const QString&getSubject()const { return subject; } |
44 | void setSubject( const QString&s ) { subject = s; } | 45 | void setSubject( const QString&s ) { subject = s; } |
45 | const QString&getMbox()const{return mbox;} | 46 | const QString&getMbox()const{return mbox;} |
46 | void setMbox(const QString&box){mbox = box;} | 47 | void setMbox(const QString&box){mbox = box;} |
47 | void setMsgid(const QString&id){msg_id=id;} | 48 | void setMsgid(const QString&id){msg_id=id;} |
@@ -51,30 +52,34 @@ public: | |||
51 | void setMsgsize(int size){msg_size = size;} | 52 | void setMsgsize(int size){msg_size = size;} |
52 | const int Msgsize()const{return msg_size;} | 53 | const int Msgsize()const{return msg_size;} |
53 | 54 | ||
54 | 55 | ||
55 | void setTo(const QStringList&list); | 56 | void setTo(const QStringList&list); |
56 | const QStringList&To()const; | 57 | const QStringList&To()const; |
57 | void setCC(const QStringList&list); | 58 | void setCC(const QStringList&list); |
58 | const QStringList&CC()const; | 59 | const QStringList&CC()const; |
59 | void setBcc(const QStringList&list); | 60 | void setBcc(const QStringList&list); |
60 | const QStringList&Bcc()const; | 61 | const QStringList&Bcc()const; |
61 | const QBitArray&getFlags()const{return msg_flags;} | 62 | const QBitArray&getFlags()const{return msg_flags;} |
62 | void setFlags(const QBitArray&flags){msg_flags = flags;} | 63 | void setFlags(const QBitArray&flags){msg_flags = flags;} |
64 | |||
65 | void setWrapper(AbstractMail*wrapper); | ||
66 | AbstractMail* Wrapper(); | ||
63 | 67 | ||
64 | protected: | 68 | protected: |
65 | QString subject,date,from,mbox,msg_id,replyto; | 69 | QString subject,date,from,mbox,msg_id,replyto; |
66 | int msg_number,msg_size; | 70 | int msg_number,msg_size; |
67 | QBitArray msg_flags; | 71 | QBitArray msg_flags; |
68 | QStringList to,cc,bcc; | 72 | QStringList to,cc,bcc; |
73 | AbstractMail*wrapper; | ||
69 | void init(); | 74 | void init(); |
70 | void copy_old(const RecMail&old); | 75 | void copy_old(const RecMail&old); |
71 | }; | 76 | }; |
72 | 77 | ||
73 | typedef QMap<QString,QString> part_plist_t; | 78 | typedef QMap<QString,QString> part_plist_t; |
74 | 79 | ||
75 | class RecPart | 80 | class RecPart |
76 | { | 81 | { |
77 | protected: | 82 | protected: |
78 | QString m_type,m_subtype,m_identifier,m_encoding; | 83 | QString m_type,m_subtype,m_identifier,m_encoding; |
79 | unsigned int m_lines,m_size; | 84 | unsigned int m_lines,m_size; |
80 | part_plist_t m_Parameters; | 85 | part_plist_t m_Parameters; |
diff --git a/noncore/net/mail/pop3wrapper.cpp b/noncore/net/mail/pop3wrapper.cpp index 49c3b7a..903ef4d 100644 --- a/noncore/net/mail/pop3wrapper.cpp +++ b/noncore/net/mail/pop3wrapper.cpp | |||
@@ -72,24 +72,25 @@ void POP3wrapper::listMessages(const QString &, QList<RecMail> &target ) | |||
72 | 72 | ||
73 | for ( int i = carray_count( messages ); i > 0; i-- ) { | 73 | for ( int i = carray_count( messages ); i > 0; i-- ) { |
74 | mailpop3_msg_info *info = (mailpop3_msg_info *) carray_get( messages, i - 1 ); | 74 | mailpop3_msg_info *info = (mailpop3_msg_info *) carray_get( messages, i - 1 ); |
75 | 75 | ||
76 | err = mailpop3_header( m_pop3, info->msg_index, &header, &length ); | 76 | err = mailpop3_header( m_pop3, info->msg_index, &header, &length ); |
77 | if ( err != MAILPOP3_NO_ERROR ) { | 77 | if ( err != MAILPOP3_NO_ERROR ) { |
78 | qDebug( "POP3: error retrieving header msgid: %i", info->msg_index ); | 78 | qDebug( "POP3: error retrieving header msgid: %i", info->msg_index ); |
79 | logout(); | 79 | logout(); |
80 | return; | 80 | return; |
81 | } | 81 | } |
82 | RecMail *mail = parseHeader( header ); | 82 | RecMail *mail = parseHeader( header ); |
83 | mail->setNumber( info->msg_index ); | 83 | mail->setNumber( info->msg_index ); |
84 | mail->setWrapper(this); | ||
84 | target.append( mail ); | 85 | target.append( mail ); |
85 | } | 86 | } |
86 | 87 | ||
87 | logout(); | 88 | logout(); |
88 | } | 89 | } |
89 | 90 | ||
90 | RecMail *POP3wrapper::parseHeader( const char *header ) | 91 | RecMail *POP3wrapper::parseHeader( const char *header ) |
91 | { | 92 | { |
92 | int err = MAILIMF_NO_ERROR; | 93 | int err = MAILIMF_NO_ERROR; |
93 | size_t curTok; | 94 | size_t curTok; |
94 | RecMail *mail = new RecMail(); | 95 | RecMail *mail = new RecMail(); |
95 | mailimf_fields *fields; | 96 | mailimf_fields *fields; |