From: Friedemann Kleint Date: Wed, 15 Feb 2012 11:34:04 +0000 (+0100) Subject: Fix qclipboard autotest on Windows. X-Git-Tag: qt-v5.0.0-alpha1~973 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e0d9fade038130ad408715e946c5c08cd2faf81e;p=profile%2Fivi%2Fqtbase.git Fix qclipboard autotest on Windows. Emit changed signal only if the clipboard is not owned, in which case QClipboard does it. Task-number: QTBUG-24184 Change-Id: I27420583a718a5f8cd93b9d361b1e422a75df300 Reviewed-by: Friedemann Kleint --- diff --git a/src/plugins/platforms/windows/qwindowsclipboard.cpp b/src/plugins/platforms/windows/qwindowsclipboard.cpp index c1167cc..4f083e9 100644 --- a/src/plugins/platforms/windows/qwindowsclipboard.cpp +++ b/src/plugins/platforms/windows/qwindowsclipboard.cpp @@ -283,14 +283,17 @@ bool QWindowsClipboard::clipboardViewerWndProc(HWND hwnd, UINT message, WPARAM w } } return true; - case WM_DRAWCLIPBOARD: + case WM_DRAWCLIPBOARD: { + const bool owned = ownsClipboard(); if (QWindowsContext::verboseOLE) - qDebug("Clipboard changed"); - emitChanged(QClipboard::Clipboard); + qDebug("Clipboard changed owned %d", owned); + if (!owned) // changed is emitted by QClipboard in that case. + emitChanged(QClipboard::Clipboard); // clean up the clipboard object if we no longer own the clipboard - if (!ownsClipboard() && m_data) + if (!owned && m_data) releaseIData(); propagateClipboardMessage(message, wParam, lParam); + } return true; case WM_DESTROY: // Recommended shutdown diff --git a/tests/auto/gui/kernel/qclipboard/test/test.pro b/tests/auto/gui/kernel/qclipboard/test/test.pro index ffab4de..4be6769 100644 --- a/tests/auto/gui/kernel/qclipboard/test/test.pro +++ b/tests/auto/gui/kernel/qclipboard/test/test.pro @@ -16,7 +16,6 @@ wince* { } mac: CONFIG += insignificant_test # QTBUG-23057 -win32:CONFIG += insignificant_test # QTBUG-24184 load(testcase) # for target.path and installTestHelperApp() installTestHelperApp("../copier/copier",copier,copier)