[git] GPGME - branch, master, updated. gpgme-1.6.0-213-gbfa8ac7

by Andre Heinecke cvs at cvs.gnupg.org
Mon Jul 11 16:53:32 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  bfa8ac7e02c16790ee5bd3b42c26699f4821d72e (commit)
       via  b1f42e8f25ada220ec8e4762cfebc3a49b1f7d56 (commit)
      from  02babb29612d554c37b63a49f78acc45653b557e (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 bfa8ac7e02c16790ee5bd3b42c26699f4821d72e
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Mon Jul 11 16:47:30 2016 +0200

    Qt: Fix memleaks in tests
    
    * lang/qt/tests/t-keylist.cpp(cleanupTestCase): Ensure that
    posted events are handled for autodeletion.
    (testSingleKeylistSync): delete job.
    * lang/qt/tests/t-ownertrust.cpp(cleanupTestCase): Ditto
    * lang/qt/tests/t-ownertrust.cpp(testChangeOwnerTrust): Delete
    keylistjobs.
    * lang/qt/tests/t-keylocate.cpp(cleanupTestCase): Ditto

diff --git a/lang/qt/tests/t-keylist.cpp b/lang/qt/tests/t-keylist.cpp
index 38d315f..adc997a 100644
--- a/lang/qt/tests/t-keylist.cpp
+++ b/lang/qt/tests/t-keylist.cpp
@@ -55,6 +55,7 @@ private Q_SLOTS:
         std::vector<GpgME::Key> keys;
         GpgME::KeyListResult result = job->exec(QStringList() << QStringLiteral("alfa at example.net"),
                                                 false, keys);
+        delete job;
         Q_ASSERT (!result.error());
         Q_ASSERT (keys.size() == 1);
         const QString kId = QLatin1String(keys.front().keyID());
@@ -104,6 +105,11 @@ private Q_SLOTS:
         const QString gpgHome = qgetenv("GNUPGHOME");
         QVERIFY2(!gpgHome.isEmpty(), "GNUPGHOME environment variable is not set.");
     }
+
+    void cleanupTestCase()
+    {
+        QCoreApplication::sendPostedEvents();
+    }
 };
 
 QTEST_MAIN(KeyListTest)
diff --git a/lang/qt/tests/t-keylocate.cpp b/lang/qt/tests/t-keylocate.cpp
index 682f722..43aaf1c 100644
--- a/lang/qt/tests/t-keylocate.cpp
+++ b/lang/qt/tests/t-keylocate.cpp
@@ -120,6 +120,11 @@ private Q_SLOTS:
         const QString gpgHome = qgetenv("GNUPGHOME");
         QVERIFY2(!gpgHome.isEmpty(), "GNUPGHOME environment variable is not set.");
     }
+
+    void cleanupTestCase()
+    {
+        QCoreApplication::sendPostedEvents();
+    }
 private:
     QString mTestpattern;
 };
diff --git a/lang/qt/tests/t-ownertrust.cpp b/lang/qt/tests/t-ownertrust.cpp
index 9a0c1cd..8784a79 100644
--- a/lang/qt/tests/t-ownertrust.cpp
+++ b/lang/qt/tests/t-ownertrust.cpp
@@ -55,6 +55,7 @@ private Q_SLOTS:
         std::vector<GpgME::Key> keys;
         GpgME::KeyListResult result = job->exec(QStringList() << QStringLiteral("alfa at example.net"),
                                                 false, keys);
+        delete job;
         Q_ASSERT (!result.error());
         Q_ASSERT (keys.size() == 1);
         Key key = keys.front();
@@ -76,6 +77,7 @@ private Q_SLOTS:
         job = openpgp()->keyListJob(false, true, true);
         result = job->exec(QStringList() << QStringLiteral("alfa at example.net"),
                            false, keys);
+        delete job;
         key = keys.front();
         Q_ASSERT (key.ownerTrust() == Key::Ultimate);
 
@@ -91,6 +93,8 @@ private Q_SLOTS:
         job = openpgp()->keyListJob(false, true, true);
         result = job->exec(QStringList() << QStringLiteral("alfa at example.net"),
                            false, keys);
+        delete job;
+
         key = keys.front();
         Q_ASSERT (key.ownerTrust() == Key::Unknown);
     }
@@ -100,6 +104,11 @@ private Q_SLOTS:
         const QString gpgHome = qgetenv("GNUPGHOME");
         QVERIFY2(!gpgHome.isEmpty(), "GNUPGHOME environment variable is not set.");
     }
+
+    void cleanupTestCase()
+    {
+        QCoreApplication::sendPostedEvents();
+    }
 };
 
 QTEST_MAIN(ChangeOwnerTrustTest)

commit b1f42e8f25ada220ec8e4762cfebc3a49b1f7d56
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Mon Jul 11 16:41:09 2016 +0200

    Qt: Add some general Protocol documentation
    
    * lang/qt/src/protocol.h (Protocol): Add doc.
    
    --
    This explicitly documents that syncs run with exec need deletion.

diff --git a/lang/qt/src/protocol.h b/lang/qt/src/protocol.h
index e5153b5..64146b8 100644
--- a/lang/qt/src/protocol.h
+++ b/lang/qt/src/protocol.h
@@ -63,6 +63,41 @@ class ChangePasswdJob;
 class AddUserIDJob;
 class SpecialJob;
 
+/** The main entry point for QGpgME Comes in OpenPGP and SMIME(CMS) flavors.
+ *
+ * Use the proctocol class to obtain an instance of a job. Jobs
+ * provide async API for GnuPG that can be connected to signals / slots.
+ *
+ * A job is usually started with start() and emits a result signal.
+ * The parameters of the result signal depend on the job but the last
+ * two are always a QString for the auditlog and an GpgME::Error for
+ * an eventual error.
+ *
+ * In case async API is used and the result signal is emited a
+ * job schedules its own deletion.
+ *
+ * Most jobs also provide a synchronous call exec in which case
+ * you have to explicitly delete the job if you don't need it anymore.
+ *
+ * \code
+ * // Async example:
+ * KeyListJob *job = openpgp()->keyListJob();
+ * connect(job, &KeyListJob::result, job, [this, job](KeyListResult, std::vector<Key> keys, QString, Error)
+ * {
+ *    // keys and resuls can now be used.
+ * });
+ * \endcode
+ *
+ * \code
+ * // Sync eaxmple:
+ * KeyListJob *job = openpgp()->keyListJob(false, false, false);
+ * std::vector<GpgME::Key> keys;
+ * GpgME::KeyListResult result = job->exec(QStringList() <<
+ *                                         QStringLiteral("alfa at example.net"),
+ *                                         false, keys);
+ * delete job;
+ * \endcode
+ */
 class QGPGME_EXPORT Protocol
 {
 public:

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

Summary of changes:
 lang/qt/src/protocol.h         | 35 +++++++++++++++++++++++++++++++++++
 lang/qt/tests/t-keylist.cpp    |  6 ++++++
 lang/qt/tests/t-keylocate.cpp  |  5 +++++
 lang/qt/tests/t-ownertrust.cpp |  9 +++++++++
 4 files changed, 55 insertions(+)


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




More information about the Gnupg-commits mailing list