Diffstat (limited to 'kmicromail/libmailwrapper/mailtypes.cpp') (more/less context) (ignore 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 | |||
@@ -1,122 +1,145 @@ | |||
1 | #include "mailtypes.h" | 1 | #include "mailtypes.h" |
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 | } | ||
26 | 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 | } | ||
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(); |
51 | in_reply_to.clear(); | 74 | in_reply_to.clear(); |
52 | references.clear(); | 75 | references.clear(); |
53 | wrapper = 0; | 76 | wrapper = 0; |
54 | } | 77 | } |
55 | 78 | ||
56 | void RecMail::setWrapper(AbstractMail*awrapper) | 79 | void RecMail::setWrapper(AbstractMail*awrapper) |
57 | { | 80 | { |
58 | wrapper = awrapper; | 81 | wrapper = awrapper; |
59 | } | 82 | } |
60 | 83 | ||
61 | AbstractMail* RecMail::Wrapper() | 84 | AbstractMail* RecMail::Wrapper() |
62 | { | 85 | { |
63 | return wrapper; | 86 | return wrapper; |
64 | } | 87 | } |
65 | 88 | ||
66 | void RecMail::setTo(const QStringList&list) | 89 | void RecMail::setTo(const QStringList&list) |
67 | { | 90 | { |
68 | to = list; | 91 | to = list; |
69 | } | 92 | } |
70 | 93 | ||
71 | const QStringList&RecMail::To()const | 94 | const QStringList&RecMail::To()const |
72 | { | 95 | { |
73 | return to; | 96 | return to; |
74 | } | 97 | } |
75 | 98 | ||
76 | void RecMail::setCC(const QStringList&list) | 99 | void RecMail::setCC(const QStringList&list) |
77 | { | 100 | { |
78 | cc = list; | 101 | cc = list; |
79 | } | 102 | } |
80 | 103 | ||
81 | const QStringList&RecMail::CC()const | 104 | const QStringList&RecMail::CC()const |
82 | { | 105 | { |
83 | return cc; | 106 | return cc; |
84 | } | 107 | } |
85 | 108 | ||
86 | void RecMail::setBcc(const QStringList&list) | 109 | void RecMail::setBcc(const QStringList&list) |
87 | { | 110 | { |
88 | bcc = list; | 111 | bcc = list; |
89 | } | 112 | } |
90 | 113 | ||
91 | const QStringList& RecMail::Bcc()const | 114 | const QStringList& RecMail::Bcc()const |
92 | { | 115 | { |
93 | return bcc; | 116 | return bcc; |
94 | } | 117 | } |
95 | 118 | ||
96 | void RecMail::setInreply(const QStringList&list) | 119 | void RecMail::setInreply(const QStringList&list) |
97 | { | 120 | { |
98 | in_reply_to = list; | 121 | in_reply_to = list; |
99 | } | 122 | } |
100 | 123 | ||
101 | const QStringList& RecMail::Inreply()const | 124 | const QStringList& RecMail::Inreply()const |
102 | { | 125 | { |
103 | return in_reply_to; | 126 | return in_reply_to; |
104 | } | 127 | } |
105 | 128 | ||
106 | void RecMail::setReferences(const QStringList&list) | 129 | void RecMail::setReferences(const QStringList&list) |
107 | { | 130 | { |
108 | references = list; | 131 | references = list; |
109 | } | 132 | } |
110 | 133 | ||
111 | const QStringList& RecMail::References()const | 134 | const QStringList& RecMail::References()const |
112 | { | 135 | { |
113 | return references; | 136 | return references; |
114 | } | 137 | } |
115 | 138 | ||
116 | RecPart::RecPart() | 139 | RecPart::RecPart() |
117 | : Opie::Core::ORefCount(), | 140 | : Opie::Core::ORefCount(), |
118 | m_type(""),m_subtype(""),m_identifier(""),m_encoding(""),m_description(""),m_lines(0),m_size(0) | 141 | m_type(""),m_subtype(""),m_identifier(""),m_encoding(""),m_description(""),m_lines(0),m_size(0) |
119 | { | 142 | { |
120 | m_Parameters.clear(); | 143 | m_Parameters.clear(); |
121 | m_poslist.clear(); | 144 | m_poslist.clear(); |
122 | } | 145 | } |