summaryrefslogtreecommitdiff
path: root/noncore/net/mail/libmailwrapper/mhwrapper.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/mail/libmailwrapper/mhwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/mhwrapper.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/noncore/net/mail/libmailwrapper/mhwrapper.cpp b/noncore/net/mail/libmailwrapper/mhwrapper.cpp
index 0b00a2e..21e24a0 100644
--- a/noncore/net/mail/libmailwrapper/mhwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/mhwrapper.cpp
@@ -1,22 +1,25 @@
#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>
+using namespace Opie::Core;
+using namespace Opie::Core;
+using namespace Opie::Core;
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);
}
@@ -51,43 +54,43 @@ 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, QValueList<Opie::OSmartPointer<RecMail> > &target )
+void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<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()));
}
-QValueList<Opie::OSmartPointer<Folder> >* MHwrapper::listFolders()
+QValueList<Opie::Core::OSmartPointer<Folder> >* MHwrapper::listFolders()
{
- QValueList<Opie::OSmartPointer<Folder> >* folders = new QValueList<Opie::OSmartPointer<Folder> >();
+ QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >();
/* 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;
@@ -308,27 +311,27 @@ int MHwrapper::deleteMbox(const FolderP&tfolder)
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*)),
+ connect(process, SIGNAL(processExited(Opie::Core::OProcess*)),
this, SLOT( processEnded(OProcess*)));
- connect(process, SIGNAL( receivedStderr(OProcess*,char*,int)),
+ connect(process, SIGNAL( receivedStderr(Opie::Core::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;
}