author | alwin <alwin> | 2004-03-12 14:12:00 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-12 14:12:00 (UTC) |
commit | d1929ef43f0eaaa17aa42196384d1ed925132873 (patch) (side-by-side diff) | |
tree | eff911f93fe7919d7820e5a2e68b72f2f76143da /noncore/net/mail/libmailwrapper/mhwrapper.cpp | |
parent | d38384a6edb0110117e0297864f813b379d52789 (diff) | |
download | opie-d1929ef43f0eaaa17aa42196384d1ed925132873.zip opie-d1929ef43f0eaaa17aa42196384d1ed925132873.tar.gz opie-d1929ef43f0eaaa17aa42196384d1ed925132873.tar.bz2 |
some pointers embedded into osmart_pointer handling
Diffstat (limited to 'noncore/net/mail/libmailwrapper/mhwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/mhwrapper.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/noncore/net/mail/libmailwrapper/mhwrapper.cpp b/noncore/net/mail/libmailwrapper/mhwrapper.cpp index 560eab0..aaaa20a 100644 --- a/noncore/net/mail/libmailwrapper/mhwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mhwrapper.cpp @@ -73,16 +73,15 @@ void MHwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) return; } parseList(target,m_storage->sto_session,f); Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count())); } -QList<Folder>* MHwrapper::listFolders() +QValueList<Opie::osmart_pointer<Folder> >* MHwrapper::listFolders() { - QList<Folder> * folders = new QList<Folder>(); - folders->setAutoDelete( false ); + QValueList<Opie::osmart_pointer<Folder> >* folders = new QValueList<Opie::osmart_pointer<Folder> >(); /* this is needed! */ if (m_storage) mailstorage_disconnect(m_storage); init_storage(); if (!m_storage) { return folders; } @@ -141,13 +140,13 @@ RecBody MHwrapper::fetchBody( const RecMail &mail ) } r = mailsession_get_message(m_storage->sto_session, mail.getNumber(), &msg); if (r != MAIL_NO_ERROR) { qDebug("Error fetching mail %i",mail.getNumber()); return body; } - body = parseMail(msg); + body = parseMail(msg); mailmessage_fetch_result_free(msg,data); return body; } void MHwrapper::mbox_progress( size_t current, size_t maximum ) { @@ -166,13 +165,13 @@ QString MHwrapper::buildPath(const QString&p) f+="/"; } f+=p; return f; } -int MHwrapper::createMbox(const QString&folder,const Folder*pfolder,const QString&,bool ) +int MHwrapper::createMbox(const QString&folder,const FolderP&pfolder,const QString&,bool ) { init_storage(); if (!m_storage) { return 0; } QString f; @@ -260,13 +259,13 @@ void MHwrapper::deleteMails(const QString & mailbox,QList<RecMail> &target) qDebug("error deleting mail"); break; } } } -int MHwrapper::deleteAllMail(const Folder*tfolder) +int MHwrapper::deleteAllMail(const FolderP&tfolder) { init_storage(); if (!m_storage) { return 0; } int res = 1; @@ -295,34 +294,34 @@ int MHwrapper::deleteAllMail(const Folder*tfolder) } } if (l) mailmessage_list_free(l); return res; } -int MHwrapper::deleteMbox(const Folder*tfolder) +int MHwrapper::deleteMbox(const FolderP&tfolder) { init_storage(); if (!m_storage) { return 0; } if (!tfolder) return 0; if (tfolder->getName()=="/" || tfolder->getName().isEmpty()) return 0; - + int r = mailsession_delete_folder(m_storage->sto_session,(char*)tfolder->getName().latin1()); - + if (r != MAIL_NO_ERROR) { qDebug("error deleting mail box"); return 0; } QString cmd = "rm -rf "+tfolder->getName(); QStringList command; command << "/bin/sh"; command << "-c"; command << cmd.latin1(); OProcess *process = new OProcess(); - + connect(process, SIGNAL(processExited(OProcess*)), this, SLOT( processEnded(OProcess*))); connect(process, SIGNAL( receivedStderr(OProcess*,char*,int)), this, SLOT( oprocessStderr(OProcess*,char*,int))); *process << command; @@ -383,13 +382,13 @@ void MHwrapper::mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractM qDebug("Using generic"); Genericwrapper::mvcpMail(mail,targetFolder,targetWrapper,moveit); return; } qDebug("Using internal routines for move/copy"); QString tf = buildPath(targetFolder); - int r = mailsession_select_folder(m_storage->sto_session,(char*)mail.getMbox().latin1()); + int r = mailsession_select_folder(m_storage->sto_session,(char*)mail.getMbox().latin1()); if (r != MAIL_NO_ERROR) { qDebug("Error selecting source mailbox"); return; } if (moveit) { r = mailsession_move_message(m_storage->sto_session,mail.getNumber(),(char*)tf.latin1()); @@ -398,13 +397,14 @@ void MHwrapper::mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractM } if (r != MAIL_NO_ERROR) { qDebug("Error copy/moving mail internal (%i)",r); } } -void MHwrapper::mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) +void MHwrapper::mvcpAllMails(const FolderP&fromFolder, + const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) { init_storage(); if (!m_storage) { return; } if (targetWrapper != this) { |