From f77a9457e676a11520c8f52b33265cd825db0c79 Mon Sep 17 00:00:00 2001 From: zautrix Date: Sun, 31 Oct 2004 08:38:17 +0000 Subject: added delete dir to ompi --- (limited to 'kmicromail') diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp index 3aec13d..110583f 100644 --- a/kmicromail/libmailwrapper/imapwrapper.cpp +++ b/kmicromail/libmailwrapper/imapwrapper.cpp @@ -173,8 +173,9 @@ void IMAPwrapper::login() } if ( ssl ) { - //qDebug("using ssl "); + qDebug("using ssl "); err = mailimap_ssl_connect( m_imap, (char*)server.latin1(), port ); + qDebug("back "); } else { err = mailimap_socket_connect( m_imap, (char*)server.latin1(), port ); } diff --git a/kmicromail/libmailwrapper/mhwrapper.cpp b/kmicromail/libmailwrapper/mhwrapper.cpp index de6d220..90b5d23 100644 --- a/kmicromail/libmailwrapper/mhwrapper.cpp +++ b/kmicromail/libmailwrapper/mhwrapper.cpp @@ -299,7 +299,34 @@ int MHwrapper::deleteAllMail(const FolderP&tfolder) if (l) mailmessage_list_free(l); return res; } - +bool MHwrapper::rmDir(QString folder) // absolute path! +{ + QDir dir ( folder ); + if ( !dir.exists() ) + return false; + int i; + // qDebug("rmdir %s ",folder.latin1()); + QStringList list = dir.entryList(QDir::Dirs|QDir::Files|QDir::NoSymLinks|QDir::Hidden ); + for (i=0; igetName().latin1() ); -#if 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(Opie::Core::OProcess*)), - this, SLOT( processEnded(Opie::Core::OProcess*))); - connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)), - this, SLOT( oprocessStderr(Opie::Core::OProcess*,char*,int))); - */ - *process << command; - removeMboxfailed = false; - if(!process->start(OProcess::Block, OProcess::All) ) { - qDebug("could not start process "); - return 0; + //qDebug("*****************\ndel %s %s ", delDir.latin1(),tfolder->getName().latin1() ); + if ( !rmDir( tfolder->getName() )) { + qDebug("error deleteing folder %s ",tfolder->getName().latin1()); } -#endif - qDebug("mail box deleted "); + else + qDebug("mail box deleted %s ", tfolder->getName().latin1()); return 1; } diff --git a/kmicromail/libmailwrapper/mhwrapper.h b/kmicromail/libmailwrapper/mhwrapper.h index 87f8ca1..36a443a 100644 --- a/kmicromail/libmailwrapper/mhwrapper.h +++ b/kmicromail/libmailwrapper/mhwrapper.h @@ -51,6 +51,7 @@ protected: void init_storage(); void clean_storage(); + bool rmDir(QString folderabspath); bool removeMboxfailed; }; -- cgit v0.9.0.2