summaryrefslogtreecommitdiff
authoralwin <alwin>2003-12-13 02:35:48 (UTC)
committer alwin <alwin>2003-12-13 02:35:48 (UTC)
commitf689ef512cfc0a56fead4839a6b2e24a6ee282e0 (patch) (side-by-side diff)
treec06b5e75d237bba3c5569d24bfa138faef1c38b9
parentc7749c503736091d0472e11b5bb0a8a82232bd61 (diff)
downloadopie-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)
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/mail/ProgrammersDoc/ReceivingMails.diabin3474 -> 3472 bytes
-rw-r--r--noncore/net/mail/libmailwrapper/mailtypes.cpp11
-rw-r--r--noncore/net/mail/libmailwrapper/mailtypes.h6
-rw-r--r--noncore/net/mail/mailtypes.cpp11
-rw-r--r--noncore/net/mail/mailtypes.h6
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
@@ -157,55 +157,54 @@ void RecPart::setPositionlist(const QValueList<int>&poslist)
{
m_poslist = poslist;
}
const QValueList<int>& RecPart::Positionlist()const
{
return m_poslist;
}
RecBody::RecBody()
: m_BodyText(),m_PartsList(),m_description()
{
- m_PartsList.setAutoDelete(true);
+ m_PartsList.clear();
}
RecBody::~RecBody()
{
}
void RecBody::setBodytext(const QString&bodyText)
{
m_BodyText = bodyText;
}
const QString& RecBody::Bodytext()const
{
return m_BodyText;
}
-void RecBody::setParts(const QList<RecPart>&parts)
+void RecBody::setParts(const QValueList<RecPart>&parts)
{
+ m_PartsList.clear();
m_PartsList = parts;
- m_PartsList.setAutoDelete(true);
}
-const QList<RecPart>& RecBody::Parts()const
+const QValueList<RecPart>& RecBody::Parts()const
{
return m_PartsList;
}
void RecBody::addPart(const RecPart& part)
{
- RecPart*p = new RecPart(part);
- m_PartsList.append(p);
+ m_PartsList.append(part);
}
void RecBody::setDescription(const RecPart&des)
{
m_description = des;
}
const RecPart& RecBody::Description()const
{
return m_description;
}
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
@@ -99,30 +99,30 @@ public:
void setParameters(const part_plist_t&list);
const part_plist_t&Parameters()const;
void addParameter(const QString&key,const QString&value);
const QString searchParamter(const QString&key)const;
void setPositionlist(const QValueList<int>&poslist);
const QValueList<int>& Positionlist()const;
};
class RecBody
{
protected:
QString m_BodyText;
- QList<RecPart> m_PartsList;
+ QValueList<RecPart> m_PartsList;
RecPart m_description;
public:
RecBody();
virtual ~RecBody();
void setBodytext(const QString&);
const QString& Bodytext()const;
void setDescription(const RecPart&des);
const RecPart& Description()const;
- void setParts(const QList<RecPart>&parts);
- const QList<RecPart>& Parts()const;
+ void setParts(const QValueList<RecPart>&parts);
+ const QValueList<RecPart>& Parts()const;
void addPart(const RecPart&part);
};
#endif
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
@@ -157,55 +157,54 @@ void RecPart::setPositionlist(const QValueList<int>&poslist)
{
m_poslist = poslist;
}
const QValueList<int>& RecPart::Positionlist()const
{
return m_poslist;
}
RecBody::RecBody()
: m_BodyText(),m_PartsList(),m_description()
{
- m_PartsList.setAutoDelete(true);
+ m_PartsList.clear();
}
RecBody::~RecBody()
{
}
void RecBody::setBodytext(const QString&bodyText)
{
m_BodyText = bodyText;
}
const QString& RecBody::Bodytext()const
{
return m_BodyText;
}
-void RecBody::setParts(const QList<RecPart>&parts)
+void RecBody::setParts(const QValueList<RecPart>&parts)
{
+ m_PartsList.clear();
m_PartsList = parts;
- m_PartsList.setAutoDelete(true);
}
-const QList<RecPart>& RecBody::Parts()const
+const QValueList<RecPart>& RecBody::Parts()const
{
return m_PartsList;
}
void RecBody::addPart(const RecPart& part)
{
- RecPart*p = new RecPart(part);
- m_PartsList.append(p);
+ m_PartsList.append(part);
}
void RecBody::setDescription(const RecPart&des)
{
m_description = des;
}
const RecPart& RecBody::Description()const
{
return m_description;
}
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
@@ -99,30 +99,30 @@ public:
void setParameters(const part_plist_t&list);
const part_plist_t&Parameters()const;
void addParameter(const QString&key,const QString&value);
const QString searchParamter(const QString&key)const;
void setPositionlist(const QValueList<int>&poslist);
const QValueList<int>& Positionlist()const;
};
class RecBody
{
protected:
QString m_BodyText;
- QList<RecPart> m_PartsList;
+ QValueList<RecPart> m_PartsList;
RecPart m_description;
public:
RecBody();
virtual ~RecBody();
void setBodytext(const QString&);
const QString& Bodytext()const;
void setDescription(const RecPart&des);
const RecPart& Description()const;
- void setParts(const QList<RecPart>&parts);
- const QList<RecPart>& Parts()const;
+ void setParts(const QValueList<RecPart>&parts);
+ const QValueList<RecPart>& Parts()const;
void addPart(const RecPart&part);
};
#endif