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/k9process.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/k9process.cpp')
-rw-r--r-- | libk9copy/k9process.cpp | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/libk9copy/k9process.cpp b/libk9copy/k9process.cpp new file mode 100644 index 0000000..5b17545 --- /dev/null +++ b/libk9copy/k9process.cpp @@ -0,0 +1,59 @@ +// +// C++ Implementation: k9process +// +// Description: +// +// +// Author: Jean-Michel PETIT <[email protected]>, (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9process.h" +#include <qobject.h> +#include <qapplication.h> +#include <qeventloop.h> + +k9Process::k9Process(QObject *parent, const char *name) + : KProcess(parent, name),m_waitSync(false) +{ + connect(this,SIGNAL(processExited( KProcess* )),this,SLOT(slotProcessExited( KProcess* ))); + +} + + +k9Process::~k9Process() +{ +} + +void k9Process::sync() { + m_waitSync=true; + QApplication::eventLoop()->enterLoop(); +} + + +void k9Process::slotProcessExited( KProcess * proc) { + if (m_waitSync) { + QApplication::eventLoop()->exitLoop(); + m_waitSync=false; + } +} + +const QString & k9Process::debug() { + m_debug=""; + for (int i=0;i<arguments.count();i++ ){ + m_debug +=" "+ *(arguments.at(i)); + } + return m_debug; +} + +bool k9Process::start (RunMode runmode, Communication comm) { + m_elapsed.start(); + return KProcess::start(runmode,comm); +} +#include "k9process.moc" + + +int k9Process::getElapsed() const { + return m_elapsed.elapsed(); +} |