Browse Source

Use Unicode version of InitiateSystemShutdown

adaptive-webui-19844
Chocobo1 7 years ago
parent
commit
5819b6dd39
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 5
      src/base/utils/misc.cpp

5
src/base/utils/misc.cpp

@ -124,7 +124,10 @@ void Utils::Misc::shutdownComputer(const ShutdownDialogAction &action) @@ -124,7 +124,10 @@ void Utils::Misc::shutdownComputer(const ShutdownDialogAction &action)
setSuspendState(true, false, false);
}
else {
InitiateSystemShutdownA(0, QCoreApplication::translate("misc", "qBittorrent will shutdown the computer now because all downloads are complete.").toLocal8Bit().data(), 10, true, false);
const QString msg = QCoreApplication::translate("misc", "qBittorrent will shutdown the computer now because all downloads are complete.");
std::unique_ptr<wchar_t[]> msgWchar(new wchar_t[msg.length() + 1] {});
msg.toWCharArray(msgWchar.get());
::InitiateSystemShutdownW(nullptr, msgWchar.get(), 10, true, false);
}
// Disable shutdown privilege.

Loading…
Cancel
Save