Commit Graph

121 Commits

Author SHA1 Message Date
Andre Heinecke
9640dc58e4 qt: Add support for stringValueList in CryptoConf
* lang/qt/src/Makefile.am (qgpgme_sources): Add cryptoconfig.cpp
* lang/qt/src/cryptoconfig.cpp: New.
* lang/qt/src/cryptoconfig.h (CryptoConfigEntry::stringValueList):
New.
* lang/qt/src/qgpgmenewcryptoconfig.cpp
(QGpgMENewCryptoConfigEntry::stringValueList): New.
* lang/qt/src/qgpgmenewcryptoconfig.h: Update accordingly.

--
This is a pardigm change in cryptoconfig.h to avoid ABI breaks
with each new config value we support it now has an implementation
that is directly related to qgpgmenewcryptoconfig, which is now
the only one.
2017-01-12 12:57:00 +01:00
Andre Heinecke
a09ed3f26a qt: Don't use qstrdup in test passphrase cb
* lang/qt/tests/t-support.h (TestPassphraseProvider::getPassphrase):
Use gpgrt_asprintf instead of strdup.

--
To avoid problems on MacOS we want to avoid strdup so that
qgpgme can be built without extensions. But qstrdup allocates
with new and not with malloc, so use gpgrt_asprintf instead.
2017-01-12 11:44:11 +01:00
Andre Heinecke
56926c9b50 qt: Clean up test dirs on failure
* t-encrypt.cpp,
t-keylist.cpp,
t-keylocate.cpp,
t-ownertrust.cpp,
t-tofuinfo.cpp,
t-various.cpp,
t-verify.cpp,
t-wkspublish.cpp: Use QVERIFY instead of Q_ASSERT
2017-01-11 16:20:31 +01:00
Andre Heinecke
9e643ab671 qt: Add test for uid functions
* lang/qt/tests/t-various.cpp: New.
* lang/qt/tests/Makefile.am: Update accordingly.
2017-01-11 16:18:17 +01:00
Andre Heinecke
efe58fe011 Fix Qgpgme build for macos
* lang/qt/src/dn.cpp: Include string.h
(parse_dn_part): Use qstrdup.
* lang/qt/tests/t-support.h (getPassphrase): Use qstrdup.
2017-01-11 15:52:44 +01:00
Andre Heinecke
2e661b9e1a Fix cmake configuration files for MacOS
* configure.ac: Set HAVE_MACOS_SYSTEM conditional.
* lang/qt/src/Makefile.am,
lang/cpp/src/Makefile.am,
lang/qt/src/QGpgmeConfig.cmake.in.in,
lang/cpp/src/GpgmeConfig.cmake.in.in: Use libsuffix again to
distinguish between macos .dylib

--
GnuPG-Bug-Id: 2884
2017-01-11 15:49:00 +01:00
Andre Heinecke
ececfd5de8 qt: Update config sync doc / comment
* lang/qt/src/cryptoconfig.h (CryptoConfig::sync): Document
that runtime option is always set.
* lang/qt/Src/qgpgmenewcryptoconfig.cpp
(QGpgMENewCryptoConfigComponent::sync): Remove outdated comment
and warn on error.
2017-01-02 14:05:06 +01:00
Andre Heinecke
b2c07bd47b qt, cpp: Add cmake config files for w32
* lang/cpp/src/GpgmeppConfig-w32.cmake.in.in
lang/qt/src/QGpgmeConfig-w32.cmake.in.in: New.
* lang/cpp/src/GpgmeppConfig.cmake.in.in,
lang/qt/src/QGpgmeConfig.cmake.in.in: Remove libsuffix handling.
* lang/cpp/src/Makefile.am,
lang/qt/src/Makefile.am: Create / install w32 config files.
* configure.ac: Configure them.

