From 6ced899c8e56d6bee0800b1ed1e7094e55c976a2 Mon Sep 17 00:00:00 2001 From: Dimitriy Ryazantcev Date: Thu, 18 Oct 2012 21:10:24 +0300 Subject: [PATCH] Liznoo: remove assert in win32 part. --- src/plugins/liznoo/fakeqwidgetwinapi.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/plugins/liznoo/fakeqwidgetwinapi.cpp b/src/plugins/liznoo/fakeqwidgetwinapi.cpp index 828009e..e9be77b 100644 --- a/src/plugins/liznoo/fakeqwidgetwinapi.cpp +++ b/src/plugins/liznoo/fakeqwidgetwinapi.cpp @@ -67,20 +67,21 @@ namespace Liznoo { if(message->message == WM_POWERBROADCAST) { - Q_ASSERT (message->wParam == PBT_POWERSETTINGCHANGE); + if (message->wParam == PBT_POWERSETTINGCHANGE) + { + const PPOWERBROADCAST_SETTING rcvd_setting = + reinterpret_cast (message->lParam); - const PPOWERBROADCAST_SETTING rcvd_setting = - reinterpret_cast (message->lParam); - - if (sizeof (GUID) == rcvd_setting->DataLength && - rcvd_setting->PowerSetting == GUID_POWERSCHEME_PERSONALITY) - prepareSchemeChange (rcvd_setting); - else if (sizeof (int) == rcvd_setting->DataLength && - rcvd_setting->PowerSetting == GUID_ACDC_POWER_SOURCE) - preparePowerSourceChange (rcvd_setting); - else if (sizeof (int) == rcvd_setting->DataLength && - rcvd_setting->PowerSetting == GUID_BATTERY_PERCENTAGE_REMAINING) - prepareBatteryStateChange (rcvd_setting); + if (sizeof (GUID) == rcvd_setting->DataLength && + rcvd_setting->PowerSetting == GUID_POWERSCHEME_PERSONALITY) + prepareSchemeChange (rcvd_setting); + else if (sizeof (int) == rcvd_setting->DataLength && + rcvd_setting->PowerSetting == GUID_ACDC_POWER_SOURCE) + preparePowerSourceChange (rcvd_setting); + else if (sizeof (int) == rcvd_setting->DataLength && + rcvd_setting->PowerSetting == GUID_BATTERY_PERCENTAGE_REMAINING) + prepareBatteryStateChange (rcvd_setting); + } } return QWidget::winEvent (message, result); } -- 1.7.11.msysgit.1