summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2010-02-03 12:00:38 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2010-02-03 12:00:38 (GMT)
commitc88e93ef075dcc3d10e37500bac170b3cfe8f0b1 (patch)
tree1ed63d06305aff797800e95069d9de81923ee2e4
parent7360402c0c64f83a58e679e99adc9677796d7a9e (diff)
downloadQt-c88e93ef075dcc3d10e37500bac170b3cfe8f0b1.zip
Qt-c88e93ef075dcc3d10e37500bac170b3cfe8f0b1.tar.gz
Qt-c88e93ef075dcc3d10e37500bac170b3cfe8f0b1.tar.bz2
QFileDialog: Compilation fix on windows
The structs that we declare are all now prefixed with qt_ to avoid clashes with system defined ones.
-rw-r--r--src/gui/dialogs/qfiledialog_win.cpp10
-rw-r--r--src/gui/dialogs/qfiledialog_win_p.h30
2 files changed, 17 insertions, 23 deletions
diff --git a/src/gui/dialogs/qfiledialog_win.cpp b/src/gui/dialogs/qfiledialog_win.cpp
index c7cef1e..3120938 100644
--- a/src/gui/dialogs/qfiledialog_win.cpp
+++ b/src/gui/dialogs/qfiledialog_win.cpp
@@ -71,9 +71,9 @@ static const CLSID QT_CLSID_FileOpenDialog = {0xdc1c5a9c, 0xe88a, 0x4dde, {0xa5,
#endif
-typedef LPITEMIDLIST (WINAPI *PtrSHBrowseForFolder)(BROWSEINFO*);
+typedef qt_LPITEMIDLIST (WINAPI *PtrSHBrowseForFolder)(qt_BROWSEINFO*);
static PtrSHBrowseForFolder ptrSHBrowseForFolder = 0;
-typedef BOOL (WINAPI *PtrSHGetPathFromIDList)(LPITEMIDLIST,LPWSTR);
+typedef BOOL (WINAPI *PtrSHGetPathFromIDList)(qt_LPITEMIDLIST, LPWSTR);
static PtrSHGetPathFromIDList ptrSHGetPathFromIDList = 0;
typedef HRESULT (WINAPI *PtrSHGetMalloc)(LPMALLOC *);
static PtrSHGetMalloc ptrSHGetMalloc = 0;
@@ -687,7 +687,7 @@ static int __stdcall winGetExistDirCallbackProc(HWND hwnd,
qt_win_resolve_libs();
if (ptrSHGetPathFromIDList) {
wchar_t path[MAX_PATH];
- ptrSHGetPathFromIDList(LPITEMIDLIST(lParam), path);
+ ptrSHGetPathFromIDList(qt_LPITEMIDLIST(lParam), path);
QString tmpStr = QString::fromWCharArray(path);
if (!tmpStr.isEmpty())
SendMessage(hwnd, BFFM_ENABLEOK, 1, 1);
@@ -723,7 +723,7 @@ QString qt_win_get_existing_directory(const QFileDialogArgs &args)
path[0] = 0;
tTitle = args.caption;
- BROWSEINFO bi;
+ qt_BROWSEINFO bi;
Q_ASSERT(!parent ||parent->testAttribute(Qt::WA_WState_Created));
bi.hwndOwner = (parent ? parent->winId() : 0);
@@ -737,7 +737,7 @@ QString qt_win_get_existing_directory(const QFileDialogArgs &args)
qt_win_resolve_libs();
if (ptrSHBrowseForFolder) {
- LPITEMIDLIST pItemIDList = ptrSHBrowseForFolder(&bi);
+ qt_LPITEMIDLIST pItemIDList = ptrSHBrowseForFolder(&bi);
if (pItemIDList) {
ptrSHGetPathFromIDList(pItemIDList, path);
IMalloc *pMalloc;
diff --git a/src/gui/dialogs/qfiledialog_win_p.h b/src/gui/dialogs/qfiledialog_win_p.h
index 39e6f5d..527ab3f 100644
--- a/src/gui/dialogs/qfiledialog_win_p.h
+++ b/src/gui/dialogs/qfiledialog_win_p.h
@@ -49,9 +49,6 @@
//and we won't have to declare it ourselves
//declarations
-typedef DWORD SICHINTF;
-typedef ULONG SFGAOF;
-typedef DWORD SHCONTF;
#define FOS_OVERWRITEPROMPT 0x2
#define FOS_STRICTFILETYPES 0x4
#define FOS_NOCHANGEDIR 0x8
@@ -143,32 +140,29 @@ typedef struct {
LPCWSTR pszName;
LPCWSTR pszSpec;
} qt_COMDLG_FILTERSPEC;
-#ifndef PROPERTYKEY_DEFINED
-#define PROPERTYKEY_DEFINED
typedef struct {
GUID fmtid;
DWORD pid;
-} PROPERTYKEY;
-#endif
+} qt_PROPERTYKEY;
typedef struct {
USHORT cb;
BYTE abID[1];
-} SHITEMID, *LPSHITEMID;
+} qt_SHITEMID, *qt_LPSHITEMID;
typedef struct {
- SHITEMID mkid;
-} ITEMIDLIST, *LPITEMIDLIST;
-typedef const ITEMIDLIST *LPCITEMIDLIST;
+ qt_SHITEMID mkid;
+} qt_ITEMIDLIST, *qt_LPITEMIDLIST;
+typedef const qt_ITEMIDLIST *qt_LPCITEMIDLIST;
typedef struct {
HWND hwndOwner;
- LPCITEMIDLIST pidlRoot;
+ qt_LPCITEMIDLIST pidlRoot;
LPWSTR pszDisplayName;
LPCWSTR lpszTitle;
UINT ulFlags;
BFFCALLBACK lpfn;
LPARAM lParam;
int iImage;
-} BROWSEINFO;
+} qt_BROWSEINFO;
DECLARE_INTERFACE(IFileDialogEvents);
DECLARE_INTERFACE_(IShellItem, IUnknown)
@@ -176,13 +170,13 @@ DECLARE_INTERFACE_(IShellItem, IUnknown)
STDMETHOD(BindToHandler)(THIS_ IBindCtx *pbc, REFGUID bhid, REFIID riid, void **ppv) PURE;
STDMETHOD(GetParent)(THIS_ IShellItem **ppsi) PURE;
STDMETHOD(GetDisplayName)(THIS_ SIGDN sigdnName, LPWSTR *ppszName) PURE;
- STDMETHOD(GetAttributes)(THIS_ SFGAOF sfgaoMask, SFGAOF *psfgaoAttribs) PURE;
- STDMETHOD(Compare)(THIS_ IShellItem *psi, SICHINTF hint, int *piOrder) PURE;
+ STDMETHOD(GetAttributes)(THIS_ ULONG sfgaoMask, ULONG *psfgaoAttribs) PURE;
+ STDMETHOD(Compare)(THIS_ IShellItem *psi, DWORD hint, int *piOrder) PURE;
};
DECLARE_INTERFACE_(IShellItemFilter, IUnknown)
{
STDMETHOD(IncludeItem)(THIS_ IShellItem *psi) PURE;
- STDMETHOD(GetEnumFlagsForItem)(THIS_ IShellItem *psi, SHCONTF *pgrfFlags) PURE;
+ STDMETHOD(GetEnumFlagsForItem)(THIS_ IShellItem *psi, DWORD *pgrfFlags) PURE;
};
DECLARE_INTERFACE_(IEnumShellItems, IUnknown)
{
@@ -195,8 +189,8 @@ DECLARE_INTERFACE_(IShellItemArray, IUnknown)
{
STDMETHOD(BindToHandler)(THIS_ IBindCtx *pbc, REFGUID rbhid, REFIID riid, void **ppvOut) PURE;
STDMETHOD(GetPropertyStore)(THIS_ GETPROPERTYSTOREFLAGS flags, REFIID riid, void **ppv) PURE;
- STDMETHOD(GetPropertyDescriptionList)(THIS_ const PROPERTYKEY *keyType, REFIID riid, void **ppv) PURE;
- STDMETHOD(GetAttributes)(THIS_ SIATTRIBFLAGS dwAttribFlags, SFGAOF sfgaoMask, SFGAOF *psfgaoAttribs) PURE;
+ STDMETHOD(GetPropertyDescriptionList)(THIS_ const qt_PROPERTYKEY *keyType, REFIID riid, void **ppv) PURE;
+ STDMETHOD(GetAttributes)(THIS_ SIATTRIBFLAGS dwAttribFlags, ULONG sfgaoMask, ULONG *psfgaoAttribs) PURE;
STDMETHOD(GetCount)(THIS_ DWORD *pdwNumItems) PURE;
STDMETHOD(GetItemAt)(THIS_ DWORD dwIndex, IShellItem **ppsi) PURE;
STDMETHOD(EnumItems)(THIS_ IEnumShellItems **ppenumShellItems) PURE;