Diffstat (limited to 'kmicromail/libmailwrapper/mailtypes.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | kmicromail/libmailwrapper/mailtypes.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/kmicromail/libmailwrapper/mailtypes.cpp b/kmicromail/libmailwrapper/mailtypes.cpp index d43bdc6..1a4ffd1 100644 --- a/kmicromail/libmailwrapper/mailtypes.cpp +++ b/kmicromail/libmailwrapper/mailtypes.cpp | |||
@@ -2,49 +2,72 @@ | |||
2 | 2 | ||
3 | //#include <opie2/odebug.h> | 3 | //#include <opie2/odebug.h> |
4 | 4 | ||
5 | #include <stdlib.h> | 5 | #include <stdlib.h> |
6 | 6 | ||
7 | using namespace Opie::Core; | 7 | using namespace Opie::Core; |
8 | RecMail::RecMail() | 8 | RecMail::RecMail() |
9 | :Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7) | 9 | :Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7) |
10 | { | 10 | { |
11 | init(); | 11 | init(); |
12 | } | 12 | } |
13 | 13 | ||
14 | RecMail::RecMail(const RecMail&old) | 14 | RecMail::RecMail(const RecMail&old) |
15 | :Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7) | 15 | :Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7) |
16 | { | 16 | { |
17 | init(); | 17 | init(); |
18 | copy_old(old); | 18 | copy_old(old); |
19 | // odebug << "Copy constructor RecMail" << oendl; | 19 | // odebug << "Copy constructor RecMail" << oendl; |
20 | } | 20 | } |
21 | 21 | ||
22 | RecMail::~RecMail() | 22 | RecMail::~RecMail() |
23 | { | 23 | { |
24 | wrapper = 0; | 24 | wrapper = 0; |
25 | } | 25 | } |
26 | static bool stringCompareRec( const QString& s1, const QString& s2 ) | ||
27 | { | ||
28 | if ( s1.isEmpty() && s2.isEmpty() ) | ||
29 | return true; | ||
30 | return s1 == s2; | ||
31 | } | ||
32 | |||
33 | bool RecMail::isEqual( RecMail* r1 ) | ||
34 | { | ||
35 | if ( !stringCompareRec( isodate, r1->isodate ) ) { | ||
36 | // qDebug("date *%s* *%s* ", isodate.latin1(), r1->isodate.latin1()); | ||
37 | return false; | ||
38 | } | ||
39 | if ( !stringCompareRec( from, r1->from ) ) { | ||
40 | //qDebug("from *%s* *%s* ", from.latin1(), r1->from.latin1()); | ||
41 | return false; | ||
42 | } | ||
43 | if ( !stringCompareRec( subject, r1->subject ) ) { | ||
44 | //qDebug("sub "); | ||
45 | return false; | ||
46 | } | ||
26 | 47 | ||
48 | return true; | ||
49 | } | ||
27 | void RecMail::copy_old(const RecMail&old) | 50 | void RecMail::copy_old(const RecMail&old) |
28 | { | 51 | { |
29 | subject = old.subject; | 52 | subject = old.subject; |
30 | date = old.date; | 53 | date = old.date; |
31 | mbox = old.mbox; | 54 | mbox = old.mbox; |
32 | msg_id = old.msg_id; | 55 | msg_id = old.msg_id; |
33 | msg_size = old.msg_size; | 56 | msg_size = old.msg_size; |
34 | msg_number = old.msg_number; | 57 | msg_number = old.msg_number; |
35 | from = old.from; | 58 | from = old.from; |
36 | msg_flags = old.msg_flags; | 59 | msg_flags = old.msg_flags; |
37 | to = old.to; | 60 | to = old.to; |
38 | cc = old.cc; | 61 | cc = old.cc; |
39 | bcc = old.bcc; | 62 | bcc = old.bcc; |
40 | wrapper = old.wrapper; | 63 | wrapper = old.wrapper; |
41 | in_reply_to = old.in_reply_to; | 64 | in_reply_to = old.in_reply_to; |
42 | references = old.references; | 65 | references = old.references; |
43 | replyto = old.replyto; | 66 | replyto = old.replyto; |
44 | } | 67 | } |
45 | 68 | ||
46 | void RecMail::init() | 69 | void RecMail::init() |
47 | { | 70 | { |
48 | to.clear(); | 71 | to.clear(); |
49 | cc.clear(); | 72 | cc.clear(); |
50 | bcc.clear(); | 73 | bcc.clear(); |