[git] GPGME - branch, master, updated. gpgme-1.6.0-272-gd467018

by Andre Heinecke cvs at cvs.gnupg.org
Wed Aug 10 12:08:17 CEST 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG Made Easy".

The branch, master has been updated
       via  d467018ce36f5be36751267c3b6079e8c1ee5d8a (commit)
       via  a27d7755d071aad42efc2aa4ea3899ba7b17f8bf (commit)
       via  21d5e71d486da8e37cf53f2b968646b39a6daa72 (commit)
      from  04f994d5db6db0575dc73c2356c7d51424e2d9fe (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d467018ce36f5be36751267c3b6079e8c1ee5d8a
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Wed Aug 10 12:06:39 2016 +0200

    Qt: Remove unused variable
    
    * lang/qt/src/qgpgmerefreshkeysjob.cpp (slotStatus): Remove
    unused variable typ.

diff --git a/lang/qt/src/qgpgmerefreshkeysjob.cpp b/lang/qt/src/qgpgmerefreshkeysjob.cpp
index 53a9d2c..3d221f6 100644
--- a/lang/qt/src/qgpgmerefreshkeysjob.cpp
+++ b/lang/qt/src/qgpgmerefreshkeysjob.cpp
@@ -176,7 +176,7 @@ void QGpgME::QGpgMERefreshKeysJob::slotStatus(QProcess *proc, const QString &typ
         }
         const QString what = *++it;
         ok = false;
-        const int typ = (*++it).toInt(&ok);
+        (*++it).toInt(&ok);
         if (!ok) {
             qCDebug(GPGPME_BACKEND_LOG) << "expected number for \"type\", got something else";
             return;

commit a27d7755d071aad42efc2aa4ea3899ba7b17f8bf
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Wed Aug 10 12:05:32 2016 +0200

    Qt: Create TestPassphraseProvider on stack
    
    * lang/qt/tests/t-encrypt.cpp, lang/qt/tests/t-tofuinfo.cpp: Create
    TestPassphraseProvider on stack.
    
    --
    Context does not delete the provider. This fixes ASAN errors.

diff --git a/lang/qt/tests/t-encrypt.cpp b/lang/qt/tests/t-encrypt.cpp
index b0b6994..c6fcaa2 100644
--- a/lang/qt/tests/t-encrypt.cpp
+++ b/lang/qt/tests/t-encrypt.cpp
@@ -71,7 +71,8 @@ private Q_SLOTS:
 
         /* Now decrypt */
         auto ctx = Context::createForProtocol(OpenPGP);
-        ctx->setPassphraseProvider(new TestPassphraseProvider);
+        TestPassphraseProvider provider;
+        ctx->setPassphraseProvider(&provider);
         ctx->setPinentryMode(Context::PinentryLoopback);
         auto decJob = new QGpgMEDecryptJob(ctx);
         QByteArray plainText;
@@ -84,7 +85,8 @@ private Q_SLOTS:
     void testSymmetricEncryptDecrypt()
     {
         auto ctx = Context::createForProtocol(OpenPGP);
-        ctx->setPassphraseProvider(new TestPassphraseProvider);
+        TestPassphraseProvider provider;
+        ctx->setPassphraseProvider(&provider);
         ctx->setPinentryMode(Context::PinentryLoopback);
         ctx->setArmor(true);
         ctx->setTextMode(true);
@@ -99,7 +101,7 @@ private Q_SLOTS:
         killAgent(mDir.path());
 
         auto ctx2 = Context::createForProtocol(OpenPGP);
-        ctx2->setPassphraseProvider(new TestPassphraseProvider);
+        ctx2->setPassphraseProvider(&provider);
         ctx2->setPinentryMode(Context::PinentryLoopback);
         auto decJob = new QGpgMEDecryptJob(ctx2);
         QByteArray plainText;
diff --git a/lang/qt/tests/t-tofuinfo.cpp b/lang/qt/tests/t-tofuinfo.cpp
index 8331092..3072f0f 100644
--- a/lang/qt/tests/t-tofuinfo.cpp
+++ b/lang/qt/tests/t-tofuinfo.cpp
@@ -73,7 +73,8 @@ class TofuInfoTest: public QGpgMETest
     void signAndVerify(const QString &what, const GpgME::Key &key, int expected)
     {
         Context *ctx = Context::createForProtocol(OpenPGP);
-        ctx->setPassphraseProvider(new TestPassphraseProvider);
+        TestPassphraseProvider provider;
+        ctx->setPassphraseProvider(&provider);
         ctx->setPinentryMode(Context::PinentryLoopback);
         auto *job = new QGpgMESignJob(ctx);
 

commit 21d5e71d486da8e37cf53f2b968646b39a6daa72
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Wed Aug 10 12:04:16 2016 +0200

    Cpp: Clarify ownership of provider classes
    
    * lang/cpp/src/context.h: Note that the context does not take
    ownership of providers.

diff --git a/lang/cpp/src/context.h b/lang/cpp/src/context.h
index c7c0ecb..70ab079 100644
--- a/lang/cpp/src/context.h
+++ b/lang/cpp/src/context.h
@@ -102,9 +102,23 @@ public:
     void addKeyListMode(unsigned int keyListMode);
     unsigned int keyListMode() const;
 
+    /** Set the passphrase provider
+     *
+     * To avoid problems where a class using a context registers
+     * itself as the provider the Context does not take ownership
+     * of the provider and the caller must ensure that the provider
+     * is deleted if it is no longer needed.
+     */
     void setPassphraseProvider(PassphraseProvider *provider);
     PassphraseProvider *passphraseProvider() const;
 
+    /** Set the progress provider
+     *
+     * To avoid problems where a class using a context registers
+     * itself as the provider the Context does not take ownership
+     * of the provider and the caller must ensure that the provider
+     * is deleted if it is no longer needed.
+     */
     void setProgressProvider(ProgressProvider *provider);
     ProgressProvider *progressProvider() const;
 

-----------------------------------------------------------------------

Summary of changes:
 lang/cpp/src/context.h               | 14 ++++++++++++++
 lang/qt/src/qgpgmerefreshkeysjob.cpp |  2 +-
 lang/qt/tests/t-encrypt.cpp          |  8 +++++---
 lang/qt/tests/t-tofuinfo.cpp         |  3 ++-
 4 files changed, 22 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org




More information about the Gnupg-commits mailing list