aboutsummaryrefslogtreecommitdiffstats
path: root/Godeps/_workspace/src/github.com/obscuren/qml/cpp/idletimer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Godeps/_workspace/src/github.com/obscuren/qml/cpp/idletimer.cpp')
-rw-r--r--Godeps/_workspace/src/github.com/obscuren/qml/cpp/idletimer.cpp58
1 files changed, 0 insertions, 58 deletions
diff --git a/Godeps/_workspace/src/github.com/obscuren/qml/cpp/idletimer.cpp b/Godeps/_workspace/src/github.com/obscuren/qml/cpp/idletimer.cpp
deleted file mode 100644
index 3bd097508..000000000
--- a/Godeps/_workspace/src/github.com/obscuren/qml/cpp/idletimer.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-#include <QBasicTimer>
-#include <QThread>
-#include <QDebug>
-#include <mutex>
-
-#include "capi.h"
-
-class IdleTimer : public QObject
-{
- Q_OBJECT
-
- public:
-
- static IdleTimer *singleton() {
- static IdleTimer singleton;
- return &singleton;
- }
-
- void init(int32_t *guiIdleRun)
- {
- this->guiIdleRun = guiIdleRun;
- }
-
- Q_INVOKABLE void start()
- {
- timer.start(0, this);
- }
-
- protected:
-
- void timerEvent(QTimerEvent *event)
- {
- __sync_synchronize();
- if (*guiIdleRun > 0) {
- hookIdleTimer();
- } else {
- timer.stop();
- }
- }
-
- private:
-
- int32_t *guiIdleRun;
-
- QBasicTimer timer;
-};
-
-void idleTimerInit(int32_t *guiIdleRun)
-{
- IdleTimer::singleton()->init(guiIdleRun);
-}
-
-void idleTimerStart()
-{
- QMetaObject::invokeMethod(IdleTimer::singleton(), "start", Qt::QueuedConnection);
-}
-
-// vim:ts=4:sw=4:et:ft=cpp