Commit bb0c7a3d authored by Kurt Hindenburg's avatar Kurt Hindenburg

Test supportsSelection() when using QClipboard::Selection

setMimeData appears to delete mimeData if supportsSelection() is false.
So we'll check it.

Patch from rjvbertin gmail com
parent 5364667c
......@@ -2883,7 +2883,9 @@ void TerminalDisplay::copyToX11Selection()
mimeData->setText(text);
mimeData->setHtml(html);
QApplication::clipboard()->setMimeData(mimeData, QClipboard::Selection);
if (QApplication::clipboard()->supportsSelection()) {
QApplication::clipboard()->setMimeData(mimeData, QClipboard::Selection);
}
if (_autoCopySelectedText)
QApplication::clipboard()->setMimeData(mimeData, QClipboard::Clipboard);
......@@ -2914,8 +2916,10 @@ void TerminalDisplay::pasteFromClipboard(bool appendEnter)
void TerminalDisplay::pasteFromX11Selection(bool appendEnter)
{
QString text = QApplication::clipboard()->text(QClipboard::Selection);
doPaste(text, appendEnter);
if (QApplication::clipboard()->supportsSelection()) {
QString text = QApplication::clipboard()->text(QClipboard::Selection);
doPaste(text, appendEnter);
}
}
/* ------------------------------------------------------------------------- */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment