[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/kdepim/enterprise4/kdepim/kleopatra
From: Christoph Schleifenbaum <christoph () kdab ! net>
Date: 2010-10-26 15:33:38
Message-ID: 20101026153338.2AFFBAC899 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1189999 by cschleifenbaum:
Make sure the error output of tar (or whatever command) makes it to the GUI
M +10 -2 crypto/decryptverifytask.cpp
M +2 -1 utils/output.cpp
--- branches/kdepim/enterprise4/kdepim/kleopatra/crypto/decryptverifytask.cpp \
#1189998:1189999 @@ -417,12 +417,14 @@
return text;
}
-static QString formatDecryptionResultOverview( const DecryptionResult & result )
+static QString formatDecryptionResultOverview( const DecryptionResult & result, \
const QString& errorString = QString() ) {
const Error err = result.error();
if ( err.isCanceled() )
return i18n("<b>Decryption canceled.</b>");
+ else if ( !errorString.isEmpty() )
+ return i18n( "<b>Decryption failed: %1.</b>", Qt::escape( errorString ) );
else if ( err )
return i18n( "<b>Decryption failed: %1.</b>", Qt::escape( \
QString::fromLocal8Bit( err.asString() ) ) ); return i18n("<b>Decryption \
succeeded.</b>" ); @@ -694,7 +696,7 @@
{
QString ov;
if ( d->isDecryptOnly() )
- ov = formatDecryptionResultOverview( d->m_decryptionResult );
+ ov = formatDecryptionResultOverview( d->m_decryptionResult, errorString() );
else if ( d->isVerifyOnly() )
ov = formatVerificationResultOverview( d->m_verificationResult, \
d->makeSenderInfo() ); else
@@ -826,6 +828,12 @@
return;
}
}
+ const int drErr = dr.error().code();
+ const QString errorString = m_output->errorString();
+ if ( (drErr == GPG_ERR_EIO || drErr == GPG_ERR_NO_DATA) && \
!errorString.isEmpty() ) { + emitResult( q->fromDecryptResult( dr.error(), \
i18n("Caught exception: %1", errorString ), auditLog ) ); + return;
+ }
emitResult( q->fromDecryptVerifyResult( dr, vr, plainText, auditLog ) );
}
--- branches/kdepim/enterprise4/kdepim/kleopatra/utils/output.cpp #1189998:1189999
@@ -423,7 +423,8 @@
throw Exception( gpg_error( GPG_ERR_INV_ARG ),
i18n("Command not specified") );
m_proc->setWorkingDirectory( wd.absolutePath() );
- m_proc->start( cmd, args, QIODevice::WriteOnly );
+ m_proc->start( cmd, args );
+ m_proc->setReadChannel( QProcess::StandardError );
if ( !m_proc->waitForStarted() )
throw Exception( gpg_error( GPG_ERR_EIO ),
i18n( "Could not start %1 process: %2", cmd, \
m_proc->errorString() ) );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic