[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdepim/kleopatra/utils
From: Marc Mutz <mutz () kde ! org>
Date: 2008-04-29 7:46:04
Message-ID: 1209455164.564241.26700.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 802346 by mutz:
Add gpg{,Conf,Sm}Path()
M +22 -0 gnupg-helper.cpp
M +4 -0 gnupg-helper.h
--- trunk/KDE/kdepim/kleopatra/utils/gnupg-helper.cpp #802345:802346
@@ -34,6 +34,10 @@
#include "gnupg-helper.h"
+#include <gpgme++/engineinfo.h>
+
+#include <KStandardDirs>
+
#include <QDir>
#include <QFile>
#include <QString>
@@ -56,3 +60,21 @@
int Kleo::makeGnuPGError( int code ) {
return gpg_error( static_cast<gpg_err_code_t>( code ) );
}
+
+static QString findGpgExe( GpgME::Engine engine, const char * exe ) {
+ const GpgME::EngineInfo info = GpgME::engineInfo( engine );
+ return info.fileName() ? QFile::decodeName( info.fileName() ) : KStandardDirs::findExe( exe ) ;
+}
+
+QString Kleo::gpgConfPath() {
+ return findGpgExe( GpgME::GpgConfEngine, "gpgconf" );
+}
+
+QString Kleo::gpgSmPath() {
+ return findGpgExe( GpgME::GpgSMEngine, "gpgsm" );
+}
+
+QString Kleo::gpgPath() {
+ return findGpgExe( GpgME::GpgEngine, "gpg" );
+}
+
--- trunk/KDE/kdepim/kleopatra/utils/gnupg-helper.h #802345:802346
@@ -39,6 +39,10 @@
QString gnupgHomeDirectory();
+ QString gpgConfPath();
+ QString gpgSmPath();
+ QString gpgPath();
+
int makeGnuPGError( int code );
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic