From 683d817ada91db6563036b037e4f5d062f260d71 Mon Sep 17 00:00:00 2001 From: Bjoern Breitmeyer Date: Wed, 29 Apr 2015 14:46:52 +0200 Subject: [PATCH] Introduce QT_NO_WINCE_SHELLSDK for WEC builds. ShellSDK isn't always available in WEC2013 and sadly the define that should tell us if it is isn't enough as the headers would be in the SDK but the lib doesn't need to have the symbols. Change-Id: Iccd11eafd0dbd22ee421c9a08f05bfc2fc5bdd49 Reviewed-by: Friedemann Kleint --- src/corelib/io/qfilesystemengine_win.cpp | 5 ++++- src/corelib/io/qfsfileengine_win.cpp | 4 ++-- src/plugins/platforms/windows/qwindowstheme.cpp | 2 ++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp index d62c120d7e..379095a83d 100644 --- a/src/corelib/io/qfilesystemengine_win.cpp +++ b/src/corelib/io/qfilesystemengine_win.cpp @@ -407,7 +407,7 @@ static QString readLink(const QFileSystemEntry &link) Q_UNUSED(link); return QString(); #endif // QT_NO_LIBRARY -#else +#elif !defined(QT_NO_WINCE_SHELLSDK) wchar_t target[MAX_PATH]; QString result; if (SHGetShortcutTarget((wchar_t*)QFileInfo(link.filePath()).absoluteFilePath().replace(QLatin1Char('/'),QLatin1Char('\\')).utf16(), target, MAX_PATH)) { @@ -418,6 +418,9 @@ static QString readLink(const QFileSystemEntry &link) result.remove(result.size()-1,1); } return result; +#else // QT_NO_WINCE_SHELLSDK + Q_UNUSED(link); + return QString(); #endif // Q_OS_WINCE } diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index 19343f22ff..cfd50955a6 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -711,7 +711,7 @@ bool QFSFileEngine::link(const QString &newName) Q_UNUSED(newName); return false; #endif // QT_NO_LIBRARY -#elif defined(Q_OS_WINCE) +#elif defined(Q_OS_WINCE) && !defined(QT_NO_WINCE_SHELLSDK) QString linkName = newName; linkName.replace(QLatin1Char('/'), QLatin1Char('\\')); if (!linkName.endsWith(QLatin1String(".lnk"))) @@ -724,7 +724,7 @@ bool QFSFileEngine::link(const QString &newName) if (!ret) setError(QFile::RenameError, qt_error_string()); return ret; -#else // Q_OS_WINCE +#else // Q_OS_WINCE && !QT_NO_WINCE_SHELLSDK Q_UNUSED(newName); Q_UNIMPLEMENTED(); return false; diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp index d3f67e9eaa..249e692dd5 100644 --- a/src/plugins/platforms/windows/qwindowstheme.cpp +++ b/src/plugins/platforms/windows/qwindowstheme.cpp @@ -720,6 +720,7 @@ QPixmap QWindowsTheme::fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &s iconSize|SHGFI_SYSICONINDEX; #endif // Q_OS_WINCE unsigned long val = 0; +#if !defined(QT_NO_WINCE_SHELLSDK) if (cacheableDirIcon && useDefaultFolderIcon) { flags |= SHGFI_USEFILEATTRIBUTES; val = SHGetFileInfo(L"dummy", @@ -729,6 +730,7 @@ QPixmap QWindowsTheme::fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &s val = SHGetFileInfo(reinterpret_cast(filePath.utf16()), 0, &info, sizeof(SHFILEINFO), flags); } +#endif // !QT_NO_WINCE_SHELLSDK // Even if GetFileInfo returns a valid result, hIcon can be empty in some cases if (val && info.hIcon) {