Fix QNX QPA plugin clipboard impl

QQnxCliboard::setMimeData was not cleaning the system clipboard aproppriately
when m_mimeData != 0 but m_mimeData->userMimeData == 0, as it would return
early before the empty_clipboard() statement.
Also, we need to emit the dataChanged() signal after the clipboard has been
cleared as well.

Change-Id: Ie06609e6e3a0a0135f1cdb6cf4c90b490ef2fc28
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
This commit is contained in:
Rafael Roquetto 2013-01-07 18:35:57 -02:00 committed by The Qt Project
parent 54fd35b134
commit 0a977e36e0

View File

@ -186,7 +186,10 @@ void QQnxClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
if (mode != QClipboard::Clipboard)
return;
if (data == m_mimeData || data == m_mimeData->userMimeData())
if (m_mimeData == data)
return;
if (m_mimeData->userMimeData() && m_mimeData->userMimeData() == data)
return;
empty_clipboard();
@ -194,8 +197,10 @@ void QQnxClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
m_mimeData->clear();
m_mimeData->setUserMimeData(data);
if (data == 0)
if (data == 0) {
emitChanged(QClipboard::Clipboard);
return;
}
const QStringList formats = data->formats();
qClipboardDebug() << Q_FUNC_INFO << "formats=" << formats;