--
To work with DLL's cmake needs to know about the implib and
the final DLL. So the config files look different enough
that it's better to use alternative files.
2016-11-15 14:33:31 +01:00
Andre Heinecke
45abe6d142 qt: Use new style connect in th..mixin
* lang/qt/src/threadedjobmixin.h
(ThreadedJobMixin::lateInitialization): Use new style connect.
2016-11-15 12:30:56 +01:00
Andre Heinecke
9451faa2ee qt: Add API to get the context for a Job
* lang/qt/src/job.cpp,
lang/qt/src/job.h (Job::context): New.
* lang/qt/src/threadedjobmixin.cpp
(ThreadedJobMixin::~ThreadedJobMixin): New. Unregister context.
(ThreadedJobMixin::lateInitialization): Register context.
* NEWS: Update for cpp and qt.

--
The global map hack is necessary because the job class does
not know about the context which is held in threadedjobmixin.
Adding a virtual function in Job would be an ABI break which
I'd like to avoid at this point. Although QGpgME's API will
need a big ABI break to make it ABI maintainable. The virtual
jobs -> implementation classes are nearly unmaintainable ABI wise.

The context is exposed to provide more flexibility to users, e.g.
to add a passphrase callback or to set the sender in a context.
2016-11-14 20:48:20 +01:00
Andre Heinecke
f3790ddf56 qt, cpp: Enable dll build for windows
* lang/cpp/src/Makefile.am,
lang/qt/src/Makefile.am: Add -no-undefined to LDFLAGS.
2016-11-14 19:39:12 +01:00
Andre Heinecke
34a4e8017b qt: Change license of export / version header
* lang/qt/src/qgpgme_export.h,
lang/qt/src/qgpgme_version.h: Change license to GPLv2+

--
These files were based on copies from the cpp version/export
headers. This change is meant to clarify the licensing by
bringing it in line with the overall licesense of the
qgpgme library.
2016-11-03 10:09:04 +01:00
Andras Mantia
b4658f6a11 qt: Fix build with g++ 4.8.x
* lang/qt/src/defaultkeygenerationjob.cpp
(DefaultKeyGenerationJob::start): Explicitly connect pointer
in the QPointer.

--
Commit message written by Andre Heinecke <aheinecke@intevation.de>
2016-11-02 14:53:14 +01:00
Andre Heinecke
bf9aa0ccf7 qt, cpp: Fix versioning in cmake config and header
* configure.ac (VERSION_MAJOR, VERSION_MINOR, VERSION_MICRO): New
subst variables for the version header.
* lang/cpp/src/GpgmeppConfigVersion.cmake.in,
lang/cpp/src/gpgmepp_version.h.in,
lang/qt/src/QGpgmeConfigVersion.cmake.in,
lang/qt/src/qgpgme_version.h.in: Use new variables.

--
Using the LT_* variables was just wrong. Reporting the
package version also makes more sense then the library version.
Having different versions might make ABI breaks more visible
by increasing the major version number, but to have different
versions in the same package is too confusing imo and gpgme
uses a versioning that is unrelated to the library version number.
2016-11-02 14:43:44 +01:00
Andre Heinecke
b5c4d56cfd qt: Install cmake config into qgpgme subdir
* lang/qt/src/Makefile.am: Install cmake config file in qgpgme subdir.

--
Putting it together with Gpgmepp was done for historic reasons
but the proper way is for each library to have its own subdir.
2016-11-02 14:36:56 +01:00
Andre Heinecke
4149194d2e qt: Require gpgmepp from cmake config script
* lang/qt/src/QGpgmeConfig.cmake.in.in: Require cpp.

--
This fixes an error if a user only does find_package(QGpgme)
2016-11-02 14:31:35 +01:00
Andre Heinecke
8486f21342 qt, cpp: Add all generated files to cleanfiles
* cpp/src/Makefile.am (CLEANFILES),
qt/src/Makefile.am (CLEANFILES): Add all generated files
to cleanfiles.
2016-11-02 12:24:42 +01:00
Andre Heinecke
627c5deed8 qt: Add Distinguished Name parser from libkleo
* lang/qt/src/dn.cpp (DN, DN::Attribute): New public API.
* lang/qt/src/dn.h: New.
* lang/qt/src/Makefile.am: Update accordingly.

