From 059831534c7e884f0a607ed86b582fd00d821731 Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Sat, 26 Sep 2026 23:24:03 +0200 Subject: New upstream version 3.2.0~rc1+dfsg --- AutoRespondSelectionLatch.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 AutoRespondSelectionLatch.cpp (limited to 'AutoRespondSelectionLatch.cpp') diff --git a/AutoRespondSelectionLatch.cpp b/AutoRespondSelectionLatch.cpp new file mode 100644 index 00000000..9693b89d --- /dev/null +++ b/AutoRespondSelectionLatch.cpp @@ -0,0 +1,25 @@ +#include "AutoRespondSelectionLatch.hpp" + +AutoRespondSelectionLatch::AutoRespondSelectionLatch(QObject * parent) + : QObject {parent} +{ + m_resetTimer.setSingleShot(true); + connect(&m_resetTimer, &QTimer::timeout, this, [this] { clear(); }); +} + +bool AutoRespondSelectionLatch::isSelected() const +{ + return m_selected; +} + +void AutoRespondSelectionLatch::selectFor(int delayMs) +{ + m_selected = true; + m_resetTimer.start(delayMs); +} + +void AutoRespondSelectionLatch::clear() +{ + m_resetTimer.stop(); + m_selected = false; +} -- cgit v1.2.3