kleopatra
decryptverifyfilescontroller.cpp
Go to the documentation of this file.
74 static shared_ptr<AbstractDecryptVerifyTask> taskFromOperationWidget( const DecryptVerifyOperationWidget * w, const QString & fileName, const QDir & outDir, const shared_ptr<OverwritePolicy> & overwritePolicy );
83 std::vector<shared_ptr<Task> > buildTasks( const QStringList &, const shared_ptr<OverwritePolicy> & );
103 shared_ptr<AbstractDecryptVerifyTask> DecryptVerifyFilesController::Private::taskFromOperationWidget( const DecryptVerifyOperationWidget * w, const QString & fileName, const QDir & outDir, const shared_ptr<OverwritePolicy> & overwritePolicy ) {
141 ad /* _needs_ the info */ ? throw Exception( gpg_error( GPG_ERR_CONFLICT ), i18n("Cannot determine whether input data is OpenPGP or CMS") ) :
147 /*else*/ Output::createFromFile( outDir.absoluteFilePath( outputFileName( QFileInfo( fileName ).fileName() ) ), overwritePolicy );
172 DecryptVerifyFilesController::Private::Private( DecryptVerifyFilesController* qq ) : q( qq ), m_errorDetected( false ), m_operation( DecryptVerify )
181 std::vector<shared_ptr<Task> > tasks = buildTasks( m_filesAfterPreparation, shared_ptr<OverwritePolicy>( new OverwritePolicy( m_wizard ) ) );
197 i18n("Caught unexpected exception in DecryptVerifyFilesController::Private::slotWizardOperationPrepared: %1",
201 i18n("Caught unknown exception in DecryptVerifyFilesController::Private::slotWizardOperationPrepared") );
211 void DecryptVerifyFilesController::doTaskDone( const Task* task, const shared_ptr<const Task::Result> & result )
225 if ( const shared_ptr<const DecryptVerifyResult> & dvr = boost::dynamic_pointer_cast<const DecryptVerifyResult>( result ) )
256 connect( w.get(), SIGNAL(operationPrepared()), q, SLOT(slotWizardOperationPrepared()), Qt::QueuedConnection );
271 result = ad && ( ad->extensions( OpenPGP ).contains( ext, Qt::CaseInsensitive ) || ad->extensions( CMS ).contains( ext, Qt::CaseInsensitive ) );
280 shared_ptr<ArchiveDefinition> pick_archive_definition( GpgME::Protocol proto, const std::vector< shared_ptr<ArchiveDefinition> > & ads, const QString & filename ) {
307 const std::vector< shared_ptr<ArchiveDefinition> > archiveDefinitions = ArchiveDefinition::getArchiveDefinitions();
318 if ( mayBeOpaqueSignature( classification ) || mayBeCipherText( classification ) || mayBeDetachedSignature( classification ) ) {
335 op->setMode( DecryptVerifyOperationWidget::DecryptVerifyOpaque, pick_archive_definition( proto, archiveDefinitions, fname ) );
357 op->setMode( DecryptVerifyOperationWidget::DecryptVerifyOpaque, pick_archive_definition( proto, archiveDefinitions, fname ) );
381 throw Kleo::Exception( makeGnuPGError( GPG_ERR_ASS_NO_INPUT ), i18n("No usable inputs found") );
387 std::vector< shared_ptr<Task> > DecryptVerifyFilesController::Private::buildTasks( const QStringList & fileNames, const shared_ptr<OverwritePolicy> & overwritePolicy )
402 tasks.push_back( taskFromOperationWidget( m_wizard->operationWidget( i ), fileNames[i], useOutDir ? outDir : fileDir, overwritePolicy ) );
404 tasks.push_back( Task::makeErrorTask( e.error().code(), QString::fromLocal8Bit( e.what() ), fileNames[i] ) );
421 DecryptVerifyFilesController::DecryptVerifyFilesController( QObject* parent ) : Controller( parent ), d( new Private( this ) )
425 DecryptVerifyFilesController::DecryptVerifyFilesController( const shared_ptr<const ExecutionContext> & ctx, QObject* parent ) : Controller( ctx, parent ), d( new Private( this ) )
QString heuristicBaseDirectory(const QStringList &files)
Definition: path-helper.cpp:69
DecryptVerifyOperation operation() const
Definition: decryptverifyfilescontroller.cpp:443
QString findSignedData(const QString &signatureFileName)
Definition: classify.cpp:249
void setSignedDataFileName(const QString &name)
Definition: decryptverifyoperationwidget.cpp:239
DecryptVerifyFilesController(QObject *parent=0)
Definition: decryptverifyfilescontroller.cpp:421
Definition: task.h:55
QString printableClassification(unsigned int classification)
Definition: classify.cpp:213
Definition: types.h:48
Definition: output.h:50
void setInputFileName(const QString &name)
Definition: decryptverifyoperationwidget.cpp:227
~DecryptVerifyFilesController()
Definition: decryptverifyfilescontroller.cpp:430
void setArchiveDefinitions(const std::vector< boost::shared_ptr< ArchiveDefinition > > &ads)
Definition: decryptverifyoperationwidget.cpp:177
void start()
Definition: decryptverifyfilescontroller.cpp:432
Definition: classify.h:49
Mode mode
Definition: decryptverifyoperationwidget.h:58
void setOperation(DecryptVerifyOperation op)
Definition: decryptverifyfilescontroller.cpp:438
boost::shared_ptr< ArchiveDefinition > selectedArchiveDefinition() const
Definition: decryptverifyoperationwidget.cpp:251
Definition: classify.h:48
void cancel()
Definition: decryptverifyfilescontroller.cpp:459
QStringList findSignatures(const QString &signedDataFileName)
Definition: classify.cpp:262
QString signedDataFileName
Definition: decryptverifyoperationwidget.h:60
Definition: taskcollection.h:49
void setMode(Mode mode, const boost::shared_ptr< ArchiveDefinition > &ad)
Definition: decryptverifyoperationwidget.cpp:190
shared_ptr< ArchiveDefinition > pick_archive_definition(GpgME::Protocol proto, const std::vector< shared_ptr< ArchiveDefinition > > &ads, const QString &filename)
Definition: decryptverifyfilescontroller.cpp:280
static const char * extension(bool pgp, bool sign, bool encrypt, bool ascii, bool detached)
Definition: signencryptfilescontroller.cpp:285
QString inputFileName
Definition: decryptverifyoperationwidget.h:59
Definition: controller.h:50
ProtocolMask FormatMask TypeMask TypeMask TypeMask GpgME::Protocol findProtocol(const unsigned int classifcation)
Definition: classify.h:127
static std::vector< boost::shared_ptr< ArchiveDefinition > > getArchiveDefinitions()
Definition: archivedefinition.cpp:354
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:56:40 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:56:40 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.