Reformat code

This commit is contained in:
Chocobo1 2021-11-04 12:23:31 +08:00
parent 22abbc1d41
commit 71270260bf
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
8 changed files with 147 additions and 130 deletions

View file

@ -133,18 +133,18 @@ void Utils::Misc::shutdownComputer(const ShutdownDialogAction &action)
if (action == ShutdownDialogAction::Suspend)
{
::SetSuspendState(false, false, false);
::SetSuspendState(FALSE, FALSE, FALSE);
}
else if (action == ShutdownDialogAction::Hibernate)
{
::SetSuspendState(true, false, false);
::SetSuspendState(TRUE, FALSE, FALSE);
}
else
{
const QString msg = QCoreApplication::translate("misc", "qBittorrent will shutdown the computer now because all downloads are complete.");
auto msgWchar = std::make_unique<wchar_t[]>(msg.length() + 1);
msg.toWCharArray(msgWchar.get());
::InitiateSystemShutdownW(nullptr, msgWchar.get(), 10, true, false);
::InitiateSystemShutdownW(nullptr, msgWchar.get(), 10, TRUE, FALSE);
}
// Disable shutdown privilege.