summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowsservices.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-02-24 13:28:17 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2016-02-24 13:31:14 +0100
commit1fadc7292b66d4b3984bf5ef36c70b46b07a1c6b (patch)
tree7a54f6a2612dc469ddbc5afc2cc0010099b661fe /src/plugins/platforms/windows/qwindowsservices.cpp
parentea711d0f59d6272f14b61cb2fd3dc1ede2cc1eb6 (diff)
parentd8e65d5756c937fc3d9be3e5c30b31914a437393 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts: src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java src/plugins/platforms/windows/qwindowsfontengine.cpp src/plugins/platforms/windows/qwindowsnativeimage.cpp tests/auto/gui/kernel/qwindow/BLACKLIST tests/auto/gui/kernel/qwindow/tst_qwindow.cpp Change-Id: I649b32b260ce0ed2d6a5089021daa0d6a8db85f7
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsservices.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowsservices.cpp10
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;
}