diff options
Diffstat (limited to 'Swift/QtUI/QtIdleDetector.cpp')
-rw-r--r-- | Swift/QtUI/QtIdleDetector.cpp | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/Swift/QtUI/QtIdleDetector.cpp b/Swift/QtUI/QtIdleDetector.cpp deleted file mode 100644 index 783cc14..0000000 --- a/Swift/QtUI/QtIdleDetector.cpp +++ /dev/null @@ -1,38 +0,0 @@ -#include "QtIdleDetector.h" - -#include <QCursor> - -namespace Swift { - -QtIdleDetector::QtIdleDetector() { - signalled_ = false; - lastMoveTime_ = QDateTime::currentDateTime(); - lastPosition_ = QCursor::pos(); - connect(&timer_, SIGNAL(timeout()), this, SLOT(handleTimerTick())); - timer_.start(1000); -} - -QtIdleDetector::~QtIdleDetector() { -} - -void QtIdleDetector::forceNotIdle() { - -} - -void QtIdleDetector::handleTimerTick() { - QPoint position = QCursor::pos(); - QDateTime now = QDateTime::currentDateTime(); - if (position != lastPosition_) { - if (signalled_) { - onInputNotIdle(); - } - lastPosition_ = position; - lastMoveTime_ = now; - signalled_ = false; - } else if (!signalled_ && now > lastMoveTime_.addSecs(600) && position == lastPosition_) { - signalled_ = true; - onInputIdle(); - } -} - -} |