From 009717207645e1b560d1fac90752c805256accfa Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Mon, 2 Dec 2013 09:55:03 +0100 Subject: [PATCH] Rename mouse -> input. --- DrawingWindow.cpp | 18 +++++++++--------- DrawingWindow.h | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/DrawingWindow.cpp b/DrawingWindow.cpp index 5c918ba..071ab5c 100644 --- a/DrawingWindow.cpp +++ b/DrawingWindow.cpp @@ -665,11 +665,11 @@ bool DrawingWindow::waitMousePress(int &x, int &y, int &button, unsigned long time) { bool pressed; - safeLock(mouseMutex); + safeLock(inputMutex); if (terminateThread) { pressed = false; } else { - pressed = mouseCondition.wait(&mouseMutex, time) && !terminateThread; + pressed = inputCondition.wait(&inputMutex, time) && !terminateThread; if (pressed) { x = mousePos.x(); y = mousePos.y(); @@ -683,7 +683,7 @@ bool DrawingWindow::waitMousePress(int &x, int &y, int &button, button = 0; } } - safeUnlock(mouseMutex); + safeUnlock(inputMutex); return pressed; } @@ -753,7 +753,7 @@ void DrawingWindow::closeEvent(QCloseEvent *ev) timer.stop(); thread->exit(); syncMutex.lock(); - mouseMutex.lock(); + inputMutex.lock(); terminateThread = true; // this flag is needed for the case // where the following wakeAll() call // occurs between the @@ -761,8 +761,8 @@ void DrawingWindow::closeEvent(QCloseEvent *ev) // mutex lock in safeLock() called // from sync() syncCondition.wakeAll(); - mouseCondition.wakeAll(); - mouseMutex.unlock(); + inputCondition.wakeAll(); + inputMutex.unlock(); syncMutex.unlock(); QWidget::closeEvent(ev); if (!thread->wait(250)) { @@ -797,12 +797,12 @@ void DrawingWindow::customEvent(QEvent *ev) */ void DrawingWindow::mousePressEvent(QMouseEvent *ev) { - mouseMutex.lock(); + inputMutex.lock(); mousePos = ev->pos(); mouseButton = ev->button(); ev->accept(); - mouseCondition.wakeAll(); - mouseMutex.unlock(); + inputCondition.wakeAll(); + inputMutex.unlock(); } /*! diff --git a/DrawingWindow.h b/DrawingWindow.h index 4a9b9df..d60b9c6 100644 --- a/DrawingWindow.h +++ b/DrawingWindow.h @@ -95,8 +95,8 @@ private: QBasicTimer timer; QMutex imageMutex; - QMutex mouseMutex; - QWaitCondition mouseCondition; + QMutex inputMutex; + QWaitCondition inputCondition; QMutex syncMutex; QWaitCondition syncCondition; bool terminateThread; -- 2.20.1