Diffstat (limited to 'noncore/net/mail/libmailwrapper/mailtypes.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailtypes.cpp | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.cpp b/noncore/net/mail/libmailwrapper/mailtypes.cpp index d4395a2..b009b75 100644 --- a/noncore/net/mail/libmailwrapper/mailtypes.cpp +++ b/noncore/net/mail/libmailwrapper/mailtypes.cpp | |||
@@ -1,35 +1,37 @@ | |||
1 | #include "mailtypes.h" | 1 | #include "mailtypes.h" |
2 | 2 | ||
3 | #include <opie2/odebug.h> | 3 | #include <opie2/odebug.h> |
4 | #include <qpe/timestring.h> | ||
4 | 5 | ||
5 | #include <stdlib.h> | 6 | #include <stdlib.h> |
6 | 7 | ||
7 | using namespace Opie::Core; | 8 | using namespace Opie::Core; |
8 | RecMail::RecMail() | 9 | RecMail::RecMail() |
9 | :Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7) | 10 | :Opie::Core::ORefCount(),subject(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7),maildate(),date("") |
10 | { | 11 | { |
11 | init(); | 12 | init(); |
12 | } | 13 | } |
13 | 14 | ||
14 | RecMail::RecMail(const RecMail&old) | 15 | RecMail::RecMail(const RecMail&old) |
15 | :Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7) | 16 | :Opie::Core::ORefCount(),subject(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7),maildate(),date("") |
16 | { | 17 | { |
17 | init(); | 18 | init(); |
18 | copy_old(old); | 19 | copy_old(old); |
19 | odebug << "Copy constructor RecMail" << oendl; | 20 | odebug << "Copy constructor RecMail" << oendl; |
20 | } | 21 | } |
21 | 22 | ||
22 | RecMail::~RecMail() | 23 | RecMail::~RecMail() |
23 | { | 24 | { |
24 | wrapper = 0; | 25 | wrapper = 0; |
25 | } | 26 | } |
26 | 27 | ||
27 | void RecMail::copy_old(const RecMail&old) | 28 | void RecMail::copy_old(const RecMail&old) |
28 | { | 29 | { |
29 | subject = old.subject; | 30 | subject = old.subject; |
31 | maildate = old.maildate; | ||
30 | date = old.date; | 32 | date = old.date; |
31 | mbox = old.mbox; | 33 | mbox = old.mbox; |
32 | msg_id = old.msg_id; | 34 | msg_id = old.msg_id; |
33 | msg_size = old.msg_size; | 35 | msg_size = old.msg_size; |
34 | msg_number = old.msg_number; | 36 | msg_number = old.msg_number; |
35 | from = old.from; | 37 | from = old.from; |
@@ -50,12 +52,23 @@ void RecMail::init() | |||
50 | bcc.clear(); | 52 | bcc.clear(); |
51 | in_reply_to.clear(); | 53 | in_reply_to.clear(); |
52 | references.clear(); | 54 | references.clear(); |
53 | wrapper = 0; | 55 | wrapper = 0; |
54 | } | 56 | } |
55 | 57 | ||
58 | void RecMail::setDate( const QDateTime&a,int offset) | ||
59 | { | ||
60 | QString timestring = TimeString::numberDateString(a.date())+" "; | ||
61 | timestring+=TimeString::timeString(a.time()); | ||
62 | if (offset > 0) { | ||
63 | timestring.sprintf(timestring+" %+05i",offset); | ||
64 | } | ||
65 | date = timestring; | ||
66 | maildate = a; | ||
67 | } | ||
68 | |||
56 | void RecMail::setWrapper(AbstractMail*awrapper) | 69 | void RecMail::setWrapper(AbstractMail*awrapper) |
57 | { | 70 | { |
58 | wrapper = awrapper; | 71 | wrapper = awrapper; |
59 | } | 72 | } |
60 | 73 | ||
61 | AbstractMail* RecMail::Wrapper() | 74 | AbstractMail* RecMail::Wrapper() |
@@ -131,13 +144,13 @@ RecPart::RecPart(const RecPart&old) | |||
131 | m_encoding = old.m_encoding; | 144 | m_encoding = old.m_encoding; |
132 | m_description = old.m_description; | 145 | m_description = old.m_description; |
133 | m_lines = old.m_lines; | 146 | m_lines = old.m_lines; |
134 | m_size = old.m_size; | 147 | m_size = old.m_size; |
135 | m_Parameters = old.m_Parameters; | 148 | m_Parameters = old.m_Parameters; |
136 | m_poslist = old.m_poslist; | 149 | m_poslist = old.m_poslist; |
137 | odebug << "RecPart copy constructor" << oendl; | 150 | odebug << "RecPart copy constructor" << oendl; |
138 | } | 151 | } |
139 | 152 | ||
140 | RecPart::~RecPart() | 153 | RecPart::~RecPart() |
141 | { | 154 | { |
142 | } | 155 | } |
143 | 156 | ||
@@ -255,13 +268,13 @@ RecBody::RecBody() | |||
255 | RecBody::RecBody(const RecBody&old) | 268 | RecBody::RecBody(const RecBody&old) |
256 | :Opie::Core::ORefCount(),m_BodyText(),m_PartsList(),m_description(new RecPart()) | 269 | :Opie::Core::ORefCount(),m_BodyText(),m_PartsList(),m_description(new RecPart()) |
257 | { | 270 | { |
258 | m_BodyText = old.m_BodyText; | 271 | m_BodyText = old.m_BodyText; |
259 | m_PartsList = old.m_PartsList; | 272 | m_PartsList = old.m_PartsList; |
260 | m_description = old.m_description; | 273 | m_description = old.m_description; |
261 | odebug << "Recbody copy constructor" << oendl; | 274 | odebug << "Recbody copy constructor" << oendl; |
262 | } | 275 | } |
263 | 276 | ||
264 | RecBody::~RecBody() | 277 | RecBody::~RecBody() |
265 | { | 278 | { |
266 | } | 279 | } |
267 | 280 | ||
@@ -320,20 +333,20 @@ encodedString::encodedString(char*nContent,unsigned int nSize) | |||
320 | } | 333 | } |
321 | 334 | ||
322 | encodedString::encodedString(const encodedString&old) | 335 | encodedString::encodedString(const encodedString&old) |
323 | { | 336 | { |
324 | init(); | 337 | init(); |
325 | copy_old(old); | 338 | copy_old(old); |
326 | odebug << "encodedeString: copy constructor!" << oendl; | 339 | odebug << "encodedeString: copy constructor!" << oendl; |
327 | } | 340 | } |
328 | 341 | ||
329 | encodedString& encodedString::operator=(const encodedString&old) | 342 | encodedString& encodedString::operator=(const encodedString&old) |
330 | { | 343 | { |
331 | init(); | 344 | init(); |
332 | copy_old(old); | 345 | copy_old(old); |
333 | odebug << "encodedString: assign operator!" << oendl; | 346 | odebug << "encodedString: assign operator!" << oendl; |
334 | return *this; | 347 | return *this; |
335 | } | 348 | } |
336 | 349 | ||
337 | encodedString::~encodedString() | 350 | encodedString::~encodedString() |
338 | { | 351 | { |
339 | clean(); | 352 | clean(); |
@@ -393,7 +406,6 @@ folderStat&folderStat::operator=(const folderStat&old) | |||
393 | { | 406 | { |
394 | message_count = old.message_count; | 407 | message_count = old.message_count; |
395 | message_unseen = old.message_unseen; | 408 | message_unseen = old.message_unseen; |
396 | message_recent = old.message_recent; | 409 | message_recent = old.message_recent; |
397 | return *this; | 410 | return *this; |
398 | } | 411 | } |
399 | |||