summaryrefslogtreecommitdiff
path: root/noncore/net/mail/libmailwrapper/mhwrapper.cpp
Unidiff
Diffstat (limited to 'noncore/net/mail/libmailwrapper/mhwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/mhwrapper.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/noncore/net/mail/libmailwrapper/mhwrapper.cpp b/noncore/net/mail/libmailwrapper/mhwrapper.cpp
index 21e24a0..5eae31f 100644
--- a/noncore/net/mail/libmailwrapper/mhwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/mhwrapper.cpp
@@ -1,25 +1,23 @@
1#include "mhwrapper.h" 1#include "mhwrapper.h"
2#include "mailtypes.h" 2#include "mailtypes.h"
3#include "mailwrapper.h" 3#include "mailwrapper.h"
4#include <libetpan/libetpan.h> 4#include <libetpan/libetpan.h>
5#include <qdir.h> 5#include <qdir.h>
6#include <qmessagebox.h> 6#include <qmessagebox.h>
7#include <stdlib.h> 7#include <stdlib.h>
8#include <qpe/global.h> 8#include <qpe/global.h>
9#include <opie2/oprocess.h> 9#include <opie2/oprocess.h>
10 10
11using namespace Opie::Core; 11using namespace Opie::Core;
12using namespace Opie::Core;
13using namespace Opie::Core;
14MHwrapper::MHwrapper(const QString & mbox_dir,const QString&mbox_name) 12MHwrapper::MHwrapper(const QString & mbox_dir,const QString&mbox_name)
15 : Genericwrapper(),MHPath(mbox_dir),MHName(mbox_name) 13 : Genericwrapper(),MHPath(mbox_dir),MHName(mbox_name)
16{ 14{
17 if (MHPath.length()>0) { 15 if (MHPath.length()>0) {
18 if (MHPath[MHPath.length()-1]=='/') { 16 if (MHPath[MHPath.length()-1]=='/') {
19 MHPath=MHPath.left(MHPath.length()-1); 17 MHPath=MHPath.left(MHPath.length()-1);
20 } 18 }
21 qDebug(MHPath); 19 qDebug(MHPath);
22 QDir dir(MHPath); 20 QDir dir(MHPath);
23 if (!dir.exists()) { 21 if (!dir.exists()) {
24 dir.mkdir(MHPath); 22 dir.mkdir(MHPath);
25 } 23 }
@@ -312,27 +310,27 @@ int MHwrapper::deleteMbox(const FolderP&tfolder)
312 if (r != MAIL_NO_ERROR) { 310 if (r != MAIL_NO_ERROR) {
313 qDebug("error deleting mail box"); 311 qDebug("error deleting mail box");
314 return 0; 312 return 0;
315 } 313 }
316 QString cmd = "rm -rf "+tfolder->getName(); 314 QString cmd = "rm -rf "+tfolder->getName();
317 QStringList command; 315 QStringList command;
318 command << "/bin/sh"; 316 command << "/bin/sh";
319 command << "-c"; 317 command << "-c";
320 command << cmd.latin1(); 318 command << cmd.latin1();
321 OProcess *process = new OProcess(); 319 OProcess *process = new OProcess();
322 320
323 connect(process, SIGNAL(processExited(Opie::Core::OProcess*)), 321 connect(process, SIGNAL(processExited(Opie::Core::OProcess*)),
324 this, SLOT( processEnded(OProcess*))); 322 this, SLOT( processEnded(Opie::Core::OProcess*)));
325 connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)), 323 connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)),
326 this, SLOT( oprocessStderr(OProcess*,char*,int))); 324 this, SLOT( oprocessStderr(Opie::Core::OProcess*,char*,int)));
327 325
328 *process << command; 326 *process << command;
329 removeMboxfailed = false; 327 removeMboxfailed = false;
330 if(!process->start(OProcess::Block, OProcess::All) ) { 328 if(!process->start(OProcess::Block, OProcess::All) ) {
331 qDebug("could not start process"); 329 qDebug("could not start process");
332 return 0; 330 return 0;
333 } 331 }
334 qDebug("mail box deleted"); 332 qDebug("mail box deleted");
335 return 1; 333 return 1;
336} 334}
337 335
338void MHwrapper::processEnded(OProcess *p) 336void MHwrapper::processEnded(OProcess *p)