diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-02-24 14:47:20 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2016-02-24 14:47:20 +0000 |
commit | b736151c2bb6c68f700d38274d740a6e0cf59a49 (patch) | |
tree | 83e110a7205757addba6e86a3c2367e4b52afa05 /src/plugins/platforms/windows/qwindowsservices.cpp | |
parent | ff76300a5c9f209f625384f35ad0fdb0acebd799 (diff) | |
parent | 1fadc7292b66d4b3984bf5ef36c70b46b07a1c6b (diff) |
Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsservices.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsservices.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/plugins/platforms/windows/qwindowsservices.cpp b/src/plugins/platforms/windows/qwindowsservices.cpp index 2382be4e3c..3c99e3507e 100644 --- a/src/plugins/platforms/windows/qwindowsservices.cpp +++ b/src/plugins/platforms/windows/qwindowsservices.cpp @@ -59,7 +59,10 @@ static inline bool shellExecute(const QUrl &url) #ifndef Q_OS_WINCE const QString nativeFilePath = url.isLocalFile() ? QDir::toNativeSeparators(url.toLocalFile()) : url.toString(QUrl::FullyEncoded); - const quintptr result = (quintptr)ShellExecute(0, 0, (wchar_t*)nativeFilePath.utf16(), 0, 0, SW_SHOWNORMAL); + const quintptr result = + reinterpret_cast<quintptr>(ShellExecute(0, 0, + reinterpret_cast<const wchar_t *>(nativeFilePath.utf16()), + 0, 0, SW_SHOWNORMAL)); // ShellExecute returns a value greater than 32 if successful if (result <= 32) { qWarning("ShellExecute '%s' failed (error %s).", qPrintable(url.toString()), qPrintable(QString::number(result))); @@ -97,7 +100,7 @@ static inline QString mailCommand() if (debug) qDebug() << __FUNCTION__ << "keyName=" << keyName; command[0] = 0; - if (!RegOpenKeyExW(HKEY_CLASSES_ROOT, (const wchar_t*)keyName.utf16(), 0, KEY_READ, &handle)) { + if (!RegOpenKeyExW(HKEY_CLASSES_ROOT, reinterpret_cast<const wchar_t*>(keyName.utf16()), 0, KEY_READ, &handle)) { DWORD bufferSize = BufferSize; RegQueryValueEx(handle, L"", 0, 0, reinterpret_cast<unsigned char*>(command), &bufferSize); RegCloseKey(handle); @@ -140,7 +143,8 @@ static inline bool launchMail(const QUrl &url) STARTUPINFO si; ZeroMemory(&si, sizeof(si)); si.cb = sizeof(si); - if (!CreateProcess(NULL, (wchar_t*)command.utf16(), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) { + if (!CreateProcess(NULL, reinterpret_cast<wchar_t *>(const_cast<ushort *>(command.utf16())), + NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) { qErrnoWarning("Unable to launch '%s'", qPrintable(command)); return false; } |