Changeset 846 for trunk/src/gui/util/qdesktopservices_win.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/util/qdesktopservices_win.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 42 42 #include <qsettings.h> 43 43 #include <qdir.h> 44 #include < qlibrary.h>44 #include <private/qsystemlibrary_p.h> 45 45 #include <qurl.h> 46 46 #include <qstringlist.h> … … 60 60 #endif 61 61 62 #if defined(Q_CC_MINGW) && !defined(CSIDL_MYMUSIC)62 #ifndef CSIDL_MYMUSIC 63 63 #define CSIDL_MYMUSIC 13 64 64 #define CSIDL_MYVIDEO 14 … … 98 98 //Retrieve the commandline for the default mail client 99 99 //the default key used below is the command line for the mailto: shell command 100 DWORD bufferSize = 2* MAX_PATH;100 DWORD bufferSize = sizeof(wchar_t) * MAX_PATH; 101 101 long returnValue = -1; 102 102 QString command; … … 104 104 HKEY handle; 105 105 LONG res; 106 wchar_t keyValue[ 2 *MAX_PATH] = {0};106 wchar_t keyValue[MAX_PATH] = {0}; 107 107 QString keyName(QLatin1String("mailto")); 108 108 109 109 //Check if user has set preference, otherwise use default. 110 res = RegOpenKeyEx W(HKEY_CURRENT_USER,111 112 110 res = RegOpenKeyEx(HKEY_CURRENT_USER, 111 L"Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\mailto\\UserChoice", 112 0, KEY_READ, &handle); 113 113 if (res == ERROR_SUCCESS) { 114 114 returnValue = RegQueryValueEx(handle, L"Progid", 0, 0, reinterpret_cast<unsigned char*>(keyValue), &bufferSize); … … 122 122 return false; 123 123 124 bufferSize = 2* MAX_PATH;125 returnValue = RegQueryValueEx W(handle, L"", 0, 0, reinterpret_cast<unsigned char*>(keyValue), &bufferSize);124 bufferSize = sizeof(wchar_t) * MAX_PATH; 125 returnValue = RegQueryValueEx(handle, L"", 0, 0, reinterpret_cast<unsigned char*>(keyValue), &bufferSize); 126 126 if (!returnValue) 127 127 command = QString::fromRawData((QChar*)keyValue, bufferSize); … … 178 178 179 179 #ifndef Q_OS_WINCE 180 Q Library library(QLatin1String("shell32"));181 #else 182 Q Library library(QLatin1String("coredll"));180 QSystemLibrary library(QLatin1String("shell32")); 181 #else 182 QSystemLibrary library(QLatin1String("coredll")); 183 183 #endif // Q_OS_WINCE 184 184 typedef BOOL (WINAPI*GetSpecialFolderPath)(HWND, LPWSTR, int, BOOL);
Note:
See TracChangeset
for help on using the changeset viewer.