author | alwin <alwin> | 2003-12-12 09:11:26 (UTC) |
---|---|---|
committer | alwin <alwin> | 2003-12-12 09:11:26 (UTC) |
commit | f6ff7965fe62f42fcb0fb1cdb93585e0c6ed80fe (patch) (unidiff) | |
tree | a749f4f32cd7b956b59dc4299431539c6b95657f | |
parent | db6704ee16bb6983f4fd8d6853a28f59d533f637 (diff) | |
download | opie-f6ff7965fe62f42fcb0fb1cdb93585e0c6ed80fe.zip opie-f6ff7965fe62f42fcb0fb1cdb93585e0c6ed80fe.tar.gz opie-f6ff7965fe62f42fcb0fb1cdb93585e0c6ed80fe.tar.bz2 |
body text will initialized with 0 not "" so we can check if
ever a body text is set.
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailtypes.cpp | 2 | ||||
-rw-r--r-- | noncore/net/mail/mailtypes.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.cpp b/noncore/net/mail/libmailwrapper/mailtypes.cpp index 0e3174d..6a66113 100644 --- a/noncore/net/mail/libmailwrapper/mailtypes.cpp +++ b/noncore/net/mail/libmailwrapper/mailtypes.cpp | |||
@@ -1,189 +1,189 @@ | |||
1 | #include "mailtypes.h" | 1 | #include "mailtypes.h" |
2 | 2 | ||
3 | 3 | ||
4 | RecMail::RecMail() | 4 | RecMail::RecMail() |
5 | :subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7) | 5 | :subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7) |
6 | { | 6 | { |
7 | init(); | 7 | init(); |
8 | } | 8 | } |
9 | 9 | ||
10 | RecMail::RecMail(const RecMail&old) | 10 | RecMail::RecMail(const RecMail&old) |
11 | :subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7) | 11 | :subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7) |
12 | { | 12 | { |
13 | init(); | 13 | init(); |
14 | copy_old(old); | 14 | copy_old(old); |
15 | qDebug("Copy constructor RecMail"); | 15 | qDebug("Copy constructor RecMail"); |
16 | } | 16 | } |
17 | 17 | ||
18 | void RecMail::copy_old(const RecMail&old) | 18 | void RecMail::copy_old(const RecMail&old) |
19 | { | 19 | { |
20 | subject = old.subject; | 20 | subject = old.subject; |
21 | date = old.date; | 21 | date = old.date; |
22 | mbox = old.mbox; | 22 | mbox = old.mbox; |
23 | msg_id = old.msg_id; | 23 | msg_id = old.msg_id; |
24 | msg_size = old.msg_size; | 24 | msg_size = old.msg_size; |
25 | msg_number = old.msg_number; | 25 | msg_number = old.msg_number; |
26 | from = old.from; | 26 | from = old.from; |
27 | msg_flags = old.msg_flags; | 27 | msg_flags = old.msg_flags; |
28 | to = old.to; | 28 | to = old.to; |
29 | cc = old.cc; | 29 | cc = old.cc; |
30 | bcc = old.bcc; | 30 | bcc = old.bcc; |
31 | } | 31 | } |
32 | 32 | ||
33 | void RecMail::init() | 33 | void RecMail::init() |
34 | { | 34 | { |
35 | to.clear(); | 35 | to.clear(); |
36 | cc.clear(); | 36 | cc.clear(); |
37 | bcc.clear(); | 37 | bcc.clear(); |
38 | } | 38 | } |
39 | 39 | ||
40 | void RecMail::setTo(const QStringList&list) | 40 | void RecMail::setTo(const QStringList&list) |
41 | { | 41 | { |
42 | to = list; | 42 | to = list; |
43 | } | 43 | } |
44 | 44 | ||
45 | const QStringList&RecMail::To()const | 45 | const QStringList&RecMail::To()const |
46 | { | 46 | { |
47 | return to; | 47 | return to; |
48 | } | 48 | } |
49 | 49 | ||
50 | void RecMail::setCC(const QStringList&list) | 50 | void RecMail::setCC(const QStringList&list) |
51 | { | 51 | { |
52 | cc = list; | 52 | cc = list; |
53 | } | 53 | } |
54 | 54 | ||
55 | const QStringList&RecMail::CC()const | 55 | const QStringList&RecMail::CC()const |
56 | { | 56 | { |
57 | return cc; | 57 | return cc; |
58 | } | 58 | } |
59 | 59 | ||
60 | void RecMail::setBcc(const QStringList&list) | 60 | void RecMail::setBcc(const QStringList&list) |
61 | { | 61 | { |
62 | bcc = list; | 62 | bcc = list; |
63 | } | 63 | } |
64 | 64 | ||
65 | const QStringList& RecMail::Bcc()const | 65 | const QStringList& RecMail::Bcc()const |
66 | { | 66 | { |
67 | return bcc; | 67 | return bcc; |
68 | } | 68 | } |
69 | 69 | ||
70 | RecPart::RecPart() | 70 | RecPart::RecPart() |
71 | : m_type(""),m_subtype(""),m_identifier(""),m_encoding(""),m_lines(0) | 71 | : m_type(""),m_subtype(""),m_identifier(""),m_encoding(""),m_lines(0) |
72 | { | 72 | { |
73 | } | 73 | } |
74 | 74 | ||
75 | RecPart::RecPart(const QString&identifier,const QString&type,const QString&subtype,const QString&encoding,unsigned int lines) | 75 | RecPart::RecPart(const QString&identifier,const QString&type,const QString&subtype,const QString&encoding,unsigned int lines) |
76 | : m_type(type),m_subtype(subtype),m_identifier(identifier),m_encoding(encoding),m_lines(lines) | 76 | : m_type(type),m_subtype(subtype),m_identifier(identifier),m_encoding(encoding),m_lines(lines) |
77 | { | 77 | { |
78 | } | 78 | } |
79 | 79 | ||
80 | RecPart::~RecPart() | 80 | RecPart::~RecPart() |
81 | { | 81 | { |
82 | } | 82 | } |
83 | 83 | ||
84 | void RecPart::setLines(unsigned int lines) | 84 | void RecPart::setLines(unsigned int lines) |
85 | { | 85 | { |
86 | m_lines = lines; | 86 | m_lines = lines; |
87 | } | 87 | } |
88 | 88 | ||
89 | const unsigned int RecPart::Lines()const | 89 | const unsigned int RecPart::Lines()const |
90 | { | 90 | { |
91 | return m_lines; | 91 | return m_lines; |
92 | } | 92 | } |
93 | 93 | ||
94 | const QString& RecPart::Type()const | 94 | const QString& RecPart::Type()const |
95 | { | 95 | { |
96 | return m_type; | 96 | return m_type; |
97 | } | 97 | } |
98 | 98 | ||
99 | void RecPart::setType(const QString&type) | 99 | void RecPart::setType(const QString&type) |
100 | { | 100 | { |
101 | m_type = type; | 101 | m_type = type; |
102 | } | 102 | } |
103 | 103 | ||
104 | const QString& RecPart::Subtype()const | 104 | const QString& RecPart::Subtype()const |
105 | { | 105 | { |
106 | return m_subtype; | 106 | return m_subtype; |
107 | } | 107 | } |
108 | 108 | ||
109 | void RecPart::setSubtype(const QString&subtype) | 109 | void RecPart::setSubtype(const QString&subtype) |
110 | { | 110 | { |
111 | m_subtype = subtype; | 111 | m_subtype = subtype; |
112 | } | 112 | } |
113 | 113 | ||
114 | const QString& RecPart::Identifier()const | 114 | const QString& RecPart::Identifier()const |
115 | { | 115 | { |
116 | return m_identifier; | 116 | return m_identifier; |
117 | } | 117 | } |
118 | 118 | ||
119 | void RecPart::setIdentifier(const QString&identifier) | 119 | void RecPart::setIdentifier(const QString&identifier) |
120 | { | 120 | { |
121 | m_identifier = identifier; | 121 | m_identifier = identifier; |
122 | } | 122 | } |
123 | 123 | ||
124 | const QString& RecPart::Encoding()const | 124 | const QString& RecPart::Encoding()const |
125 | { | 125 | { |
126 | return m_encoding; | 126 | return m_encoding; |
127 | } | 127 | } |
128 | 128 | ||
129 | void RecPart::setEncoding(const QString&encoding) | 129 | void RecPart::setEncoding(const QString&encoding) |
130 | { | 130 | { |
131 | m_encoding = encoding; | 131 | m_encoding = encoding; |
132 | } | 132 | } |
133 | 133 | ||
134 | RecBody::RecBody() | 134 | RecBody::RecBody() |
135 | : m_BodyText(""),m_PartsList() | 135 | : m_BodyText(),m_PartsList() |
136 | { | 136 | { |
137 | m_PartsList.setAutoDelete(true); | 137 | m_PartsList.setAutoDelete(true); |
138 | } | 138 | } |
139 | 139 | ||
140 | RecBody::~RecBody() | 140 | RecBody::~RecBody() |
141 | { | 141 | { |
142 | } | 142 | } |
143 | 143 | ||
144 | void RecBody::setBodytext(const QString&bodyText) | 144 | void RecBody::setBodytext(const QString&bodyText) |
145 | { | 145 | { |
146 | m_BodyText = bodyText; | 146 | m_BodyText = bodyText; |
147 | } | 147 | } |
148 | 148 | ||
149 | const QString& RecBody::Bodytext()const | 149 | const QString& RecBody::Bodytext()const |
150 | { | 150 | { |
151 | return m_BodyText; | 151 | return m_BodyText; |
152 | } | 152 | } |
153 | 153 | ||
154 | void RecBody::setParts(const QList<RecPart>&parts) | 154 | void RecBody::setParts(const QList<RecPart>&parts) |
155 | { | 155 | { |
156 | m_PartsList = parts; | 156 | m_PartsList = parts; |
157 | m_PartsList.setAutoDelete(true); | 157 | m_PartsList.setAutoDelete(true); |
158 | } | 158 | } |
159 | 159 | ||
160 | const QList<RecPart>& RecBody::Parts()const | 160 | const QList<RecPart>& RecBody::Parts()const |
161 | { | 161 | { |
162 | return m_PartsList; | 162 | return m_PartsList; |
163 | } | 163 | } |
164 | 164 | ||
165 | void RecBody::addPart(const RecPart& part) | 165 | void RecBody::addPart(const RecPart& part) |
166 | { | 166 | { |
167 | RecPart*p = new RecPart(part); | 167 | RecPart*p = new RecPart(part); |
168 | m_PartsList.append(p); | 168 | m_PartsList.append(p); |
169 | } | 169 | } |
170 | 170 | ||
171 | void RecBody::setType(const QString&type) | 171 | void RecBody::setType(const QString&type) |
172 | { | 172 | { |
173 | m_type = type; | 173 | m_type = type; |
174 | } | 174 | } |
175 | 175 | ||
176 | const QString& RecBody::Type()const | 176 | const QString& RecBody::Type()const |
177 | { | 177 | { |
178 | return m_type; | 178 | return m_type; |
179 | } | 179 | } |
180 | 180 | ||
181 | void RecBody::setSubtype(const QString&type) | 181 | void RecBody::setSubtype(const QString&type) |
182 | { | 182 | { |
183 | m_subtype = type; | 183 | m_subtype = type; |
184 | } | 184 | } |
185 | 185 | ||
186 | const QString& RecBody::Subtype()const | 186 | const QString& RecBody::Subtype()const |
187 | { | 187 | { |
188 | return m_subtype; | 188 | return m_subtype; |
189 | } | 189 | } |
diff --git a/noncore/net/mail/mailtypes.cpp b/noncore/net/mail/mailtypes.cpp index 0e3174d..6a66113 100644 --- a/noncore/net/mail/mailtypes.cpp +++ b/noncore/net/mail/mailtypes.cpp | |||
@@ -1,189 +1,189 @@ | |||
1 | #include "mailtypes.h" | 1 | #include "mailtypes.h" |
2 | 2 | ||
3 | 3 | ||
4 | RecMail::RecMail() | 4 | RecMail::RecMail() |
5 | :subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7) | 5 | :subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7) |
6 | { | 6 | { |
7 | init(); | 7 | init(); |
8 | } | 8 | } |
9 | 9 | ||
10 | RecMail::RecMail(const RecMail&old) | 10 | RecMail::RecMail(const RecMail&old) |
11 | :subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7) | 11 | :subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7) |
12 | { | 12 | { |
13 | init(); | 13 | init(); |
14 | copy_old(old); | 14 | copy_old(old); |
15 | qDebug("Copy constructor RecMail"); | 15 | qDebug("Copy constructor RecMail"); |
16 | } | 16 | } |
17 | 17 | ||
18 | void RecMail::copy_old(const RecMail&old) | 18 | void RecMail::copy_old(const RecMail&old) |
19 | { | 19 | { |
20 | subject = old.subject; | 20 | subject = old.subject; |
21 | date = old.date; | 21 | date = old.date; |
22 | mbox = old.mbox; | 22 | mbox = old.mbox; |
23 | msg_id = old.msg_id; | 23 | msg_id = old.msg_id; |
24 | msg_size = old.msg_size; | 24 | msg_size = old.msg_size; |
25 | msg_number = old.msg_number; | 25 | msg_number = old.msg_number; |
26 | from = old.from; | 26 | from = old.from; |
27 | msg_flags = old.msg_flags; | 27 | msg_flags = old.msg_flags; |
28 | to = old.to; | 28 | to = old.to; |
29 | cc = old.cc; | 29 | cc = old.cc; |
30 | bcc = old.bcc; | 30 | bcc = old.bcc; |
31 | } | 31 | } |
32 | 32 | ||
33 | void RecMail::init() | 33 | void RecMail::init() |
34 | { | 34 | { |
35 | to.clear(); | 35 | to.clear(); |
36 | cc.clear(); | 36 | cc.clear(); |
37 | bcc.clear(); | 37 | bcc.clear(); |
38 | } | 38 | } |
39 | 39 | ||
40 | void RecMail::setTo(const QStringList&list) | 40 | void RecMail::setTo(const QStringList&list) |
41 | { | 41 | { |
42 | to = list; | 42 | to = list; |
43 | } | 43 | } |
44 | 44 | ||
45 | const QStringList&RecMail::To()const | 45 | const QStringList&RecMail::To()const |
46 | { | 46 | { |
47 | return to; | 47 | return to; |
48 | } | 48 | } |
49 | 49 | ||
50 | void RecMail::setCC(const QStringList&list) | 50 | void RecMail::setCC(const QStringList&list) |
51 | { | 51 | { |
52 | cc = list; | 52 | cc = list; |
53 | } | 53 | } |
54 | 54 | ||
55 | const QStringList&RecMail::CC()const | 55 | const QStringList&RecMail::CC()const |
56 | { | 56 | { |
57 | return cc; | 57 | return cc; |
58 | } | 58 | } |
59 | 59 | ||
60 | void RecMail::setBcc(const QStringList&list) | 60 | void RecMail::setBcc(const QStringList&list) |
61 | { | 61 | { |
62 | bcc = list; | 62 | bcc = list; |
63 | } | 63 | } |
64 | 64 | ||
65 | const QStringList& RecMail::Bcc()const | 65 | const QStringList& RecMail::Bcc()const |
66 | { | 66 | { |
67 | return bcc; | 67 | return bcc; |
68 | } | 68 | } |
69 | 69 | ||
70 | RecPart::RecPart() | 70 | RecPart::RecPart() |
71 | : m_type(""),m_subtype(""),m_identifier(""),m_encoding(""),m_lines(0) | 71 | : m_type(""),m_subtype(""),m_identifier(""),m_encoding(""),m_lines(0) |
72 | { | 72 | { |
73 | } | 73 | } |
74 | 74 | ||
75 | RecPart::RecPart(const QString&identifier,const QString&type,const QString&subtype,const QString&encoding,unsigned int lines) | 75 | RecPart::RecPart(const QString&identifier,const QString&type,const QString&subtype,const QString&encoding,unsigned int lines) |
76 | : m_type(type),m_subtype(subtype),m_identifier(identifier),m_encoding(encoding),m_lines(lines) | 76 | : m_type(type),m_subtype(subtype),m_identifier(identifier),m_encoding(encoding),m_lines(lines) |
77 | { | 77 | { |
78 | } | 78 | } |
79 | 79 | ||
80 | RecPart::~RecPart() | 80 | RecPart::~RecPart() |
81 | { | 81 | { |
82 | } | 82 | } |
83 | 83 | ||
84 | void RecPart::setLines(unsigned int lines) | 84 | void RecPart::setLines(unsigned int lines) |
85 | { | 85 | { |
86 | m_lines = lines; | 86 | m_lines = lines; |
87 | } | 87 | } |
88 | 88 | ||
89 | const unsigned int RecPart::Lines()const | 89 | const unsigned int RecPart::Lines()const |
90 | { | 90 | { |
91 | return m_lines; | 91 | return m_lines; |
92 | } | 92 | } |
93 | 93 | ||
94 | const QString& RecPart::Type()const | 94 | const QString& RecPart::Type()const |
95 | { | 95 | { |
96 | return m_type; | 96 | return m_type; |
97 | } | 97 | } |
98 | 98 | ||
99 | void RecPart::setType(const QString&type) | 99 | void RecPart::setType(const QString&type) |
100 | { | 100 | { |
101 | m_type = type; | 101 | m_type = type; |
102 | } | 102 | } |
103 | 103 | ||
104 | const QString& RecPart::Subtype()const | 104 | const QString& RecPart::Subtype()const |
105 | { | 105 | { |
106 | return m_subtype; | 106 | return m_subtype; |
107 | } | 107 | } |
108 | 108 | ||
109 | void RecPart::setSubtype(const QString&subtype) | 109 | void RecPart::setSubtype(const QString&subtype) |
110 | { | 110 | { |
111 | m_subtype = subtype; | 111 | m_subtype = subtype; |
112 | } | 112 | } |
113 | 113 | ||
114 | const QString& RecPart::Identifier()const | 114 | const QString& RecPart::Identifier()const |
115 | { | 115 | { |
116 | return m_identifier; | 116 | return m_identifier; |
117 | } | 117 | } |
118 | 118 | ||
119 | void RecPart::setIdentifier(const QString&identifier) | 119 | void RecPart::setIdentifier(const QString&identifier) |
120 | { | 120 | { |
121 | m_identifier = identifier; | 121 | m_identifier = identifier; |
122 | } | 122 | } |
123 | 123 | ||
124 | const QString& RecPart::Encoding()const | 124 | const QString& RecPart::Encoding()const |
125 | { | 125 | { |
126 | return m_encoding; | 126 | return m_encoding; |
127 | } | 127 | } |
128 | 128 | ||
129 | void RecPart::setEncoding(const QString&encoding) | 129 | void RecPart::setEncoding(const QString&encoding) |
130 | { | 130 | { |
131 | m_encoding = encoding; | 131 | m_encoding = encoding; |
132 | } | 132 | } |
133 | 133 | ||
134 | RecBody::RecBody() | 134 | RecBody::RecBody() |
135 | : m_BodyText(""),m_PartsList() | 135 | : m_BodyText(),m_PartsList() |
136 | { | 136 | { |
137 | m_PartsList.setAutoDelete(true); | 137 | m_PartsList.setAutoDelete(true); |
138 | } | 138 | } |
139 | 139 | ||
140 | RecBody::~RecBody() | 140 | RecBody::~RecBody() |
141 | { | 141 | { |
142 | } | 142 | } |
143 | 143 | ||
144 | void RecBody::setBodytext(const QString&bodyText) | 144 | void RecBody::setBodytext(const QString&bodyText) |
145 | { | 145 | { |
146 | m_BodyText = bodyText; | 146 | m_BodyText = bodyText; |
147 | } | 147 | } |
148 | 148 | ||
149 | const QString& RecBody::Bodytext()const | 149 | const QString& RecBody::Bodytext()const |
150 | { | 150 | { |
151 | return m_BodyText; | 151 | return m_BodyText; |
152 | } | 152 | } |
153 | 153 | ||
154 | void RecBody::setParts(const QList<RecPart>&parts) | 154 | void RecBody::setParts(const QList<RecPart>&parts) |
155 | { | 155 | { |
156 | m_PartsList = parts; | 156 | m_PartsList = parts; |
157 | m_PartsList.setAutoDelete(true); | 157 | m_PartsList.setAutoDelete(true); |
158 | } | 158 | } |
159 | 159 | ||
160 | const QList<RecPart>& RecBody::Parts()const | 160 | const QList<RecPart>& RecBody::Parts()const |
161 | { | 161 | { |
162 | return m_PartsList; | 162 | return m_PartsList; |
163 | } | 163 | } |
164 | 164 | ||
165 | void RecBody::addPart(const RecPart& part) | 165 | void RecBody::addPart(const RecPart& part) |
166 | { | 166 | { |
167 | RecPart*p = new RecPart(part); | 167 | RecPart*p = new RecPart(part); |
168 | m_PartsList.append(p); | 168 | m_PartsList.append(p); |
169 | } | 169 | } |
170 | 170 | ||
171 | void RecBody::setType(const QString&type) | 171 | void RecBody::setType(const QString&type) |
172 | { | 172 | { |
173 | m_type = type; | 173 | m_type = type; |
174 | } | 174 | } |
175 | 175 | ||
176 | const QString& RecBody::Type()const | 176 | const QString& RecBody::Type()const |
177 | { | 177 | { |
178 | return m_type; | 178 | return m_type; |
179 | } | 179 | } |
180 | 180 | ||
181 | void RecBody::setSubtype(const QString&type) | 181 | void RecBody::setSubtype(const QString&type) |
182 | { | 182 | { |
183 | m_subtype = type; | 183 | m_subtype = type; |
184 | } | 184 | } |
185 | 185 | ||
186 | const QString& RecBody::Subtype()const | 186 | const QString& RecBody::Subtype()const |
187 | { | 187 | { |
188 | return m_subtype; | 188 | return m_subtype; |
189 | } | 189 | } |