diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | e9ae80694875f869892f13f4fcaf1170a00dea41 (patch) | |
tree | aa2f8d8a217e2d376224c8d46b7397b68d35de2d /kommander/widget/myprocess.h | |
download | tdewebdev-e9ae80694875f869892f13f4fcaf1170a00dea41.tar.gz tdewebdev-e9ae80694875f869892f13f4fcaf1170a00dea41.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kommander/widget/myprocess.h')
-rw-r--r-- | kommander/widget/myprocess.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/kommander/widget/myprocess.h b/kommander/widget/myprocess.h new file mode 100644 index 00000000..8487f170 --- /dev/null +++ b/kommander/widget/myprocess.h @@ -0,0 +1,58 @@ +/*************************************************************************** + myprocess.h - Wrapper class for running shell processes + ------------------- + copyright : (C) 2002 by Marc Britton + email : consume@optusnet.com.au + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +#ifndef _HAVE_MYPROCESS_H_ +#define _HAVE_MYPROCESS_H_ + +/* KDE INCLUDES */ +#include <kprocess.h> + +/* QT INCLUDES */ +#include <qstring.h> +#include <qobject.h> +#include "kommander_export.h" + +class KommanderWidget; + +class KOMMANDER_EXPORT MyProcess : public QObject +{ + Q_OBJECT +public: + MyProcess(const KommanderWidget *); + // Run given command, using a_shell as a shell (this can be overridden by shebang in the first line) + // Process is run in blocking mode. + QString run(const QString& a_command, const QString& a_shell = "/bin/sh"); + // Kill running process + void cancel(); + void setBlocking(bool blocking); + bool isBlocking() const; + QString output() const; +signals: + void processExited(MyProcess*); + void processReceivedStdout(MyProcess*, char*, int); +private slots: + void slotReceivedStdout(KProcess*, char*, int); + void slotProcessExited(KProcess*); +protected: + const KommanderWidget *m_atw; + QString m_output; + QCString m_input; + bool m_loopStarted; + bool m_blocking; + bool m_handleOutput; + KProcess* mProcess; +}; + +#endif |