diff options
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsdialoghelpers.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsdialoghelpers.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp index f2beeb6f54..e1b0d36922 100644 --- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp +++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp @@ -988,22 +988,18 @@ void QWindowsNativeFileDialogBase::setWindowTitle(const QString &title) IShellItem *QWindowsNativeFileDialogBase::shellItem(const QUrl &url) { if (url.isLocalFile()) { - if (!QWindowsContext::shell32dll.sHCreateItemFromParsingName) - return Q_NULLPTR; IShellItem *result = Q_NULLPTR; const QString native = QDir::toNativeSeparators(url.toLocalFile()); const HRESULT hr = - QWindowsContext::shell32dll.sHCreateItemFromParsingName(reinterpret_cast<const wchar_t *>(native.utf16()), - NULL, IID_IShellItem, - reinterpret_cast<void **>(&result)); + SHCreateItemFromParsingName(reinterpret_cast<const wchar_t *>(native.utf16()), + NULL, IID_IShellItem, + reinterpret_cast<void **>(&result)); if (FAILED(hr)) { qErrnoWarning("%s: SHCreateItemFromParsingName(%s)) failed", __FUNCTION__, qPrintable(url.toString())); return Q_NULLPTR; } return result; } else if (url.scheme() == QLatin1String("clsid")) { - if (!QWindowsContext::shell32dll.sHGetKnownFolderIDList || !QWindowsContext::shell32dll.sHCreateItemFromIDList) - return Q_NULLPTR; // Support for virtual folders via GUID // (see https://msdn.microsoft.com/en-us/library/windows/desktop/dd378457(v=vs.85).aspx) // specified as "clsid:<GUID>" (without '{', '}'). @@ -1014,12 +1010,12 @@ IShellItem *QWindowsNativeFileDialogBase::shellItem(const QUrl &url) return Q_NULLPTR; } PIDLIST_ABSOLUTE idList; - HRESULT hr = QWindowsContext::shell32dll.sHGetKnownFolderIDList(uuid, 0, 0, &idList); + HRESULT hr = SHGetKnownFolderIDList(uuid, 0, 0, &idList); if (FAILED(hr)) { qErrnoWarning("%s: SHGetKnownFolderIDList(%s)) failed", __FUNCTION__, qPrintable(url.toString())); return Q_NULLPTR; } - hr = QWindowsContext::shell32dll.sHCreateItemFromIDList(idList, IID_IShellItem, reinterpret_cast<void **>(&result)); + hr = SHCreateItemFromIDList(idList, IID_IShellItem, reinterpret_cast<void **>(&result)); CoTaskMemFree(idList); if (FAILED(hr)) { qErrnoWarning("%s: SHCreateItemFromIDList(%s)) failed", __FUNCTION__, qPrintable(url.toString())); |