kleopatra
importcertificatescommand.cpp
Go to the documentation of this file.
85 ImportResultProxyModel( const std::vector<ImportResult> & results, const QStringList & ids, QObject * parent=0 )
116 return Formatting::importMetaData( *it, kdtools::copy<QStringList>( m_idsByFingerprint[it->fingerprint()] ) );
147 for ( std::vector<Import>::const_iterator it = imports.begin(), end = imports.end() ; it != end ; ++it ) {
157 mutable std::map< const char*, std::set<QString>, ByImportFingerprint<std::less> > m_idsByFingerprint;
163 ImportCertificatesCommand::Private::Private( ImportCertificatesCommand * qq, KeyListController * c )
187 ImportCertificatesCommand::ImportCertificatesCommand( QAbstractItemView * v, KeyListController * p )
196 return kdtools::transform_if<QStringList>( ids, Qt::escape, !boost::bind( &QString::isEmpty, _1 ) ).join( QLatin1String("<br>") );
215 void ImportCertificatesCommand::Private::setImportResultProxyModel( const std::vector<ImportResult> & results, const QStringList & ids ) {
229 static QString make_report( const std::vector<ImportResult> & res, const QString & id=QString() ) {
232 const KLocalizedString boldLine = ki18n("<tr><td align=\"right\"><b>%1</b></td><td>%2</td></tr>");
233 const KLocalizedString headerLine = ki18n("<tr><th colspan=\"2\" align=\"center\">%1</th></tr>");
271 if ( const int n = SUM(numSecretKeysConsidered) - SUM(numSecretKeysImported) - SUM(numSecretKeysUnchanged) )
284 static QString make_message_report( const std::vector<ImportResult> & res, const QStringList & ids ) {
302 void ImportCertificatesCommand::Private::showDetails( QWidget * parent, const std::vector<ImportResult> & res, const QStringList & ids ) {
305 KMessageBox::information( parent, make_message_report( res, ids ), i18n( "Certificate Import Result" ) );
311 void ImportCertificatesCommand::Private::showDetails( const std::vector<ImportResult> & res, const QStringList & ids ) {
330 void ImportCertificatesCommand::Private::showError( QWidget * parent, const Error & err, const QString & id ) {
332 KMessageBox::error( parent, make_error_message( err, id ), i18n( "Certificate Import Failed" ) );
355 void ImportCertificatesCommand::Private::importResult( const ImportResult & result, const QString & id ) {
368 if ( kdtools::any( results, boost::bind( &Error::code, boost::bind( &ImportResult::error, _1 ) ) ) ) {
370 if ( kdtools::all( results, boost::bind( &Error::isCanceled, boost::bind( &ImportResult::error, _1 ) ) ) )
384 if ( const Kleo::CryptoBackend::Protocol * const backend = CryptoBackendFactory::instance()->protocol( protocol ) )
390 void ImportCertificatesCommand::Private::startImport( GpgME::Protocol protocol, const QByteArray & data, const QString & id ) {
399 error( i18n( "The type of this certificate (%1) is not supported by this Kleopatra installation.",
419 static std::auto_ptr<ImportFromKeyserverJob> get_import_from_keyserver_job( GpgME::Protocol protocol ) {
421 if ( const Kleo::CryptoBackend::Protocol * const backend = CryptoBackendFactory::instance()->protocol( protocol ) )
427 void ImportCertificatesCommand::Private::startImport( GpgME::Protocol protocol, const std::vector<Key> & keys, const QString & id ) {
436 error( i18n( "The type of this certificate (%1) is not supported by this Kleopatra installation.",
void showError(QWidget *parent, const GpgME::Error &error, const QString &id=QString())
int sum(const std::vector< ImportResult > &res, int(ImportResult::*fun)() const )
Definition: importcertificatescommand.cpp:225
void finished()
~ImportCertificatesCommand()
Definition: importcertificatescommand.cpp:193
void showDetails(QWidget *parent, const std::vector< GpgME::ImportResult > &results, const QStringList &ids)
ImportCertificatesCommand(KeyListController *parent)
Definition: importcertificatescommand.cpp:181
Definition: keylistcontroller.h:55
void startImport(GpgME::Protocol proto, const QByteArray &data, const QString &id=QString())
Definition: importcertificatescommand.cpp:390
QString displayName(GpgME::Protocol prot)
void addTemporaryView(const QString &title, AbstractKeyListSortFilterProxyModel *proxy=0, const QString &tabToolTip=QString())
Definition: commands/command.cpp:192
QWidget * parentWidgetOrView() const
Definition: commands/command_p.h:61
static QString make_error_message(const Error &err, const QString &id)
Definition: importcertificatescommand.cpp:316
void setImportResultProxyModel(const std::vector< GpgME::ImportResult > &results, const QStringList &ids)
Definition: importcertificatescommand.cpp:215
#define SUM(x)
static QString make_message_report(const std::vector< ImportResult > &res, const QStringList &ids)
Definition: importcertificatescommand.cpp:284
static QString format_ids(const QStringList &ids)
Definition: importcertificatescommand.cpp:195
static std::auto_ptr< ImportFromKeyserverJob > get_import_from_keyserver_job(GpgME::Protocol protocol)
Definition: importcertificatescommand.cpp:419
~Private()
Definition: importcertificatescommand.cpp:175
void progress(const QString &message, int current, int total)
static std::auto_ptr< ImportJob > get_import_job(GpgME::Protocol protocol)
Definition: importcertificatescommand.cpp:382
QString importMetaData(const GpgME::Import &import)
static QString make_tooltip(const QStringList &ids)
Definition: importcertificatescommand.cpp:199
static QString make_report(const std::vector< ImportResult > &res, const QString &id=QString())
Definition: importcertificatescommand.cpp:229
void doCancel()
Definition: importcertificatescommand.cpp:457
void importResult(const GpgME::ImportResult &)
Definition: commands/command.h:58
void setWaitForMoreJobs(bool waiting)
Definition: importcertificatescommand.cpp:341
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:56:41 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:41 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.