summaryrefslogtreecommitdiffstats
path: root/src/gui/util
diff options
context:
space:
mode:
authorminiak <milan.burda@gmail.com>2009-12-22 13:57:59 (GMT)
committerJoerg Bornemann <joerg.bornemann@nokia.com>2009-12-22 14:42:30 (GMT)
commite60dbc9ca47a0e9371d619b7c5d24a4b3ec4fcd9 (patch)
tree4f1df650ecbb1f5a66c49ab9e4458d75ebeef095 /src/gui/util
parentef5291b0fd521b7f22169ebc2297f720120296d6 (diff)
downloadQt-e60dbc9ca47a0e9371d619b7c5d24a4b3ec4fcd9.zip
Qt-e60dbc9ca47a0e9371d619b7c5d24a4b3ec4fcd9.tar.gz
Qt-e60dbc9ca47a0e9371d619b7c5d24a4b3ec4fcd9.tar.bz2
fix small leftovers from the Win9x removal in the code
LoadLibraryW -> LoadLibrary RegOpenKeyExW -> RegOpenKeyEx qdesktopservices_win.cpp: buffer size fixed in launchWebBrowser() Windows NT 4.0 version condition removed Merge-request: 1627 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Diffstat (limited to 'src/gui/util')
-rw-r--r--src/gui/util/qdesktopservices_win.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/util/qdesktopservices_win.cpp b/src/gui/util/qdesktopservices_win.cpp
index 39443f2..e4c99a8 100644
--- a/src/gui/util/qdesktopservices_win.cpp
+++ b/src/gui/util/qdesktopservices_win.cpp
@@ -97,19 +97,19 @@ static bool launchWebBrowser(const QUrl &url)
if (url.scheme() == QLatin1String("mailto")) {
//Retrieve the commandline for the default mail client
//the default key used below is the command line for the mailto: shell command
- DWORD bufferSize = 2 * MAX_PATH;
+ DWORD bufferSize = sizeof(wchar_t) * MAX_PATH;
long returnValue = -1;
QString command;
HKEY handle;
LONG res;
- wchar_t keyValue[2 * MAX_PATH] = {0};
+ wchar_t keyValue[MAX_PATH] = {0};
QString keyName(QLatin1String("mailto"));
//Check if user has set preference, otherwise use default.
- res = RegOpenKeyExW(HKEY_CURRENT_USER,
- L"Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\mailto\\UserChoice",
- 0, KEY_READ, &handle);
+ res = RegOpenKeyEx(HKEY_CURRENT_USER,
+ L"Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\mailto\\UserChoice",
+ 0, KEY_READ, &handle);
if (res == ERROR_SUCCESS) {
returnValue = RegQueryValueEx(handle, L"Progid", 0, 0, reinterpret_cast<unsigned char*>(keyValue), &bufferSize);
if (!returnValue)
@@ -121,8 +121,8 @@ static bool launchWebBrowser(const QUrl &url)
if (res != ERROR_SUCCESS)
return false;
- bufferSize = 2 * MAX_PATH;
- returnValue = RegQueryValueExW(handle, L"", 0, 0, reinterpret_cast<unsigned char*>(keyValue), &bufferSize);
+ bufferSize = sizeof(wchar_t) * MAX_PATH;
+ returnValue = RegQueryValueEx(handle, L"", 0, 0, reinterpret_cast<unsigned char*>(keyValue), &bufferSize);
if (!returnValue)
command = QString::fromRawData((QChar*)keyValue, bufferSize);
RegCloseKey(handle);