--
This is a general useful API to work with X509 distinguished
names and is useful when doing CMS with GpgME.

Adding this class from libkleo allows kmails messagelib to
avoid any KDE UI Frameworks and so can be used more versatile
in the future.

This class can be combined with libkleos DNAttributeMapper
to have the same bevavior as before in libkleo when using
DN::prettyDN calls can be converted from:

    Kleo::DN(uid).prettyDN();

to:
    QGpgME::DN dn(uid);
    uid.setAttributeOrder(
        Kleo::DNAttributeMapper::instance()->attributeOrder());
    dn.prettyDN();
2016-11-01 18:28:20 +01:00
Andre Heinecke
567123de21 qt, cpp: Install version headers in subdirs
* lang/cpp/src/Makefile.am,
lang/qt/src/Makefile.am: Install version headers in include
subdirs.

--
This change was requested on the gnupg-devel mailing list to
avoid placing these headers into the top level include directories.
There is currently no known user of these headers so changing it
now should not break things downstream.
2016-11-01 10:18:02 +01:00
Andre Heinecke
26cbba3c9c qt: Improve WKSPublishJob apidoc
* lang/qt/src/wkspublishjob.h: Improve doc.
2016-10-19 15:17:57 +02:00
Andre Heinecke
a274c7590a qt, cpp: Fix permissions of Config files
* lang/cpp/src/Makefile.am,
lang/qt/src/Makefile.am: Do not install config files as executable.
2016-10-13 09:35:30 +02:00
Andre Heinecke
2538c12fa0 qt: Install SpecialJob
* lang/qt/src/Makefile.am: Install SpecialJob
* NEWS: mention it.

--
SpecialJob was and is public API. So it needs to be installed.
2016-10-13 09:13:50 +02:00
Andre Heinecke
a3cf30f894 qt, cpp: Fix expected targets in Config files
* lang/cpp/src/GpgmeppConfig.cmake.in.in,
lang/qt/src/QGpgmeConfig.cmake.in.in: Remove KF5 variants.
2016-10-13 09:13:40 +02:00
Daniel Vrátil
e5a35af557 qt: Add missing implementation of MultiDeleteJob
* lang/qt/src/multideletejob.h: Fix include, cryptobackend.h is now
called protocol.h
* lang/qt/src/multideletejob.cpp: New file.
* lang/qt/src/Makefile.am: Add multideletejob.cpp.
2016-10-11 19:56:55 +02:00
Daniel Vrátil
ce7385caab qt: Install abstractimportjob.h
* lang/cpp/src/Makefile.am: Install abstractimportjob.h since it's
included from importjob.h

--
Fixes build when someone inclues importjob.h in their code.
2016-10-11 19:43:37 +02:00
Andre Heinecke
f131a5e72b qt: Add simple verify test
* lang/qt/tests/t-verify.cpp: New. Small test if a signature
returns a key with fingerprint.
* lang/qt/tests/Makefile.am: Add new test.
2016-10-10 17:34:52 +02:00
Andre Heinecke
88c7e84ede qt: Fix spelling error in WKSPublishJob
* src/qgpgmewkspublishjob.cpp,
src/qgpgmewkspublishjob.h,
src/wkspublishjob.h,
tests/t-wkspublish.cpp: Fix spelling of received.
* src/configure.ac (LIBQGPGME_LT_CURRENT): Bump
accordingly.

--
While this is an API break I've decided to fix this now
instead of deprecating / keeping it around forever in the API.

The only known users of QGpgME are KDE Applications and
there it is not yet used.
2016-10-05 17:36:17 +02:00
Andre Heinecke
24779c9e23 qt: Disable tests that require a password for 2.0
* lang/qt/tests/t-encrypt.cpp: Disable tests that require
a password for 2.0.

