Blame SOURCES/kdelibs-4.7.0-knewstuff2_gpg2.patch

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