summaryrefslogtreecommitdiffstats
path: root/async/src/future.h
diff options
context:
space:
mode:
authorDan Vrátil <dvratil@redhat.com>2015-04-03 18:17:12 +0200
committerDan Vrátil <dvratil@redhat.com>2015-04-04 20:44:17 +0200
commit27bc3300d670d65b9c5332308605ef8263c3939c (patch)
tree038ced028bc2af9f600250feff845c9d4f936c54 /async/src/future.h
parent160255f96e46818b6df63b00f17f502df9ab0a79 (diff)
downloadsink-27bc3300d670d65b9c5332308605ef8263c3939c.tar.gz
sink-27bc3300d670d65b9c5332308605ef8263c3939c.zip
Async: implement progress reporting through future
This is a simplified progress reporting, since it does not report progress of ther overcall Job chain, but only of individual tasks, which makes it only really useful on one-task Jobs. TODO: propagate subjob progress to the Future user gets copy of TODO: compound progress reporting (be able to report a progress of the overall Job chain)
Diffstat (limited to 'async/src/future.h')
-rw-r--r--async/src/future.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/async/src/future.h b/async/src/future.h
index bc18f00..32c1015 100644
--- a/async/src/future.h
+++ b/async/src/future.h
@@ -54,6 +54,9 @@ public:
54 int errorCode() const; 54 int errorCode() const;
55 QString errorMessage() const; 55 QString errorMessage() const;
56 56
57 void setProgress(qreal progress);
58 void setProgress(int processed, int total);
59
57protected: 60protected:
58 class PrivateBase : public QSharedData 61 class PrivateBase : public QSharedData
59 { 62 {
@@ -197,12 +200,14 @@ class FutureWatcherBase : public QObject
197 200
198Q_SIGNALS: 201Q_SIGNALS:
199 void futureReady(); 202 void futureReady();
203 void futureProgress(qreal progress);
200 204
201protected: 205protected:
202 FutureWatcherBase(QObject *parent = nullptr); 206 FutureWatcherBase(QObject *parent = nullptr);
203 virtual ~FutureWatcherBase(); 207 virtual ~FutureWatcherBase();
204 208
205 void futureReadyCallback(); 209 void futureReadyCallback();
210 void futureProgressCallback(qreal progress);
206 211
207 void setFutureImpl(const Async::FutureBase &future); 212 void setFutureImpl(const Async::FutureBase &future);
208 213