--
The passphrase_cb apparently does not work with 2.0 so we would
need a fake pinentry to get this to work. We just disable the
test instead as this is a rarely used feature and works with
1.4 and 2.1.
2016-10-05 17:19:20 +02:00
Andre Heinecke
9d1df99038 qt: Fix unused variable warnings
* qt/src/qgpgmenewcryptoconfig.cpp,
qt/src/threadedjobmixin.h,
qt/tests/t-encrypt.cpp,
qt/tests/t-support.h,
qt/tests/t-wkspublish.cpp: Mark additional variables as unused.
2016-10-05 16:44:53 +02:00
Andre Heinecke
52a91ccc6a qt: Disable t-wkspublish test
* lang/qt/tests/Makefile.am (TESTS): Remove t-wkspublish.

--
Even the only enabled test did a connection to localhost this
might fail if it is stalled and is an outside factor. It also might
be disturbing other services locally.
2016-10-05 16:01:20 +02:00
Andre Heinecke
7302791c0d cpp, qt: Handle modified includedir installation
* lang/cpp/src/Makefile.am,
lang/qt/src/Makefile.am: Replace resolved_includedir.
* lang/cpp/src/GpgmeppConfig.cmake.in.in,
lang/qt/src/QGpgmeConfig.cmake.in.in: Use resolved_includedir
instead of relying on a common installation prefix.

--
This fixes usage of the config files in case gpgme
is configured with a custom --includedir.
We have to do the replacement manually like for libdir
because configure would include variables in the replacement.
2016-09-29 12:46:18 +02:00
Daniel Kahn Gillmor
95f38652f6 Fix spelling
* lang/cpp/src/context.h, lang/qt/src/protocol.h,
   lang/qt/src/wkspublishjob.h, src/data-identify.c, src/engine-gpg.c:
   minor spelling cleanup.
--

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2016-09-23 16:09:27 +02:00
Daniel Kahn Gillmor
a11450eb04 move some file encodings to UTF-8
* THANKS, doc/ChangeLog-2011, tests/ChangeLog-2011,
  tests/gpg/geheim.txt: convert from iso 8859-1 to utf-8.
* lang/qt/src/dataprovider.cpp, lang/qt/src/qgpgmerefreshkeysjob.cpp,
  lang/qt/src/qgpgmesecretkeyexportjob.cpp: replace U+FFFD REPLACEMENT
  CHARACTER with proper U+00E4 LATIN SMALL LETTER A WITH DIAERESIS.

