[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdepim/libkleo/backends/qgpgme
From:       Frank Osterfeld <frank.osterfeld () kdemail ! net>
Date:       2008-02-04 16:55:32
Message-ID: 1202144132.339899.3610.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 770898 by osterfeld:

Use gpgme engine info, if available, to find gpgconf

 M  +1 -1      qgpgmebackend.cpp  
 M  +12 -1     qgpgmecryptoconfig.cpp  
 M  +2 -0      qgpgmecryptoconfig.h  


--- trunk/KDE/kdepim/libkleo/backends/qgpgme/qgpgmebackend.cpp #770897:770898
@@ -258,7 +258,7 @@
 
 Kleo::CryptoConfig * Kleo::QGpgMEBackend::config() const {
   if ( !mCryptoConfig ) {
-    static bool hasGpgConf = !KStandardDirs::findExe( "gpgconf" ).isEmpty();
+    static bool hasGpgConf = !QGpgMECryptoConfig::gpgConfPath().isEmpty();
     if ( hasGpgConf )
       mCryptoConfig = new QGpgMECryptoConfig();
   }
--- trunk/KDE/kdepim/libkleo/backends/qgpgme/qgpgmecryptoconfig.cpp #770897:770898
@@ -40,7 +40,11 @@
 #include <kmessagebox.h>
 #include <klocale.h>
 #include <kshell.h>
+#include <KStandardDirs>
 
+#include <gpgme++/engineinfo.h>
+#include <gpgme++/global.h>
+
 #include <cassert>
 #include <ktemporaryfile.h>
 #include <QFile>
@@ -61,6 +65,12 @@
 static const int GPGCONF_FLAG_NO_CHANGE = 128; // readonly
 // Change size of mFlags bitfield if adding new values here
 
+QString QGpgMECryptoConfig::gpgConfPath()
+{
+    const char* path = GpgME::engineInfo( GpgME::GpgConfEngine ).fileName();
+    return path ? QFile::decodeName( path ) : KStandardDirs::findExe( "gpgconf" );
+}
+
 QGpgMECryptoConfig::QGpgMECryptoConfig()
  :  mParsed( false )
 {
@@ -74,7 +84,8 @@
 {
   // Run gpgconf --list-components to make the list of components
   KProcess process;
-  process << "gpgconf"; // must be in the PATH
+  
+  process << gpgConfPath();
   process << "--list-components";
 
 
--- trunk/KDE/kdepim/libkleo/backends/qgpgme/qgpgmecryptoconfig.h #770897:770898
@@ -51,6 +51,8 @@
 
   Q_OBJECT
 public:
+    
+  static QString gpgConfPath();
   /**
    * Constructor
    */
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic