From 9ca593d3ed203df4404f051dad426b04e6624512 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 12 Sep 2016 22:03:10 +0200 Subject: compat/util: replace with QSignalBlocker usages --- compat/util.hpp | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/compat/util.hpp b/compat/util.hpp index 453d94bd..20be92a4 100644 --- a/compat/util.hpp +++ b/compat/util.hpp @@ -23,29 +23,6 @@ void run_in_thread_async(QObject* obj, F&& fun) QObject::connect(&src, &QObject::destroyed, obj, std::move(fun), Qt::AutoConnection); } -class inhibit_qt_signals final -{ - QObject& val; - bool operate_p; - -public: - inhibit_qt_signals(QObject& val) : val(val), operate_p(!val.signalsBlocked()) - { - if (operate_p) - val.blockSignals(true); - } - - ~inhibit_qt_signals() - { - if (operate_p) - val.blockSignals(false); - } - - inhibit_qt_signals(QObject* val) : inhibit_qt_signals(*val) {} - inhibit_qt_signals(std::unique_ptr val) : inhibit_qt_signals(*val.get()) {} - inhibit_qt_signals(std::shared_ptr val) : inhibit_qt_signals(*val.get()) {} -}; - template auto clamp(t val, u min, w max) -> decltype (val * min * max) { -- cgit v1.2.3