summaryrefslogtreecommitdiffstats
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
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>
-rwxr-xr-xbin/syncqt3
-rw-r--r--src/corelib/io/qfsfileengine_win.cpp15
-rw-r--r--src/gui/dialogs/qfiledialog_win.cpp7
-rw-r--r--src/gui/text/qfontdatabase_win.cpp1
-rw-r--r--src/gui/util/qdesktopservices_win.cpp14
5 files changed, 15 insertions, 25 deletions
diff --git a/bin/syncqt b/bin/syncqt
index e19018c..13e792b 100755
--- a/bin/syncqt
+++ b/bin/syncqt
@@ -578,9 +578,6 @@ while ( @ARGV ) {
} elsif("$arg" eq "-show") {
$var = "showonly";
$val = "yes";
- } elsif("$arg" eq '*') {
- # workaround for windows 9x where "%*" expands to "*"
- $var = 1;
}
#do something
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp
index 10a7c54..36cf67b 100644
--- a/src/corelib/io/qfsfileengine_win.cpp
+++ b/src/corelib/io/qfsfileengine_win.cpp
@@ -177,7 +177,7 @@ void QFSFileEnginePrivate::resolveLibs()
triedResolve = true;
#if !defined(Q_OS_WINCE)
- HINSTANCE advapiHnd = LoadLibraryW(L"advapi32");
+ HINSTANCE advapiHnd = LoadLibrary(L"advapi32");
if (advapiHnd) {
ptrGetNamedSecurityInfoW = (PtrGetNamedSecurityInfoW)GetProcAddress(advapiHnd, "GetNamedSecurityInfoW");
ptrLookupAccountSidW = (PtrLookupAccountSidW)GetProcAddress(advapiHnd, "LookupAccountSidW");
@@ -209,7 +209,7 @@ void QFSFileEnginePrivate::resolveLibs()
ptrFreeSid(pWorld);
}
}
- HINSTANCE userenvHnd = LoadLibraryW(L"userenv");
+ HINSTANCE userenvHnd = LoadLibrary(L"userenv");
if (userenvHnd)
ptrGetUserProfileDirectoryW = (PtrGetUserProfileDirectoryW)GetProcAddress(userenvHnd, "GetUserProfileDirectoryW");
#endif
@@ -217,7 +217,6 @@ void QFSFileEnginePrivate::resolveLibs()
}
#endif // QT_NO_LIBRARY
-// UNC functions NT
typedef DWORD (WINAPI *PtrNetShareEnum)(LPWSTR, DWORD, LPBYTE*, DWORD, LPDWORD, LPDWORD, LPDWORD);
static PtrNetShareEnum ptrNetShareEnum = 0;
typedef DWORD (WINAPI *PtrNetApiBufferFree)(LPVOID);
@@ -241,7 +240,7 @@ bool QFSFileEnginePrivate::resolveUNCLibs()
#endif
triedResolve = true;
#if !defined(Q_OS_WINCE)
- HINSTANCE hLib = LoadLibraryW(L"Netapi32");
+ HINSTANCE hLib = LoadLibrary(L"netapi32");
if (hLib) {
ptrNetShareEnum = (PtrNetShareEnum)GetProcAddress(hLib, "NetShareEnum");
if (ptrNetShareEnum)
@@ -1038,11 +1037,11 @@ QString QFSFileEngine::homePath()
if (ok) {
DWORD dwBufferSize = 0;
// First call, to determine size of the strings (with '\0').
- ok = ::ptrGetUserProfileDirectoryW(token, NULL, &dwBufferSize);
+ ok = ptrGetUserProfileDirectoryW(token, NULL, &dwBufferSize);
if (!ok && dwBufferSize != 0) { // We got the required buffer size
wchar_t *userDirectory = new wchar_t[dwBufferSize];
// Second call, now we can fill the allocated buffer.
- ok = ::ptrGetUserProfileDirectoryW(token, userDirectory, &dwBufferSize);
+ ok = ptrGetUserProfileDirectoryW(token, userDirectory, &dwBufferSize);
if (ok)
ret = QString::fromWCharArray(userDirectory);
@@ -1414,7 +1413,7 @@ QAbstractFileEngine::FileFlags QFSFileEnginePrivate::getPermissions() const
QAbstractFileEngine::FileFlags ret = 0;
#if !defined(QT_NO_LIBRARY)
- if((qt_ntfs_permission_lookup > 0) && ((QSysInfo::WindowsVersion&QSysInfo::WV_NT_based) > QSysInfo::WV_NT)) {
+ if((qt_ntfs_permission_lookup > 0) && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)) {
PSID pOwner = 0;
PSID pGroup = 0;
PACL pDacl;
@@ -1721,7 +1720,7 @@ QString QFSFileEngine::owner(FileOwner own) const
{
#if !defined(QT_NO_LIBRARY)
Q_D(const QFSFileEngine);
- if((qt_ntfs_permission_lookup > 0) && ((QSysInfo::WindowsVersion&QSysInfo::WV_NT_based) > QSysInfo::WV_NT)) {
+ if((qt_ntfs_permission_lookup > 0) && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)) {
PSID pOwner = 0;
PSECURITY_DESCRIPTOR pSD;
QString name;
diff --git a/src/gui/dialogs/qfiledialog_win.cpp b/src/gui/dialogs/qfiledialog_win.cpp
index c74f622..6128a8a 100644
--- a/src/gui/dialogs/qfiledialog_win.cpp
+++ b/src/gui/dialogs/qfiledialog_win.cpp
@@ -85,11 +85,6 @@ static const CLSID QT_CLSID_FileOpenDialog = {0xdc1c5a9c, 0xe88a, 0x4dde, {0xa5,
#endif
-// Don't remove the lines below!
-//
-// resolving the W methods manually is needed, because Windows 95 doesn't include
-// these methods in Shell32.lib (not even stubs!), so you'd get an unresolved symbol
-// when Qt calls getExistingDirectory(), etc.
typedef LPITEMIDLIST (WINAPI *PtrSHBrowseForFolder)(BROWSEINFO*);
static PtrSHBrowseForFolder ptrSHBrowseForFolder = 0;
typedef BOOL (WINAPI *PtrSHGetPathFromIDList)(LPITEMIDLIST,LPWSTR);
@@ -125,7 +120,7 @@ static void qt_win_resolve_libs()
ptrSHGetMalloc = (PtrSHGetMalloc) lib.resolve("SHGetMalloc");
#else
// CE stores them in a different lib and does not use unicode version
- HINSTANCE handle = LoadLibraryW(L"Ceshell");
+ HINSTANCE handle = LoadLibrary(L"Ceshell");
ptrSHBrowseForFolder = (PtrSHBrowseForFolder)GetProcAddress(handle, L"SHBrowseForFolder");
ptrSHGetPathFromIDList = (PtrSHGetPathFromIDList)GetProcAddress(handle, L"SHGetPathFromIDList");
ptrSHGetMalloc = (PtrSHGetMalloc)GetProcAddress(handle, L"SHGetMalloc");
diff --git a/src/gui/text/qfontdatabase_win.cpp b/src/gui/text/qfontdatabase_win.cpp
index 6cde9ed..2fe1196 100644
--- a/src/gui/text/qfontdatabase_win.cpp
+++ b/src/gui/text/qfontdatabase_win.cpp
@@ -1101,7 +1101,6 @@ static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt)
if (AddFontResource((LPCWSTR)fnt->fileName.utf16()) == 0)
return;
#else
- // supported from 2000 on, so no need to deal with the *A variant
PtrAddFontResourceExW ptrAddFontResourceExW = (PtrAddFontResourceExW)QLibrary::resolve(QLatin1String("gdi32"),
"AddFontResourceExW");
if (!ptrAddFontResourceExW
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);