summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper/mailtypes.cpp
Unidiff
Diffstat (limited to 'kmicromail/libmailwrapper/mailtypes.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/mailtypes.cpp23
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
7using namespace Opie::Core; 7using namespace Opie::Core;
8RecMail::RecMail() 8RecMail::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
14RecMail::RecMail(const RecMail&old) 14RecMail::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
22RecMail::~RecMail() 22RecMail::~RecMail()
23{ 23{
24 wrapper = 0; 24 wrapper = 0;
25} 25}
26static 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
33bool 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}
27void RecMail::copy_old(const RecMail&old) 50void 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
46void RecMail::init() 69void 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
56void RecMail::setWrapper(AbstractMail*awrapper) 79void RecMail::setWrapper(AbstractMail*awrapper)
57{ 80{
58 wrapper = awrapper; 81 wrapper = awrapper;
59} 82}
60 83
61AbstractMail* RecMail::Wrapper() 84AbstractMail* RecMail::Wrapper()
62{ 85{
63 return wrapper; 86 return wrapper;
64} 87}
65 88
66void RecMail::setTo(const QStringList&list) 89void RecMail::setTo(const QStringList&list)
67{ 90{
68 to = list; 91 to = list;
69} 92}
70 93
71const QStringList&RecMail::To()const 94const QStringList&RecMail::To()const
72{ 95{
73 return to; 96 return to;
74} 97}
75 98
76void RecMail::setCC(const QStringList&list) 99void RecMail::setCC(const QStringList&list)
77{ 100{
78 cc = list; 101 cc = list;
79} 102}
80 103
81const QStringList&RecMail::CC()const 104const QStringList&RecMail::CC()const
82{ 105{
83 return cc; 106 return cc;
84} 107}
85 108
86void RecMail::setBcc(const QStringList&list) 109void RecMail::setBcc(const QStringList&list)
87{ 110{
88 bcc = list; 111 bcc = list;
89} 112}
90 113
91const QStringList& RecMail::Bcc()const 114const QStringList& RecMail::Bcc()const
92{ 115{
93 return bcc; 116 return bcc;
94} 117}
95 118
96void RecMail::setInreply(const QStringList&list) 119void RecMail::setInreply(const QStringList&list)
97{ 120{
98 in_reply_to = list; 121 in_reply_to = list;
99} 122}
100 123
101const QStringList& RecMail::Inreply()const 124const QStringList& RecMail::Inreply()const
102{ 125{
103 return in_reply_to; 126 return in_reply_to;
104} 127}
105 128
106void RecMail::setReferences(const QStringList&list) 129void RecMail::setReferences(const QStringList&list)
107{ 130{
108 references = list; 131 references = list;
109} 132}
110 133
111const QStringList& RecMail::References()const 134const QStringList& RecMail::References()const
112{ 135{
113 return references; 136 return references;
114} 137}
115 138
116RecPart::RecPart() 139RecPart::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}