mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-29 13:58:51 +03:00
Use Unicode version of InitiateSystemShutdown
This commit is contained in:
parent
644e7d0450
commit
5819b6dd39
1 changed files with 4 additions and 1 deletions
|
@ -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…
Reference in a new issue