author | alwin <alwin> | 2003-12-13 02:35:48 (UTC) |
---|---|---|
committer | alwin <alwin> | 2003-12-13 02:35:48 (UTC) |
commit | f689ef512cfc0a56fead4839a6b2e24a6ee282e0 (patch) (unidiff) | |
tree | c06b5e75d237bba3c5569d24bfa138faef1c38b9 /noncore/net | |
parent | c7749c503736091d0472e11b5bb0a8a82232bd61 (diff) | |
download | opie-f689ef512cfc0a56fead4839a6b2e24a6ee282e0.zip opie-f689ef512cfc0a56fead4839a6b2e24a6ee282e0.tar.gz opie-f689ef512cfc0a56fead4839a6b2e24a6ee282e0.tar.bz2 |
using QValueList<T> instead of QList<T> for body parts
(gives a better handling for const and non-const values and
so on)
-rw-r--r-- | noncore/net/mail/ProgrammersDoc/ReceivingMails.dia | bin | 3474 -> 3472 bytes | |||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailtypes.cpp | 11 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailtypes.h | 6 | ||||
-rw-r--r-- | noncore/net/mail/mailtypes.cpp | 11 | ||||
-rw-r--r-- | noncore/net/mail/mailtypes.h | 6 |
5 files changed, 16 insertions, 18 deletions
diff --git a/noncore/net/mail/ProgrammersDoc/ReceivingMails.dia b/noncore/net/mail/ProgrammersDoc/ReceivingMails.dia index a4a5fb6..4e63dc6 100644 --- a/noncore/net/mail/ProgrammersDoc/ReceivingMails.dia +++ b/noncore/net/mail/ProgrammersDoc/ReceivingMails.dia | |||
Binary files differ | |||
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.cpp b/noncore/net/mail/libmailwrapper/mailtypes.cpp index f56bb63..9c312e9 100644 --- a/noncore/net/mail/libmailwrapper/mailtypes.cpp +++ b/noncore/net/mail/libmailwrapper/mailtypes.cpp | |||
@@ -166,7 +166,7 @@ const QValueList<int>& RecPart::Positionlist()const | |||
166 | RecBody::RecBody() | 166 | RecBody::RecBody() |
167 | : m_BodyText(),m_PartsList(),m_description() | 167 | : m_BodyText(),m_PartsList(),m_description() |
168 | { | 168 | { |
169 | m_PartsList.setAutoDelete(true); | 169 | m_PartsList.clear(); |
170 | } | 170 | } |
171 | 171 | ||
172 | RecBody::~RecBody() | 172 | RecBody::~RecBody() |
@@ -183,21 +183,20 @@ const QString& RecBody::Bodytext()const | |||
183 | return m_BodyText; | 183 | return m_BodyText; |
184 | } | 184 | } |
185 | 185 | ||
186 | void RecBody::setParts(const QList<RecPart>&parts) | 186 | void RecBody::setParts(const QValueList<RecPart>&parts) |
187 | { | 187 | { |
188 | m_PartsList.clear(); | ||
188 | m_PartsList = parts; | 189 | m_PartsList = parts; |
189 | m_PartsList.setAutoDelete(true); | ||
190 | } | 190 | } |
191 | 191 | ||
192 | const QList<RecPart>& RecBody::Parts()const | 192 | const QValueList<RecPart>& RecBody::Parts()const |
193 | { | 193 | { |
194 | return m_PartsList; | 194 | return m_PartsList; |
195 | } | 195 | } |
196 | 196 | ||
197 | void RecBody::addPart(const RecPart& part) | 197 | void RecBody::addPart(const RecPart& part) |
198 | { | 198 | { |
199 | RecPart*p = new RecPart(part); | 199 | m_PartsList.append(part); |
200 | m_PartsList.append(p); | ||
201 | } | 200 | } |
202 | 201 | ||
203 | void RecBody::setDescription(const RecPart&des) | 202 | void RecBody::setDescription(const RecPart&des) |
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.h b/noncore/net/mail/libmailwrapper/mailtypes.h index 60db527..f308bc7 100644 --- a/noncore/net/mail/libmailwrapper/mailtypes.h +++ b/noncore/net/mail/libmailwrapper/mailtypes.h | |||
@@ -108,7 +108,7 @@ class RecBody | |||
108 | { | 108 | { |
109 | protected: | 109 | protected: |
110 | QString m_BodyText; | 110 | QString m_BodyText; |
111 | QList<RecPart> m_PartsList; | 111 | QValueList<RecPart> m_PartsList; |
112 | RecPart m_description; | 112 | RecPart m_description; |
113 | 113 | ||
114 | public: | 114 | public: |
@@ -120,8 +120,8 @@ public: | |||
120 | void setDescription(const RecPart&des); | 120 | void setDescription(const RecPart&des); |
121 | const RecPart& Description()const; | 121 | const RecPart& Description()const; |
122 | 122 | ||
123 | void setParts(const QList<RecPart>&parts); | 123 | void setParts(const QValueList<RecPart>&parts); |
124 | const QList<RecPart>& Parts()const; | 124 | const QValueList<RecPart>& Parts()const; |
125 | void addPart(const RecPart&part); | 125 | void addPart(const RecPart&part); |
126 | }; | 126 | }; |
127 | 127 | ||
diff --git a/noncore/net/mail/mailtypes.cpp b/noncore/net/mail/mailtypes.cpp index f56bb63..9c312e9 100644 --- a/noncore/net/mail/mailtypes.cpp +++ b/noncore/net/mail/mailtypes.cpp | |||
@@ -166,7 +166,7 @@ const QValueList<int>& RecPart::Positionlist()const | |||
166 | RecBody::RecBody() | 166 | RecBody::RecBody() |
167 | : m_BodyText(),m_PartsList(),m_description() | 167 | : m_BodyText(),m_PartsList(),m_description() |
168 | { | 168 | { |
169 | m_PartsList.setAutoDelete(true); | 169 | m_PartsList.clear(); |
170 | } | 170 | } |
171 | 171 | ||
172 | RecBody::~RecBody() | 172 | RecBody::~RecBody() |
@@ -183,21 +183,20 @@ const QString& RecBody::Bodytext()const | |||
183 | return m_BodyText; | 183 | return m_BodyText; |
184 | } | 184 | } |
185 | 185 | ||
186 | void RecBody::setParts(const QList<RecPart>&parts) | 186 | void RecBody::setParts(const QValueList<RecPart>&parts) |
187 | { | 187 | { |
188 | m_PartsList.clear(); | ||
188 | m_PartsList = parts; | 189 | m_PartsList = parts; |
189 | m_PartsList.setAutoDelete(true); | ||
190 | } | 190 | } |
191 | 191 | ||
192 | const QList<RecPart>& RecBody::Parts()const | 192 | const QValueList<RecPart>& RecBody::Parts()const |
193 | { | 193 | { |
194 | return m_PartsList; | 194 | return m_PartsList; |
195 | } | 195 | } |
196 | 196 | ||
197 | void RecBody::addPart(const RecPart& part) | 197 | void RecBody::addPart(const RecPart& part) |
198 | { | 198 | { |
199 | RecPart*p = new RecPart(part); | 199 | m_PartsList.append(part); |
200 | m_PartsList.append(p); | ||
201 | } | 200 | } |
202 | 201 | ||
203 | void RecBody::setDescription(const RecPart&des) | 202 | void RecBody::setDescription(const RecPart&des) |
diff --git a/noncore/net/mail/mailtypes.h b/noncore/net/mail/mailtypes.h index 60db527..f308bc7 100644 --- a/noncore/net/mail/mailtypes.h +++ b/noncore/net/mail/mailtypes.h | |||
@@ -108,7 +108,7 @@ class RecBody | |||
108 | { | 108 | { |
109 | protected: | 109 | protected: |
110 | QString m_BodyText; | 110 | QString m_BodyText; |
111 | QList<RecPart> m_PartsList; | 111 | QValueList<RecPart> m_PartsList; |
112 | RecPart m_description; | 112 | RecPart m_description; |
113 | 113 | ||
114 | public: | 114 | public: |
@@ -120,8 +120,8 @@ public: | |||
120 | void setDescription(const RecPart&des); | 120 | void setDescription(const RecPart&des); |
121 | const RecPart& Description()const; | 121 | const RecPart& Description()const; |
122 | 122 | ||
123 | void setParts(const QList<RecPart>&parts); | 123 | void setParts(const QValueList<RecPart>&parts); |
124 | const QList<RecPart>& Parts()const; | 124 | const QValueList<RecPart>& Parts()const; |
125 | void addPart(const RecPart&part); | 125 | void addPart(const RecPart&part); |
126 | }; | 126 | }; |
127 | 127 | ||