PageRenderTime 67ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/guitone-1.0rc5/src/monotone/MonotoneProcess.h

#
C Header | 63 lines | 33 code | 13 blank | 17 comment | 0 complexity | c56932cd5f3fd79c7d700f6db455758e MD5 | raw file
Possible License(s): GPL-3.0
  1. /***************************************************************************
  2. * Copyright (C) 2010 by Thomas Keller *
  3. * me@thomaskeller.biz *
  4. * *
  5. * This program is free software; you can redistribute it and/or modify *
  6. * it under the terms of the GNU General Public License as published by *
  7. * the Free Software Foundation, either version 3 of the License, or *
  8. * (at your option) any later version. *
  9. * *
  10. * This program is distributed in the hope that it will be useful, *
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  13. * GNU General Public License for more details. *
  14. * *
  15. * You should have received a copy of the GNU General Public License *
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>. *
  17. ***************************************************************************/
  18. #ifndef MONOTONE_PROCESS_H
  19. #define MONOTONE_PROCESS_H
  20. #include "vocab.h"
  21. #include "MonotoneResourceFile.h"
  22. #include <QProcess>
  23. #include <QStringList>
  24. class MonotoneProcess : public QProcess
  25. {
  26. Q_OBJECT
  27. public:
  28. MonotoneProcess();
  29. virtual ~MonotoneProcess();
  30. void start(const QStringList &);
  31. QString getBufferedOutput() const;
  32. void setMonotoneBinaryPath(const QString &);
  33. void setMonotoneHandle(const MonotoneHandlePtr &);
  34. bool successful();
  35. static bool singleRun(const QStringList &,
  36. const MonotoneHandlePtr & handle,
  37. QString & output);
  38. signals:
  39. void output(const QString &);
  40. void error(const QString &);
  41. private slots:
  42. void readOutput();
  43. void processError(QProcess::ProcessError);
  44. private:
  45. MonotoneHandlePtr monotoneHandle;
  46. QString monotoneBinaryPath;
  47. QString bufferedOutput;
  48. MonotoneResourceFile rcFile;
  49. };
  50. #endif