Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix pasteFromClipboard
  • Loading branch information
CODeRUS committed Mar 25, 2014
1 parent e4541ba commit 546ff39
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions terminal.cpp
Expand Up @@ -1144,17 +1144,10 @@ void Terminal::pasteFromClipboard()
{
QClipboard *cb = QGuiApplication::clipboard();

//mimeData() could be null when the clipboard QPA plugin of the platform doesn't support QClipboard::Clipboard, or
//the plugin is bugged.
//In those cases, disable clipboard features.
if(!cb->mimeData())
qDebug() << "FIXME: QClipboard::mimeData() returned NULL, the clipboard functionality will not be used";
else {
if(cb->mimeData()->hasText() && !cb->mimeData()->text().isEmpty()) {
if(iPtyIFace) {
resetBackBufferScrollPos();
iPtyIFace->writeTerm(cb->mimeData()->text());
}
if(!cb->->text().isEmpty()) {
if(iPtyIFace) {
resetBackBufferScrollPos();
iPtyIFace->writeTerm(cb->text());
}
}
}
Expand Down

0 comments on commit 546ff39

Please sign in to comment.