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,41 +1,43 @@ | |||
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; |
36 | msg_flags = old.msg_flags; | 38 | msg_flags = old.msg_flags; |
37 | to = old.to; | 39 | to = old.to; |
38 | cc = old.cc; | 40 | cc = old.cc; |
39 | bcc = old.bcc; | 41 | bcc = old.bcc; |
40 | wrapper = old.wrapper; | 42 | wrapper = old.wrapper; |
41 | in_reply_to = old.in_reply_to; | 43 | in_reply_to = old.in_reply_to; |
@@ -44,24 +46,35 @@ void RecMail::copy_old(const RecMail&old) | |||
44 | } | 46 | } |
45 | 47 | ||
46 | void RecMail::init() | 48 | void RecMail::init() |
47 | { | 49 | { |
48 | to.clear(); | 50 | to.clear(); |
49 | cc.clear(); | 51 | cc.clear(); |
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() |
62 | { | 75 | { |
63 | return wrapper; | 76 | return wrapper; |
64 | } | 77 | } |
65 | 78 | ||
66 | void RecMail::setTo(const QStringList&list) | 79 | void RecMail::setTo(const QStringList&list) |
67 | { | 80 | { |
@@ -125,25 +138,25 @@ RecPart::RecPart(const RecPart&old) | |||
125 | : Opie::Core::ORefCount(), | 138 | : Opie::Core::ORefCount(), |
126 | m_type(""),m_subtype(""),m_identifier(""),m_encoding(""),m_description(""),m_lines(0),m_size(0) | 139 | m_type(""),m_subtype(""),m_identifier(""),m_encoding(""),m_description(""),m_lines(0),m_size(0) |
127 | { | 140 | { |
128 | m_type = old.m_type; | 141 | m_type = old.m_type; |
129 | m_subtype = old.m_subtype; | 142 | m_subtype = old.m_subtype; |
130 | m_identifier = old.m_identifier; | 143 | m_identifier = old.m_identifier; |
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 | ||
144 | void RecPart::setSize(unsigned int size) | 157 | void RecPart::setSize(unsigned int size) |
145 | { | 158 | { |
146 | m_size = size; | 159 | m_size = size; |
147 | } | 160 | } |
148 | 161 | ||
149 | const unsigned int RecPart::Size()const | 162 | const unsigned int RecPart::Size()const |
@@ -249,25 +262,25 @@ const QValueList<int>& RecPart::Positionlist()const | |||
249 | RecBody::RecBody() | 262 | RecBody::RecBody() |
250 | : Opie::Core::ORefCount(),m_BodyText(),m_description(new RecPart()) | 263 | : Opie::Core::ORefCount(),m_BodyText(),m_description(new RecPart()) |
251 | { | 264 | { |
252 | m_PartsList.clear(); | 265 | m_PartsList.clear(); |
253 | } | 266 | } |
254 | 267 | ||
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 | ||
268 | void RecBody::setBodytext(const QString&bodyText) | 281 | void RecBody::setBodytext(const QString&bodyText) |
269 | { | 282 | { |
270 | m_BodyText = bodyText; | 283 | m_BodyText = bodyText; |
271 | } | 284 | } |
272 | 285 | ||
273 | const QString& RecBody::Bodytext()const | 286 | const QString& RecBody::Bodytext()const |
@@ -314,32 +327,32 @@ encodedString::encodedString(const char*nContent,unsigned int nSize) | |||
314 | } | 327 | } |
315 | 328 | ||
316 | encodedString::encodedString(char*nContent,unsigned int nSize) | 329 | encodedString::encodedString(char*nContent,unsigned int nSize) |
317 | { | 330 | { |
318 | init(); | 331 | init(); |
319 | setContent(nContent,nSize); | 332 | setContent(nContent,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(); |
340 | } | 353 | } |
341 | 354 | ||
342 | void encodedString::init() | 355 | void encodedString::init() |
343 | { | 356 | { |
344 | content = 0; | 357 | content = 0; |
345 | size = 0; | 358 | size = 0; |
@@ -387,13 +400,12 @@ void encodedString::setContent(char*nContent,int nSize) | |||
387 | { | 400 | { |
388 | content = nContent; | 401 | content = nContent; |
389 | size = nSize; | 402 | size = nSize; |
390 | } | 403 | } |
391 | 404 | ||
392 | folderStat&folderStat::operator=(const folderStat&old) | 405 | 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 | |||