diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-17 00:32:19 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-17 00:32:19 +0000 |
commit | 0d382a262c0638d0f572fc37193ccc5ed3dc895f (patch) | |
tree | 8578dcddfce4191f3f7a142a37769df7add48475 /libk9copy/k9tools.cpp | |
download | k9copy-0d382a262c0638d0f572fc37193ccc5ed3dc895f.tar.gz k9copy-0d382a262c0638d0f572fc37193ccc5ed3dc895f.zip |
Added old abandoned version of k9copy
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/k9copy@1091546 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libk9copy/k9tools.cpp')
-rw-r--r-- | libk9copy/k9tools.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/libk9copy/k9tools.cpp b/libk9copy/k9tools.cpp new file mode 100644 index 0000000..1464553 --- /dev/null +++ b/libk9copy/k9tools.cpp @@ -0,0 +1,38 @@ +// +// C++ Implementation: k9tools +// +// Description: +// +// +// Author: Jean-Michel PETIT <[email protected]>, (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9tools.h" +#include <kstandarddirs.h> +#include <qdir.h> + +bool k9Tools::checkProgram(QString _progName) { + return KStandardDirs::findExe( _progName,NULL,false) !=NULL ; +} + +void k9Tools::clearOutput(QString name) { + QDir dir(name); + //delete files in directory + QStringList lst = dir.entryList( "*",QDir::Files |QDir::Hidden ); + for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { + //QString c(( *it ).latin1() ); + dir.remove (*it); + } + //scanning subdir + QStringList lstdir = dir.entryList( "*",QDir::Dirs ); + for ( QStringList::Iterator it = lstdir.begin(); it != lstdir.end(); ++it ) { + QString c=*it; + if ((c!=".") && c!="..") { + clearOutput(dir.absFilePath(c)); + dir.rmdir(c); + } + } + +} |