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>
47 #include <KLocalizedString>
50 #include <boost/shared_ptr.hpp>
56 using namespace Kleo::_detail;
57 using namespace boost;
58 using namespace GpgME;
64 explicit GpgAgentCheck()
74 if ( !hasFeature( AssuanEngineFeature ) ) {
75 m_error = i18n(
"GpgME library too old" );
76 m_explaination = i18nc(
"@info",
77 "Either the GpgME library itself is too old, "
78 "or the GpgME++ library was compiled against "
79 "an older GpgME that did not support connecting to gpg-agent.");
80 m_proposedFix = i18nc(
"@info",
81 "Upgrade to <application>gpgme</application> 1.2.0 or higher, "
82 "and ensure that gpgme++ was compiled against it.");
86 const std::auto_ptr<Context> ctx = Context::createForEngine( AssuanEngine, &error );
88 m_error = i18n(
"GpgME does not support gpg-agent" );
89 m_explaination = i18nc(
"@info",
90 "<para>The <application>GpgME</application> library is new "
91 "enough to support <application>gpg-agent</application>, "
92 "but does not seem to do so in this installation.</para>"
93 "<para>The error returned was: <message>%1</message>.</para>",
100 const AssuanResult result = ctx->assuanTransact(
"GETINFO version" );
101 if ( result.error() ) {
103 m_error = i18n(
"not reachable");
104 m_explaination = i18nc(
"@info",
105 "Could not connect to GpgAgent: <message>%1</message>",
107 m_proposedFix = i18nc(
"@info",
108 "<para>Check that gpg-agent is running and that the "
109 "<environment>GPG_AGENT_INFO</environment> variable is set and up-to-date.</para>");
110 }
else if ( result.assuanError() ) {
112 m_error = i18n(
"unexpected error");
113 m_explaination = i18nc(
"@info",
114 "<para>Unexpected error while asking <application>gpg-agent</application> "
115 "for its version.</para>"
116 "<para>The error returned was: <message>%1</message>.</para>",
QString fromLocal8Bit(const char *str, int size)
boost::shared_ptr< SelfTest > makeGpgAgentConnectivitySelfTest()
QString escape(const QString &plain)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:33:11 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.