--
Note that src/versioninfo.rc.in is still ISO-8859-1.  I don't know
whether Windows will properly handle UTF-8 in this file or not, so i
have not touched it.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2016-09-23 16:08:33 +02:00
Andre Heinecke
a142f187b7 cpp, qt: Include config.h
lang/cpp/src/callbacks.cpp,
lang/cpp/src/configuration.cpp,
lang/cpp/src/context.cpp,
lang/cpp/src/context_glib.cpp,
lang/cpp/src/context_qt.cpp,
lang/cpp/src/context_vanilla.cpp,
lang/cpp/src/data.cpp,
lang/cpp/src/decryptionresult.cpp,
lang/cpp/src/defaultassuantransaction.cpp,
lang/cpp/src/editinteractor.cpp,
lang/cpp/src/encryptionresult.cpp,
lang/cpp/src/engineinfo.cpp,
lang/cpp/src/eventloopinteractor.cpp,
lang/cpp/src/exception.cpp,
lang/cpp/src/gpgadduserideditinteractor.cpp,
lang/cpp/src/gpgagentgetinfoassuantransaction.cpp,
lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp,
lang/cpp/src/gpgsetownertrusteditinteractor.cpp,
lang/cpp/src/gpgsignkeyeditinteractor.cpp,
lang/cpp/src/importresult.cpp,
lang/cpp/src/key.cpp,
lang/cpp/src/keygenerationresult.cpp,
lang/cpp/src/keylistresult.cpp,
lang/cpp/src/scdgetinfoassuantransaction.cpp,
lang/cpp/src/signingresult.cpp,
lang/cpp/src/tofuinfo.cpp,
lang/cpp/src/trustitem.cpp,
lang/cpp/src/verificationresult.cpp,
lang/cpp/src/vfsmountresult.cpp,
lang/qt/src/dataprovider.cpp,
lang/qt/src/defaultkeygenerationjob.cpp,
lang/qt/src/gpgme_backend_debug.cpp,
lang/qt/src/job.cpp,
lang/qt/src/qgpgmeadduseridjob.cpp,
lang/qt/src/qgpgmebackend.cpp,
lang/qt/src/qgpgmechangeexpiryjob.cpp,
lang/qt/src/qgpgmechangeownertrustjob.cpp,
lang/qt/src/qgpgmechangepasswdjob.cpp,
lang/qt/src/qgpgmedecryptjob.cpp,
lang/qt/src/qgpgmedecryptverifyjob.cpp,
lang/qt/src/qgpgmedeletejob.cpp,
lang/qt/src/qgpgmedownloadjob.cpp,
lang/qt/src/qgpgmeencryptjob.cpp,
lang/qt/src/qgpgmeexportjob.cpp,
lang/qt/src/qgpgmeimportfromkeyserverjob.cpp,
lang/qt/src/qgpgmeimportjob.cpp,
lang/qt/src/qgpgmekeyformailboxjob.cpp,
lang/qt/src/qgpgmekeygenerationjob.cpp,
lang/qt/src/qgpgmekeylistjob.cpp,
lang/qt/src/qgpgmelistallkeysjob.cpp,
lang/qt/src/qgpgmenewcryptoconfig.cpp,
lang/qt/src/qgpgmerefreshkeysjob.cpp,
lang/qt/src/qgpgmesecretkeyexportjob.cpp,
lang/qt/src/qgpgmesignencryptjob.cpp,
lang/qt/src/qgpgmesignjob.cpp,
lang/qt/src/qgpgmesignkeyjob.cpp,
lang/qt/src/qgpgmetofupolicyjob.cpp,
lang/qt/src/qgpgmeverifydetachedjob.cpp,
lang/qt/src/qgpgmeverifyopaquejob.cpp,
lang/qt/src/qgpgmewkspublishjob.cpp,
lang/qt/src/threadedjobmixin.cpp,
lang/qt/tests/run-keyformailboxjob.cpp,
lang/qt/tests/t-encrypt.cpp,
lang/qt/tests/t-keylist.cpp,
lang/qt/tests/t-keylocate.cpp,
lang/qt/tests/t-ownertrust.cpp,
lang/qt/tests/t-support.cpp,
lang/qt/tests/t-tofuinfo.cpp,
lang/qt/tests/t-wkspublish.cpp: Include config.h

--
This fixes problems with mismatching definitions. Most
notably _FILE_OFFSET_BITS is now always set correctly.
2016-09-23 15:25:51 +02:00
Werner Koch
29207bcd3b
tests: Improve portability.
* lang/qt/tests/Makefile.am (clean-local): Avoid non-portable "--"
* lang/python/Makefile.am (copystamp): Use well defined cp -R instead
of cp -r.

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-20 19:46:04 +02:00
Andre Heinecke
3f92253e0e qt: Improve README
* lang/qt/README: Add more content. Clearly note license difference.
2016-09-19 14:09:44 +02:00
Andre Heinecke
d438cb59a0 qt: Add debug output for testTofuPolicy
* lang/qt/tests/t-tofuinfo.cpp (testTofuPolicy): Add
debug output.

