From 354f20424da2d687561fe897b85ba076e40d0983 Mon Sep 17 00:00:00 2001 From: Anne Jan Brouwer Date: Wed, 6 May 2015 06:09:56 +0200 Subject: no clipboard on error --- mainwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index fef19b6e..a7522de7 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -382,11 +382,12 @@ void MainWindow::executeWrapper(QString app, QString args, QString input) { */ void MainWindow::readyRead(bool finished = false) { QString output = ""; + QString error = process->readAllStandardError(); if (currentAction != GPG_INTERNAL) { output = process->readAllStandardOutput(); if (finished && currentAction == GPG) { lastDecrypt = output; - if (useClipboard) { + if (useClipboard && error.size() == 0) { QClipboard *clip = QApplication::clipboard(); QStringList tokens = output.split("\n"); clip->setText(tokens[0]); @@ -408,7 +409,6 @@ void MainWindow::readyRead(bool finished = false) { output.replace(QRegExp(">"), ">"); } - QString error = process->readAllStandardError(); if (error.size() > 0) { output = "" + error + "
" + output; } -- cgit v1.2.3