From a79cb5182b2476e49d699db674951d09abbd1206 Mon Sep 17 00:00:00 2001 From: BlackMark Date: Sun, 5 Jul 2020 21:56:00 +0200 Subject: [PATCH] Add debug log before and after setting brightness --- AdaptiveBrightness/monitor_win.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/AdaptiveBrightness/monitor_win.cpp b/AdaptiveBrightness/monitor_win.cpp index b04dc15..ff98e77 100644 --- a/AdaptiveBrightness/monitor_win.cpp +++ b/AdaptiveBrightness/monitor_win.cpp @@ -36,6 +36,12 @@ bool Monitor::setBrightness(float percentage) { m_errorOccurred = true; + qDebug(ltr("Setting brightness of monitor '%1' with handle '0x%2' and physical handle '0x%3' to %4") + .arg(m_physicalMonitor.name) + .arg(reinterpret_cast(m_hMonitor), 0, 16) + .arg(reinterpret_cast(m_physicalMonitor.handle), 0, 16) + .arg(percentage)); + if(!m_brightnessRange) { qDebug(ltr("No brightness range known for monitor '%1' with handle '0x%2' and physical handle '0x%3'") .arg(m_physicalMonitor.name) @@ -58,11 +64,7 @@ bool Monitor::setBrightness(float percentage) return false; } - qDebug(ltr("Setting brightness of monitor '%1' with handle '0x%2' and physical handle '0x%3' to %4") - .arg(m_physicalMonitor.name) - .arg(reinterpret_cast(m_hMonitor), 0, 16) - .arg(reinterpret_cast(m_physicalMonitor.handle), 0, 16) - .arg(newBrightness)); + qDebug(ltr("Set brightness to %4").arg(newBrightness)); m_errorOccurred = false;