--
The debug output is only emitted before a failure of the
test in case a keylisting of bravo@example.net fails which
it should never do.
2016-09-19 10:01:19 +02:00
Andre Heinecke
a8ff34fc30 qt: Add test for setting tofu policy
* lang/qt/tests/t-tofuinfo.cpp (testTofuPolicy): New.
2016-09-16 16:58:39 +02:00
Andre Heinecke
77aecfb5c9 qt: Add job for tofupolicy
* lang/qt/src/job.cpp, lang/qt/src/protocol.h,
lang/qt/src/protocol_p.h: Register job.
* lang/qt/src/qgpgmetofupolicyjob.cpp,
lang/qt/src/qgpgmetofupolicyjob.h,
lang/qt/src/tofupolicyjob.h: New.
* lang/qt/src/Makefile.am: Update accordingly.
2016-09-16 16:58:39 +02:00
Andre Heinecke
d480f6b701 qt: Fix some includes
* lang/qt/src/qgpgmekeyformailboxjob.cpp: Explicitly include
QStringList.
* lang/qt/tests/t-support.h, lang/qt/tests/t-support.cpp: Move
includes into impl. Explicitly include QDir.

--
This fixes build against Qt versions where the includes are less
implicit.
2016-09-12 10:52:10 +02:00
Justus Winter
7b9e6ea376 qt: Fix tofu test.
* lang/qt/tests/t-tofuinfo.cpp: Adjust member names.

Fixes-commit: 120b1478
Signed-off-by: Justus Winter <justus@g10code.com>
2016-09-12 10:11:44 +02:00
Andre Heinecke
ab3fbdbd05 qt: Clarify comment and strings in tofuinfo test
* lang/qt/tests/t-tofuinfo.cpp (testTofuSignCount)
(testTofuKeyList): Ensure distinct messages. Clarify comment.
2016-09-05 16:54:50 +02:00
Andre Heinecke
965b842fad qt: Enable signcount checks in tofuinfo test
* lang/qt/tests/t-tofuinfo.cpp: Enable checks for signcount.

--
Signcount for userIDs works now as expected with gnupg 2.1.16.
2016-09-05 12:58:35 +02:00
Andre Heinecke
8a39a595eb qt: Add missing header redirection
* lang/qt/src/keyformailboxjob.h,
lang/qt/src/qgpgmekeyformailboxjob.h: Fix includes.

--
This ensures that when building qgpgme you do not need an installed
gpgme++.
2016-09-05 10:44:41 +02:00
Andre Heinecke
e3a4697894 qt: Include cpp before core directory
* lang/qt/src/Makefile.am (AM_CPPFLAGS): Include cpp before core.

--
Both core and cpp have headers that have the same names, this
can lead to the wrong headers beeing included when qt bindings
are built.
2016-09-05 10:42:02 +02:00
Andre Heinecke
05570bd3d0 qt: Fix 2.1 t-support copy
* lang/qt/src/t-support.cpp (copyKeyring): Fix seckey copy.
2016-08-25 17:16:25 +02:00
Andre Heinecke
9fc72e928b qt: Fix and extend TofuInfo test.
* lang/qt/tests/t-tofuinfo.cpp: Delete executed jobs.
(testTofuKeyList): New.
(testSupported): Activate for 2.1.16
(signAndVerify): Disable sigcount tests.
2016-08-25 16:25:49 +02:00
Andre Heinecke
c875f07e55 qt: Fix keyring copy in tests
* lang/qt/test/t-encrypt.cpp,
lang/qt/test/t-tofuinfo.cpp: Assert on copy failure.
* lang/qt/test/t-support.cpp (copyKeyrings): Fix path.
2016-08-25 16:23:58 +02:00
Andre Heinecke
4e37d0bb12 qt: Add generic flag support for keylistjobs
* lang/qt/src/keylistjob.h (addMode): New.
* lang/qt/src/qgpgmekeylistjob.h (addMode): New.
* lang/qt/src/qgpgmekeylistjob.cpp (addMode: New.

--
Instead of new API for each new thing lets be a bit more
generic / open.
2016-08-25 16:22:12 +02:00
Andre Heinecke
5a92cc96da qt: Ensure that current src dir is included first
* lang/qt/src/Makefile.am: Reorder include directives.

--
This fixes the problem that QGpgME would pick up gpgme or
gpgme++ headers from an installed version.
2016-08-25 16:20:42 +02:00