e942d00
diff -up kdelibs-4.7.0/knewstuff/knewstuff2/core/security.cpp.knewstuff2_gpg2 kdelibs-4.7.0/knewstuff/knewstuff2/core/security.cpp
e942d00
--- kdelibs-4.7.0/knewstuff/knewstuff2/core/security.cpp.knewstuff2_gpg2	2011-05-20 15:24:54.000000000 -0500
e942d00
+++ kdelibs-4.7.0/knewstuff/knewstuff2/core/security.cpp	2011-09-06 11:29:18.939251150 -0500
e942d00
@@ -36,9 +36,20 @@
e942d00
 #include <kmessagebox.h>
e942d00
 #include <kpassworddialog.h>
e942d00
 #include <kprocess.h>
e942d00
+#include <kstandarddirs.h>
e942d00
 
e942d00
 using namespace KNS;
e942d00
 
e942d00
+static QString gpgExecutable()
e942d00
+{
e942d00
+  QString gpgExe = KStandardDirs::findExe( "gpg" );
e942d00
+  if ( gpgExe.isEmpty() )
e942d00
+    gpgExe = KStandardDirs::findExe( "gpg2" );
e942d00
+  if ( gpgExe.isEmpty() )
e942d00
+    return QLatin1String( "gpg" );
e942d00
+  return gpgExe;
e942d00
+}
e942d00
+
e942d00
 Security::Security()
e942d00
 {
e942d00
     m_keysRead = false;
e942d00
@@ -61,7 +72,7 @@ void Security::readKeys()
e942d00
     m_runMode = List;
e942d00
     m_keys.clear();
e942d00
     m_process = new KProcess();
e942d00
-    *m_process << "gpg"
e942d00
+    *m_process << gpgExecutable() 
e942d00
     << "--no-secmem-warning"
e942d00
     << "--no-tty"
e942d00
     << "--with-colon"
e942d00
@@ -87,7 +98,7 @@ void Security::readSecretKeys()
e942d00
     }
e942d00
     m_runMode = ListSecret;
e942d00
     m_process = new KProcess();
e942d00
-    *m_process << "gpg"
e942d00
+    *m_process << gpgExecutable() 
e942d00
     << "--no-secmem-warning"
e942d00
     << "--no-tty"
e942d00
     << "--with-colon"
e942d00
@@ -260,7 +271,7 @@ void Security::slotCheckValidity()
e942d00
 
e942d00
     //verify the signature
e942d00
     m_process = new KProcess();
e942d00
-    *m_process << "gpg"
e942d00
+    *m_process << gpgExecutable() 
e942d00
     << "--no-secmem-warning"
e942d00
     << "--status-fd=2"
e942d00
     << "--command-fd=0"
e942d00
@@ -342,7 +353,7 @@ void Security::slotSignFile()
e942d00
 
e942d00
     //verify the signature
e942d00
     m_process = new KProcess();
e942d00
-    *m_process << "gpg"
e942d00
+    *m_process << gpgExecutable() 
e942d00
     << "--no-secmem-warning"
e942d00
     << "--status-fd=2"
e942d00
     << "--command-fd=0"