kleopatra
Go to the documentation of this file.
33 #include <config-kleopatra.h>
41 #include <gpgme++/context.h>
42 #include <gpgme++/assuanresult.h>
43 #include <gpgme++/gpgagentgetinfoassuantransaction.h>
45 #include <QTextDocument>
46 #include <QCoreApplication>
50 #include <boost/shared_ptr.hpp>
55 using namespace Kleo::_detail;
56 using namespace boost;
57 using namespace GpgME;
63 explicit GpgAgentCheck()
73 if ( !hasFeature( AssuanEngineFeature ) ) {
74 m_error = i18n(
"GpgME library too old" );
75 m_explaination = i18nc(
"@info",
76 "Either the GpgME library itself is too old, "
77 "or the GpgME++ library was compiled against "
78 "an older GpgME that did not support connecting to gpg-agent.");
79 m_proposedFix = i18nc(
"@info",
80 "Upgrade to <application>gpgme</application> 1.2.0 or higher, "
81 "and ensure that gpgme++ was compiled against it.");
85 const std::auto_ptr<Context> ctx = Context::createForEngine( AssuanEngine, &error );
87 m_error = i18n(
"GpgME does not support gpg-agent" );
88 m_explaination = i18nc(
"@info",
89 "<para>The <application>GpgME</application> library is new "
90 "enough to support <application>gpg-agent</application>, "
91 "but does not seem to do so in this installation.</para>"
92 "<para>The error returned was: <message>%1</message>.</para>",
93 Qt::escape( QString::fromLocal8Bit( error.asString() ) ) );
99 const AssuanResult result = ctx->assuanTransact(
"GETINFO version" );
100 if ( result.error() ) {
102 m_error = i18n(
"not reachable");
103 m_explaination = i18nc(
"@info",
104 "Could not connect to GpgAgent: <message>%1</message>",
105 Qt::escape( QString::fromLocal8Bit( result.error().asString() ) ) );
106 m_proposedFix = i18nc(
"@info",
107 "<para>Check that gpg-agent is running and that the "
108 "<environment>GPG_AGENT_INFO</environment> variable is set and up-to-date.</para>");
109 }
else if ( result.assuanError() ) {
111 m_error = i18n(
"unexpected error");
112 m_explaination = i18nc(
"@info",
113 "<para>Unexpected error while asking <application>gpg-agent</application> "
114 "for its version.</para>"
115 "<para>The error returned was: <message>%1</message>.</para>",
116 Qt::escape( QString::fromLocal8Bit( result.assuanError().asString() ) ) );
boost::shared_ptr< SelfTest > makeGpgAgentConnectivitySelfTest()
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
KDE's Doxygen guidelines are available online.