Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rodlie committed Oct 25, 2018
1 parent 73d7a39 commit 8a0f0d6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/systray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -832,22 +832,27 @@ void SysTray::disableHibernate()
if (criticalAction == criticalHibernate) {
qWarning() << "reset critical action to shutdown";
criticalAction = criticalShutdown;
Common::savePowerSettings(CONF_CRITICAL_BATTERY_ACTION, criticalAction);
}
if (lidActionBattery == lidHibernate) {
qWarning() << "reset lid battery action to lock";
lidActionBattery = lidLock;
Common::savePowerSettings(CONF_LID_BATTERY_ACTION, lidActionBattery);
}
if (lidActionAC == lidHibernate) {
qWarning() << "reset lid ac action to lock";
lidActionAC = lidLock;
Common::savePowerSettings(CONF_LID_AC_ACTION, lidActionAC);
}
if (autoSuspendBatteryAction == suspendHibernate) {
qWarning() << "reset auto suspend battery action to none";
autoSuspendBatteryAction = suspendNone;
Common::savePowerSettings(CONF_SUSPEND_BATTERY_ACTION, autoSuspendBatteryAction);
}
if (autoSuspendACAction == suspendHibernate) {
qWarning() << "reset auto suspend ac action to none";
autoSuspendACAction = suspendNone;
Common::savePowerSettings(CONF_SUSPEND_AC_ACTION, autoSuspendACAction);
}
}

Expand All @@ -857,18 +862,22 @@ void SysTray::disableSuspend()
if (lidActionBattery == lidSleep) {
qWarning() << "reset lid battery action to lock";
lidActionBattery = lidLock;
Common::savePowerSettings(CONF_LID_BATTERY_ACTION, lidActionBattery);
}
if (lidActionAC == lidSleep) {
qWarning() << "reset lid ac action to lock";
lidActionAC = lidLock;
Common::savePowerSettings(CONF_LID_AC_ACTION, lidActionAC);
}
if (autoSuspendBatteryAction == suspendSleep) {
qWarning() << "reset auto suspend battery action to none";
autoSuspendBatteryAction = suspendNone;
Common::savePowerSettings(CONF_SUSPEND_BATTERY_ACTION, autoSuspendBatteryAction);
}
if (autoSuspendACAction == suspendSleep) {
qWarning() << "reset auto suspend ac action to none";
autoSuspendACAction = suspendNone;
Common::savePowerSettings(CONF_SUSPEND_AC_ACTION, autoSuspendACAction);
}
}

Expand Down

0 comments on commit 8a0f0d6

Please sign in to comment.