Add debug log before and after setting brightness

This commit is contained in:
BlackMark 2020-07-05 21:56:00 +02:00
parent cdb5f8be39
commit a79cb5182b

View File

@ -36,6 +36,12 @@ bool Monitor::setBrightness(float percentage)
{ {
m_errorOccurred = true; 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<qulonglong>(m_hMonitor), 0, 16)
.arg(reinterpret_cast<qulonglong>(m_physicalMonitor.handle), 0, 16)
.arg(percentage));
if(!m_brightnessRange) { if(!m_brightnessRange) {
qDebug(ltr("No brightness range known for monitor '%1' with handle '0x%2' and physical handle '0x%3'") qDebug(ltr("No brightness range known for monitor '%1' with handle '0x%2' and physical handle '0x%3'")
.arg(m_physicalMonitor.name) .arg(m_physicalMonitor.name)
@ -58,11 +64,7 @@ bool Monitor::setBrightness(float percentage)
return false; return false;
} }
qDebug(ltr("Setting brightness of monitor '%1' with handle '0x%2' and physical handle '0x%3' to %4") qDebug(ltr("Set brightness to %4").arg(newBrightness));
.arg(m_physicalMonitor.name)
.arg(reinterpret_cast<qulonglong>(m_hMonitor), 0, 16)
.arg(reinterpret_cast<qulonglong>(m_physicalMonitor.handle), 0, 16)
.arg(newBrightness));
m_errorOccurred = false; m_errorOccurred = false;