author | alwin <alwin> | 2004-03-12 19:24:38 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-12 19:24:38 (UTC) |
commit | b600871ce93553a116a66fd80acd6dfc1cc46829 (patch) (side-by-side diff) | |
tree | b361346a49e09d9f0220993583bf183cf29bd974 /noncore/net/mail/libmailwrapper/mboxwrapper.cpp | |
parent | 874d5a34eca296263dcd1adf857aebe9981825a1 (diff) | |
download | opie-b600871ce93553a116a66fd80acd6dfc1cc46829.zip opie-b600871ce93553a116a66fd80acd6dfc1cc46829.tar.gz opie-b600871ce93553a116a66fd80acd6dfc1cc46829.tar.bz2 |
some more smart-pointers
some bugfixes
some renaming of internals
Diffstat (limited to 'noncore/net/mail/libmailwrapper/mboxwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/mboxwrapper.cpp | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp index 9ff3de2..5e6b714 100644 --- a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp @@ -21,3 +21,3 @@ MBOXwrapper::~MBOXwrapper() -void MBOXwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) +void MBOXwrapper::listMessages(const QString & mailbox, QValueList<RecMailP> &target ) { @@ -46,5 +46,5 @@ void MBOXwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) -QValueList<Opie::osmart_pointer<Folder> >* MBOXwrapper::listFolders() +QValueList<Opie::OSmartPointer<Folder> >* MBOXwrapper::listFolders() { - QValueList<Opie::osmart_pointer<Folder> >* folders = new QValueList<Opie::osmart_pointer<Folder> >(); + QValueList<Opie::OSmartPointer<Folder> >* folders = new QValueList<Opie::OSmartPointer<Folder> >(); QDir dir(MBOXPath); @@ -61,3 +61,3 @@ QValueList<Opie::osmart_pointer<Folder> >* MBOXwrapper::listFolders() -void MBOXwrapper::deleteMail(const RecMail&mail) +void MBOXwrapper::deleteMail(const RecMailP & mail) { @@ -65,3 +65,3 @@ void MBOXwrapper::deleteMail(const RecMail&mail) QString p = MBOXPath+"/"; - p+=mail.getMbox(); + p+=mail->getMbox(); int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); @@ -76,3 +76,3 @@ void MBOXwrapper::deleteMail(const RecMail&mail) } - r = mailsession_remove_message(folder->fld_session,mail.getNumber()); + r = mailsession_remove_message(folder->fld_session,mail->getNumber()); if (r != MAIL_NO_ERROR) { @@ -84,3 +84,3 @@ void MBOXwrapper::deleteMail(const RecMail&mail) -void MBOXwrapper::answeredMail(const RecMail&) +void MBOXwrapper::answeredMail(const RecMailP&) { @@ -88,3 +88,3 @@ void MBOXwrapper::answeredMail(const RecMail&) -RecBody MBOXwrapper::fetchBody( const RecMail &mail ) +RecBody MBOXwrapper::fetchBody( const RecMailP &mail ) { @@ -93,3 +93,3 @@ RecBody MBOXwrapper::fetchBody( const RecMail &mail ) QString p = MBOXPath+"/"; - p+=mail.getMbox(); + p+=mail->getMbox(); mailmessage * msg; @@ -108,5 +108,5 @@ RecBody MBOXwrapper::fetchBody( const RecMail &mail ) } - r = mailsession_get_message(folder->fld_session, mail.getNumber(), &msg); + r = mailsession_get_message(folder->fld_session, mail->getNumber(), &msg); if (r != MAIL_NO_ERROR) { - qDebug("Error fetching mail %i",mail.getNumber()); + qDebug("Error fetching mail %i",mail->getNumber()); mailfolder_free(folder); @@ -117,3 +117,3 @@ RecBody MBOXwrapper::fetchBody( const RecMail &mail ) if (r != MAIL_NO_ERROR) { - qDebug("Error fetching mail %i",mail.getNumber()); + qDebug("Error fetching mail %i",mail->getNumber()); mailfolder_free(folder); @@ -171,3 +171,3 @@ void MBOXwrapper::storeMessage(const char*msg,size_t length, const QString&folde -encodedString* MBOXwrapper::fetchRawBody(const RecMail&mail) +encodedString* MBOXwrapper::fetchRawBody(const RecMailP&mail) { @@ -176,3 +176,3 @@ encodedString* MBOXwrapper::fetchRawBody(const RecMail&mail) QString p = MBOXPath+"/"; - p+=mail.getMbox(); + p+=mail->getMbox(); mailmessage * msg; @@ -191,5 +191,5 @@ encodedString* MBOXwrapper::fetchRawBody(const RecMail&mail) } - r = mailsession_get_message(folder->fld_session, mail.getNumber(), &msg); + r = mailsession_get_message(folder->fld_session, mail->getNumber(), &msg); if (r != MAIL_NO_ERROR) { - Global::statusMessage(tr("Error fetching mail %i").arg(mail.getNumber())); + Global::statusMessage(tr("Error fetching mail %i").arg(mail->getNumber())); mailfolder_free(folder); @@ -200,3 +200,3 @@ encodedString* MBOXwrapper::fetchRawBody(const RecMail&mail) if (r != MAIL_NO_ERROR) { - Global::statusMessage(tr("Error fetching mail %i").arg(mail.getNumber())); + Global::statusMessage(tr("Error fetching mail %i").arg(mail->getNumber())); mailfolder_free(folder); @@ -214,3 +214,3 @@ encodedString* MBOXwrapper::fetchRawBody(const RecMail&mail) -void MBOXwrapper::deleteMails(const QString & mailbox,QList<RecMail> &target) +void MBOXwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> &target) { @@ -228,3 +228,3 @@ void MBOXwrapper::deleteMails(const QString & mailbox,QList<RecMail> &target) -void MBOXwrapper::deleteMails(mailmbox_folder*f,QList<RecMail> &target) +void MBOXwrapper::deleteMails(mailmbox_folder*f,const QValueList<RecMailP> &target) { @@ -232,4 +232,5 @@ void MBOXwrapper::deleteMails(mailmbox_folder*f,QList<RecMail> &target) int r; - for (unsigned int i=0; i < target.count();++i) { - r = mailmbox_delete_msg(f,target.at(i)->getNumber()); + QValueList<RecMailP>::ConstIterator it; + for (it=target.begin(); it != target.end();++it) { + r = mailmbox_delete_msg(f,(*it)->getNumber()); if (r!=MAILMBOX_NO_ERROR) { |