mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-10 23:42:46 -07:00
Reformat code
This commit is contained in:
parent
22abbc1d41
commit
71270260bf
8 changed files with 147 additions and 130 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue