diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-08-19 12:29:41 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-09-01 12:06:52 +0000 |
commit | 29af8741b68db1dff82de9f12d818524cb6d9147 (patch) | |
tree | 3977d15a1530335f7506987e67987bde19f631ff /src/plugins/platforms/windows/qwindowsole.cpp | |
parent | 01c6f7200a74a8910ff9aa31741a20a14ccc443b (diff) |
Windows: Improve debug output of mime conversion handling.
Introduce convenience function for obtaining the format
name and use that.
Add debug operator for struct FORMATETC including format name.
Replace all code enclosed in #ifdef QMIME_DEBUG by qCDebug().
Task-number: QTBUG-47656
Change-Id: Ibb3c860c57edee4a31e8f5f37e3245feebed52a1
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsole.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsole.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/plugins/platforms/windows/qwindowsole.cpp b/src/plugins/platforms/windows/qwindowsole.cpp index 6f5a521af8..e480c1ebcf 100644 --- a/src/plugins/platforms/windows/qwindowsole.cpp +++ b/src/plugins/platforms/windows/qwindowsole.cpp @@ -132,12 +132,6 @@ QWindowsOleDataObject::GetData(LPFORMATETC pformatetc, LPSTGMEDIUM pmedium) { HRESULT hr = ResultFromScode(DATA_E_FORMATETC); - if (QWindowsContext::verbose > 1 && lcQpaMime().isDebugEnabled()) { - wchar_t buf[256] = {0}; - GetClipboardFormatName(pformatetc->cfFormat, buf, 255); - qCDebug(lcQpaMime) <<__FUNCTION__ << "CF = " << pformatetc->cfFormat << QString::fromWCharArray(buf); - } - if (data) { const QWindowsMimeConverter &mc = QWindowsContext::instance()->mimeConverter(); if (QWindowsMime *converter = mc.converterFromMime(*pformatetc, data)) @@ -145,11 +139,8 @@ QWindowsOleDataObject::GetData(LPFORMATETC pformatetc, LPSTGMEDIUM pmedium) hr = ResultFromScode(S_OK); } - if (QWindowsContext::verbose > 1) { - wchar_t buf[256] = {0}; - GetClipboardFormatName(pformatetc->cfFormat, buf, 255); - qCDebug(lcQpaMime) <<__FUNCTION__ << "CF = " << pformatetc->cfFormat << " returns 0x" << int(hr) << dec; - } + if (QWindowsContext::verbose > 1 && lcQpaMime().isDebugEnabled()) + qCDebug(lcQpaMime) <<__FUNCTION__ << *pformatetc << "returns" << hex << showbase << quint64(hr); return hr; } @@ -211,7 +202,7 @@ STDMETHODIMP QWindowsOleDataObject::EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC FAR* ppenumFormatEtc) { if (QWindowsContext::verbose > 1) - qCDebug(lcQpaMime) << __FUNCTION__; + qCDebug(lcQpaMime) << __FUNCTION__ << "dwDirection=" << dwDirection; if (!data) return ResultFromScode(DATA_E_FORMATETC); @@ -274,7 +265,7 @@ QWindowsOleEnumFmtEtc::QWindowsOleEnumFmtEtc(const QVector<FORMATETC> &fmtetcs) m_dwRefs(1), m_nIndex(0), m_isNull(false) { if (QWindowsContext::verbose > 1) - qCDebug(lcQpaMime) << __FUNCTION__; + qCDebug(lcQpaMime) << __FUNCTION__ << fmtetcs; m_lpfmtetcs.reserve(fmtetcs.count()); for (int idx = 0; idx < fmtetcs.count(); ++idx) { LPFORMATETC destetc = new FORMATETC(); |