-rw-r--r-- | noncore/net/mail/libmailwrapper/mboxwrapper.cpp | 4 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mboxwrapper.h | 1 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mhwrapper.cpp | 4 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mhwrapper.h | 1 |
4 files changed, 2 insertions, 8 deletions
diff --git a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp index 11ffd92..abe4bb6 100644 --- a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp @@ -1,337 +1,335 @@ #include "mboxwrapper.h" #include "mailtypes.h" #include "mailwrapper.h" #include <libetpan/libetpan.h> #include <qdir.h> #include <stdlib.h> #include <qpe/global.h> -const MAILLIB::ATYPE MBOXwrapper::wrapperType=MAILLIB::MBOX; - MBOXwrapper::MBOXwrapper(const QString & mbox_dir,const QString&mbox_name) : Genericwrapper(),MBOXPath(mbox_dir),MBOXName(mbox_name) { QDir dir(MBOXPath); if (!dir.exists()) { dir.mkdir(MBOXPath); } } MBOXwrapper::~MBOXwrapper() { } void MBOXwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) { mailstorage*storage = mailstorage_new(NULL); QString p = MBOXPath+"/"; p+=mailbox; int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); mailfolder*folder; folder = mailfolder_new( storage,(char*)p.latin1(),NULL); r = mailfolder_connect(folder); if (r != MAIL_NO_ERROR) { qDebug("Error initializing mbox"); mailfolder_free(folder); mailstorage_free(storage); return; } parseList(target,folder->fld_session,mailbox); mailfolder_disconnect(folder); mailfolder_free(folder); mailstorage_free(storage); Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count())); } QList<Folder>* MBOXwrapper::listFolders() { QList<Folder> * folders = new QList<Folder>(); folders->setAutoDelete( false ); QDir dir(MBOXPath); if (!dir.exists()) return folders; dir.setFilter(QDir::Files|QDir::Writable|QDir::Readable); QStringList entries = dir.entryList(); QStringList::ConstIterator it = entries.begin(); for (;it!=entries.end();++it) { Folder*inb=new Folder(*it,"/"); folders->append(inb); } return folders; } void MBOXwrapper::deleteMail(const RecMail&mail) { mailstorage*storage = mailstorage_new(NULL); QString p = MBOXPath+"/"; p+=mail.getMbox(); int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); mailfolder*folder; folder = mailfolder_new( storage,(char*)p.latin1(),NULL); r = mailfolder_connect(folder); if (r != MAIL_NO_ERROR) { qDebug("Error initializing mbox"); mailfolder_free(folder); mailstorage_free(storage); return; } r = mailsession_remove_message(folder->fld_session,mail.getNumber()); if (r != MAIL_NO_ERROR) { qDebug("error deleting mail"); } mailfolder_free(folder); mailstorage_free(storage); } void MBOXwrapper::answeredMail(const RecMail&) { } RecBody MBOXwrapper::fetchBody( const RecMail &mail ) { RecBody body; mailstorage*storage = mailstorage_new(NULL); QString p = MBOXPath+"/"; p+=mail.getMbox(); mailmessage * msg; char*data=0; size_t size; int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); mailfolder*folder; folder = mailfolder_new( storage,(char*)p.latin1(),NULL); r = mailfolder_connect(folder); if (r != MAIL_NO_ERROR) { qDebug("Error initializing mbox"); mailfolder_free(folder); mailstorage_free(storage); return body; } r = mailsession_get_message(folder->fld_session, mail.getNumber(), &msg); if (r != MAIL_NO_ERROR) { qDebug("Error fetching mail %i",mail.getNumber()); mailfolder_free(folder); mailstorage_free(storage); return body; } r = mailmessage_fetch(msg,&data,&size); if (r != MAIL_NO_ERROR) { qDebug("Error fetching mail %i",mail.getNumber()); mailfolder_free(folder); mailstorage_free(storage); mailmessage_free(msg); return body; } body = parseMail(msg); mailmessage_fetch_result_free(msg,data); mailfolder_free(folder); mailstorage_free(storage); return body; } void MBOXwrapper::mbox_progress( size_t current, size_t maximum ) { qDebug("MBOX %i von %i",current,maximum); } int MBOXwrapper::createMbox(const QString&folder,const Folder*,const QString&,bool ) { QString p = MBOXPath+"/"; p+=folder; QFileInfo fi(p); if (fi.exists()) { Global::statusMessage(tr("Mailbox exists.")); return 0; } mailmbox_folder*f = 0; if (mailmbox_init(p.latin1(),0,1,0,&f) != MAIL_NO_ERROR) { Global::statusMessage(tr("Error init folder")); return 0; } if (f) mailmbox_done(f); return 1; } void MBOXwrapper::storeMessage(const char*msg,size_t length, const QString&folder) { QString p = MBOXPath+"/"; p+=folder; mailmbox_folder*f = 0; int r = mailmbox_init(p.latin1(),0,1,0,&f); if (r != MAIL_NO_ERROR) { Global::statusMessage(tr("Error init folder")); return; } r = mailmbox_append_message(f,msg,length); if (r != MAIL_NO_ERROR) { Global::statusMessage(tr("Error writing to message folder")); } mailmbox_done(f); } encodedString* MBOXwrapper::fetchRawBody(const RecMail&mail) { RecBody body; mailstorage*storage = mailstorage_new(NULL); QString p = MBOXPath+"/"; p+=mail.getMbox(); mailmessage * msg; char*data=0; size_t size; int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); mailfolder*folder; folder = mailfolder_new( storage,(char*)p.latin1(),NULL); r = mailfolder_connect(folder); if (r != MAIL_NO_ERROR) { Global::statusMessage(tr("Error initializing mbox")); mailfolder_free(folder); mailstorage_free(storage); return 0; } 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())); mailfolder_free(folder); mailstorage_free(storage); return 0; } r = mailmessage_fetch(msg,&data,&size); if (r != MAIL_NO_ERROR) { Global::statusMessage(tr("Error fetching mail %i").arg(mail.getNumber())); mailfolder_free(folder); mailstorage_free(storage); mailmessage_free(msg); return 0; } encodedString*result = new encodedString(data,size); mailfolder_free(folder); mailstorage_free(storage); mailmessage_free(msg); return result; } void MBOXwrapper::deleteMails(const QString & mailbox,QList<RecMail> &target) { QString p = MBOXPath+"/"; p+=mailbox; mailmbox_folder*f = 0; int r = mailmbox_init(p.latin1(),0,1,0,&f); if (r != MAIL_NO_ERROR) { qDebug("Error init folder"); return; } deleteMails(f,target); mailmbox_done(f); } void MBOXwrapper::deleteMails(mailmbox_folder*f,QList<RecMail> &target) { if (!f) return; int r; for (unsigned int i=0; i < target.count();++i) { r = mailmbox_delete_msg(f,target.at(i)->getNumber()); if (r!=MAILMBOX_NO_ERROR) { qDebug("error delete mail"); } } r = mailmbox_expunge(f); if (r != MAILMBOX_NO_ERROR) { qDebug("error expunge mailbox"); } } int MBOXwrapper::deleteAllMail(const Folder*tfolder) { if (!tfolder) return 0; QString p = MBOXPath+"/"+tfolder->getDisplayName(); int res = 1; mailfolder*folder = 0; mailmessage_list*l=0; mailstorage*storage = mailstorage_new(NULL); int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); if (r != MAIL_NO_ERROR) { Global::statusMessage(tr("Error initializing mbox")); res = 0; } if (res) { folder = mailfolder_new( storage,(char*)p.latin1(),NULL); r = mailfolder_connect(folder); if (r != MAIL_NO_ERROR) { Global::statusMessage(tr("Error initializing mbox")); res = 0; } } if (res) { r = mailsession_get_messages_list(folder->fld_session,&l); if (r != MAIL_NO_ERROR) { qDebug("Error message list"); res=0; } } for(unsigned int i = 0 ; l!= 0 && res==1 && i < carray_count(l->msg_tab) ; ++i) { r = mailsession_remove_message(folder->fld_session,i+1); if (r != MAIL_NO_ERROR) { Global::statusMessage(tr("Error deleting mail %1").arg(i+1)); res = 0; break; } } if (l) mailmessage_list_free(l); if (folder) mailfolder_free(folder); if (storage) mailstorage_free(storage); return res; } int MBOXwrapper::deleteMbox(const Folder*tfolder) { if (!tfolder) return 0; QString p = MBOXPath+"/"+tfolder->getDisplayName(); QFile fi(p); if (!fi.exists()) { Global::statusMessage(tr("Mailbox doesn't exist.")); return 0; } if (!fi.remove()) { Global::statusMessage(tr("Error deleting Mailbox.")); return 0; } return 1; } void MBOXwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) { mailfolder*folder = 0; mailstorage*storage = mailstorage_new(NULL); target_stat.message_count = 0; target_stat.message_unseen = 0; target_stat.message_recent = 0; QString p = MBOXPath+"/"+mailbox; QFile fi(p); if (!fi.exists()) { Global::statusMessage(tr("Mailbox doesn't exist.")); return; } int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); folder = mailfolder_new( storage,(char*)p.latin1(),NULL); r = mailfolder_connect(folder); r = mailsession_status_folder(folder->fld_session,(char*)mailbox.latin1(),&target_stat.message_count, &target_stat.message_recent,&target_stat.message_unseen); if (folder) mailfolder_free(folder); if (storage) mailstorage_free(storage); } MAILLIB::ATYPE MBOXwrapper::getType()const { - return wrapperType; + return MAILLIB::A_MBOX; } const QString&MBOXwrapper::getName()const { return MBOXName; } diff --git a/noncore/net/mail/libmailwrapper/mboxwrapper.h b/noncore/net/mail/libmailwrapper/mboxwrapper.h index a12a1dd..7e7f359 100644 --- a/noncore/net/mail/libmailwrapper/mboxwrapper.h +++ b/noncore/net/mail/libmailwrapper/mboxwrapper.h @@ -1,48 +1,47 @@ #ifndef __MBOX_WRAPPER_H #define __MBOX_WRAPPER_H #include "genericwrapper.h" #include <qstring.h> class RecMail; class RecBody; class encodedString; struct mailmbox_folder; class MBOXwrapper : public Genericwrapper { Q_OBJECT public: MBOXwrapper(const QString & dir,const QString&name); virtual ~MBOXwrapper(); virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); virtual QList<Folder>* listFolders(); virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); virtual void deleteMail(const RecMail&mail); virtual void answeredMail(const RecMail&mail); virtual int createMbox(const QString&folder,const Folder*f=0,const QString&d="",bool s=false); virtual int deleteMbox(const Folder*); virtual void storeMessage(const char*msg,size_t length, const QString&folder); virtual RecBody fetchBody( const RecMail &mail ); static void mbox_progress( size_t current, size_t maximum ); virtual encodedString* fetchRawBody(const RecMail&mail); virtual void deleteMails(const QString & FolderName,QList<RecMail> &target); virtual int deleteAllMail(const Folder*); virtual MAILLIB::ATYPE getType()const; virtual const QString&getName()const; protected: static void deleteMails(mailmbox_folder*f,QList<RecMail> &target); QString MBOXPath; QString MBOXName; - static const MAILLIB::ATYPE wrapperType; }; #endif diff --git a/noncore/net/mail/libmailwrapper/mhwrapper.cpp b/noncore/net/mail/libmailwrapper/mhwrapper.cpp index 179bd34..560eab0 100644 --- a/noncore/net/mail/libmailwrapper/mhwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mhwrapper.cpp @@ -1,445 +1,443 @@ #include "mhwrapper.h" #include "mailtypes.h" #include "mailwrapper.h" #include <libetpan/libetpan.h> #include <qdir.h> #include <qmessagebox.h> #include <stdlib.h> #include <qpe/global.h> #include <opie2/oprocess.h> -const MAILLIB::ATYPE MHwrapper::wrapperType=MAILLIB::A_MH; - MHwrapper::MHwrapper(const QString & mbox_dir,const QString&mbox_name) : Genericwrapper(),MHPath(mbox_dir),MHName(mbox_name) { if (MHPath.length()>0) { if (MHPath[MHPath.length()-1]=='/') { MHPath=MHPath.left(MHPath.length()-1); } qDebug(MHPath); QDir dir(MHPath); if (!dir.exists()) { dir.mkdir(MHPath); } init_storage(); } } void MHwrapper::init_storage() { int r; QString pre = MHPath; if (!m_storage) { m_storage = mailstorage_new(NULL); r = mh_mailstorage_init(m_storage,(char*)pre.latin1(),0,0,0); if (r != MAIL_NO_ERROR) { qDebug("error initializing storage"); mailstorage_free(m_storage); m_storage = 0; return; } } r = mailstorage_connect(m_storage); if (r!=MAIL_NO_ERROR) { qDebug("error connecting storage"); mailstorage_free(m_storage); m_storage = 0; } } void MHwrapper::clean_storage() { if (m_storage) { mailstorage_disconnect(m_storage); mailstorage_free(m_storage); m_storage = 0; } } MHwrapper::~MHwrapper() { clean_storage(); } void MHwrapper::listMessages(const QString & mailbox, QList<RecMail> &target ) { init_storage(); if (!m_storage) { return; } QString f = buildPath(mailbox); int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); if (r!=MAIL_NO_ERROR) { qDebug("listMessages: error selecting folder!"); return; } parseList(target,m_storage->sto_session,f); Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count())); } QList<Folder>* MHwrapper::listFolders() { QList<Folder> * folders = new QList<Folder>(); folders->setAutoDelete( false ); /* this is needed! */ if (m_storage) mailstorage_disconnect(m_storage); init_storage(); if (!m_storage) { return folders; } mail_list*flist = 0; clistcell*current=0; int r = mailsession_list_folders(m_storage->sto_session,NULL,&flist); if (r != MAIL_NO_ERROR || !flist) { qDebug("error getting folder list"); return folders; } for (current=clist_begin(flist->mb_list);current!=0;current=clist_next(current)) { QString t = (char*)current->data; t.replace(0,MHPath.length(),""); folders->append(new MHFolder(t,MHPath)); } mail_list_free(flist); return folders; } void MHwrapper::deleteMail(const RecMail&mail) { init_storage(); if (!m_storage) { return; } int r = mailsession_select_folder(m_storage->sto_session,(char*)mail.getMbox().latin1()); if (r!=MAIL_NO_ERROR) { qDebug("error selecting folder!"); return; } r = mailsession_remove_message(m_storage->sto_session,mail.getNumber()); if (r != MAIL_NO_ERROR) { qDebug("error deleting mail"); } } void MHwrapper::answeredMail(const RecMail&) { } RecBody MHwrapper::fetchBody( const RecMail &mail ) { RecBody body; init_storage(); if (!m_storage) { return body; } mailmessage * msg; char*data=0; size_t size; /* mail should hold the complete path! */ int r = mailsession_select_folder(m_storage->sto_session,(char*)mail.getMbox().latin1()); if (r != MAIL_NO_ERROR) { return body; } 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); mailmessage_fetch_result_free(msg,data); return body; } void MHwrapper::mbox_progress( size_t current, size_t maximum ) { qDebug("MH %i von %i",current,maximum); } QString MHwrapper::buildPath(const QString&p) { QString f=""; if (p.length()==0||p=="/") return MHPath; if (!p.startsWith(MHPath)) { f+=MHPath; } if (!p.startsWith("/")) { f+="/"; } f+=p; return f; } int MHwrapper::createMbox(const QString&folder,const Folder*pfolder,const QString&,bool ) { init_storage(); if (!m_storage) { return 0; } QString f; if (!pfolder) { // toplevel folder f = buildPath(folder); } else { f = pfolder->getName(); f+="/"; f+=folder; } qDebug(f); int r = mailsession_create_folder(m_storage->sto_session,(char*)f.latin1()); if (r != MAIL_NO_ERROR) { qDebug("error creating folder %i",r); return 0; } qDebug("Folder created"); return 1; } void MHwrapper::storeMessage(const char*msg,size_t length, const QString&Folder) { init_storage(); if (!m_storage) { return; } QString f = buildPath(Folder); int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); if (r!=MAIL_NO_ERROR) { qDebug("error selecting folder!"); return; } r = mailsession_append_message(m_storage->sto_session,(char*)msg,length); if (r!=MAIL_NO_ERROR) { qDebug("error storing mail"); } return; } encodedString* MHwrapper::fetchRawBody(const RecMail&mail) { encodedString*result = 0; init_storage(); if (!m_storage) { return result; } mailmessage * msg = 0; char*data=0; size_t size; int r = mailsession_select_folder(m_storage->sto_session,(char*)mail.getMbox().latin1()); if (r!=MAIL_NO_ERROR) { qDebug("error selecting folder!"); return result; } r = mailsession_get_message(m_storage->sto_session, mail.getNumber(), &msg); if (r != MAIL_NO_ERROR) { Global::statusMessage(tr("Error fetching mail %i").arg(mail.getNumber())); return 0; } r = mailmessage_fetch(msg,&data,&size); if (r != MAIL_NO_ERROR) { Global::statusMessage(tr("Error fetching mail %i").arg(mail.getNumber())); if (msg) mailmessage_free(msg); return 0; } result = new encodedString(data,size); if (msg) mailmessage_free(msg); return result; } void MHwrapper::deleteMails(const QString & mailbox,QList<RecMail> &target) { QString f = buildPath(mailbox); int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); if (r!=MAIL_NO_ERROR) { qDebug("deleteMails: error selecting folder!"); return; } RecMail*c = 0; for (unsigned int i=0; i < target.count();++i) { c = target.at(i); r = mailsession_remove_message(m_storage->sto_session,c->getNumber()); if (r != MAIL_NO_ERROR) { qDebug("error deleting mail"); break; } } } int MHwrapper::deleteAllMail(const Folder*tfolder) { init_storage(); if (!m_storage) { return 0; } int res = 1; if (!tfolder) return 0; int r = mailsession_select_folder(m_storage->sto_session,(char*)tfolder->getName().latin1()); if (r!=MAIL_NO_ERROR) { qDebug("error selecting folder!"); return 0; } mailmessage_list*l=0; r = mailsession_get_messages_list(m_storage->sto_session,&l); if (r != MAIL_NO_ERROR) { qDebug("Error message list"); res = 0; } unsigned j = 0; for(unsigned int i = 0 ; l!= 0 && res==1 && i < carray_count(l->msg_tab) ; ++i) { mailmessage * msg; msg = (mailmessage*)carray_get(l->msg_tab, i); j = msg->msg_index; r = mailsession_remove_message(m_storage->sto_session,j); if (r != MAIL_NO_ERROR) { Global::statusMessage(tr("Error deleting mail %1").arg(i+1)); res = 0; break; } } if (l) mailmessage_list_free(l); return res; } int MHwrapper::deleteMbox(const Folder*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; removeMboxfailed = false; if(!process->start(OProcess::Block, OProcess::All) ) { qDebug("could not start process"); return 0; } qDebug("mail box deleted"); return 1; } void MHwrapper::processEnded(OProcess *p) { if (p) delete p; } void MHwrapper::oprocessStderr(OProcess*, char *buffer, int ) { QString lineStr = buffer; QMessageBox::warning( 0, tr("Error"), lineStr ,tr("Ok") ); removeMboxfailed = true; } void MHwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) { init_storage(); if (!m_storage) { return; } target_stat.message_count = 0; target_stat.message_unseen = 0; target_stat.message_recent = 0; QString f = buildPath(mailbox); int r = mailsession_status_folder(m_storage->sto_session,(char*)f.latin1(),&target_stat.message_count, &target_stat.message_recent,&target_stat.message_unseen); if (r != MAIL_NO_ERROR) { Global::statusMessage(tr("Error retrieving status")); } } MAILLIB::ATYPE MHwrapper::getType()const { - return wrapperType; + return MAILLIB::A_MH; } const QString&MHwrapper::getName()const { return MHName; } void MHwrapper::mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) { init_storage(); if (!m_storage) { return; } if (targetWrapper != this) { 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()); 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()); } else { r = mailsession_copy_message(m_storage->sto_session,mail.getNumber(),(char*)tf.latin1()); } 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) { init_storage(); if (!m_storage) { return; } if (targetWrapper != this) { qDebug("Using generic"); Genericwrapper::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit); return; } if (!fromFolder) return; int r = mailsession_select_folder(m_storage->sto_session,(char*)fromFolder->getName().latin1()); if (r!=MAIL_NO_ERROR) { qDebug("error selecting source folder!"); return; } QString tf = buildPath(targetFolder); mailmessage_list*l=0; r = mailsession_get_messages_list(m_storage->sto_session,&l); if (r != MAIL_NO_ERROR) { qDebug("Error message list"); } unsigned j = 0; for(unsigned int i = 0 ; l!= 0 && i < carray_count(l->msg_tab) ; ++i) { mailmessage * msg; msg = (mailmessage*)carray_get(l->msg_tab, i); j = msg->msg_index; if (moveit) { r = mailsession_move_message(m_storage->sto_session,j,(char*)tf.latin1()); } else { r = mailsession_copy_message(m_storage->sto_session,j,(char*)tf.latin1()); } if (r != MAIL_NO_ERROR) { qDebug("Error copy/moving mail internal (%i)",r); break; } } if (l) mailmessage_list_free(l); } diff --git a/noncore/net/mail/libmailwrapper/mhwrapper.h b/noncore/net/mail/libmailwrapper/mhwrapper.h index c1ba78d..b7c23af 100644 --- a/noncore/net/mail/libmailwrapper/mhwrapper.h +++ b/noncore/net/mail/libmailwrapper/mhwrapper.h @@ -1,61 +1,60 @@ #ifndef __MH_WRAPPER_H #define __MH_WRAPPER_H #include "maildefines.h" #include "genericwrapper.h" #include <qstring.h> class RecMail; class RecBody; class encodedString; struct mailmbox_folder; class OProcess; class MHwrapper : public Genericwrapper { Q_OBJECT public: MHwrapper(const QString & dir,const QString&name); virtual ~MHwrapper(); virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); virtual QList<Folder>* listFolders(); virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); virtual void deleteMail(const RecMail&mail); virtual void answeredMail(const RecMail&mail); virtual void mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); virtual void mvcpAllMails(Folder*fromFolder,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); virtual int createMbox(const QString&folder,const Folder*f=0,const QString&d="",bool s=false); virtual int deleteMbox(const Folder*); virtual void storeMessage(const char*msg,size_t length, const QString&folder); virtual RecBody fetchBody( const RecMail &mail ); static void mbox_progress( size_t current, size_t maximum ); virtual encodedString* fetchRawBody(const RecMail&mail); virtual void deleteMails(const QString & FolderName,QList<RecMail> &target); virtual int deleteAllMail(const Folder*); virtual MAILLIB::ATYPE getType()const; virtual const QString&getName()const; public slots: /* for deleting maildirs we are using a system call */ virtual void oprocessStderr(OProcess*, char *buffer, int ); virtual void processEnded(OProcess *); protected: QString buildPath(const QString&p); QString MHPath; QString MHName; - static const MAILLIB::ATYPE wrapperType; void init_storage(); void clean_storage(); bool removeMboxfailed; }; #endif |