aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/synchronousprocess.h
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2016-04-25 14:40:42 +0200
committerEike Ziller <eike.ziller@qt.io>2016-04-27 08:48:32 +0000
commit967177d3d8d345c9fea2db87885f486536b21c05 (patch)
treebab8d04f87e3b336b4f9a633f833e741347696e5 /src/libs/utils/synchronousprocess.h
parentcb08a44e7e763abfb56bdc009b9ad5e0fad83a82 (diff)
SynchronousProcess: Change exit code interpreter to function object
Change-Id: Ic48d4f5810f171c070f0980581fb6e45f6fe6b4a Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'src/libs/utils/synchronousprocess.h')
-rw-r--r--src/libs/utils/synchronousprocess.h13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/libs/utils/synchronousprocess.h b/src/libs/utils/synchronousprocess.h
index c8891122cf..758041b4b0 100644
--- a/src/libs/utils/synchronousprocess.h
+++ b/src/libs/utils/synchronousprocess.h
@@ -66,13 +66,8 @@ struct QTCREATOR_UTILS_EXPORT SynchronousProcessResponse
QTCREATOR_UTILS_EXPORT QDebug operator<<(QDebug str, const SynchronousProcessResponse &);
-class QTCREATOR_UTILS_EXPORT ExitCodeInterpreter : public QObject
-{
- Q_OBJECT
-public:
- ExitCodeInterpreter(QObject *parent) : QObject(parent) {}
- virtual SynchronousProcessResponse::Result interpretExitCode(int code) const;
-};
+using ExitCodeInterpreter = std::function<SynchronousProcessResponse::Result(int /*exitCode*/)>;
+QTCREATOR_UTILS_EXPORT SynchronousProcessResponse::Result defaultExitCodeInterpreter(int code);
class QTCREATOR_UTILS_EXPORT SynchronousProcess : public QObject
{
@@ -118,8 +113,8 @@ public:
unsigned flags() const;
void setFlags(unsigned);
- void setExitCodeInterpreter(ExitCodeInterpreter *interpreter);
- ExitCodeInterpreter *exitCodeInterpreter() const;
+ void setExitCodeInterpreter(const ExitCodeInterpreter &interpreter);
+ ExitCodeInterpreter exitCodeInterpreter() const;
SynchronousProcessResponse run(const QString &binary, const QStringList &args);