gpgme.git
3 years agopython: Translate list of strings.
Justus Winter [Mon, 23 May 2016 13:41:06 +0000 (15:41 +0200)]
python: Translate list of strings.

* lang/python/gpgme.i: Add typemap translating list of strings.

Signed-off-by: Justus Winter <justus@gnupg.org>
3 years agoapi: Return Tofu info for signatures.
Werner Koch [Sat, 21 May 2016 08:29:49 +0000 (10:29 +0200)]
api: Return Tofu info for signatures.

* src/gpgme.h.in (gpgme_tofu_policy_t): New.
(gpgme_status_code_t): Add status codes for TOFU.
(struct _gpgme_tofu_info, gpgme_tofu_info_t): New.
(struct _gpgme_signature): Add field 'tofu'.
* src/status-table.c (status_table): Add new codes.
* src/verify.c: Include limits.h.
(release_tofu_info): New.
(release_op_data): Call that.
(parse_tofu_user): New.
(parse_tofu_stats): New.
(parse_tofu_stats_long): New.
(_gpgme_verify_status_handler): Handle TOFU status lines.

* tests/run-verify.c (print_description): New.
(print_result): print tofu info.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoapi: Add new context flag "raw-description".
Werner Koch [Sat, 21 May 2016 08:22:57 +0000 (10:22 +0200)]
api: Add new context flag "raw-description".

* src/context.h (struct gpgme_context): Add field raw_description.
* src/gpgme.c (gpgme_set_ctx_flag): New flag.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agocore: New functions to help parsing of status lines.
Werner Koch [Sat, 21 May 2016 08:21:06 +0000 (10:21 +0200)]
core: New functions to help parsing of status lines.

* src/conversion.c (_gpgme_split_fields): New.
(_gpgme_strtoul_field): New.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoQt: Add test for changeownertrust
Andre Heinecke [Fri, 20 May 2016 14:04:50 +0000 (16:04 +0200)]
Qt: Add test for changeownertrust

* lang/qt/tests/t-ownertrust.cpp: New test.
* lang/qt/tests/Makefile.am: Add test.

--
This test would have catched the issue created by not handling
GPGME_STATUS_KEY_CONSIDERED.

3 years agoCpp: Ignore STATUS_KEY_CONSIDERED when editing
Andre Heinecke [Fri, 20 May 2016 14:03:08 +0000 (16:03 +0200)]
Cpp: Ignore STATUS_KEY_CONSIDERED when editing

* lang/cpp/src/editinteractor.cpp (EditInteractor::needsNoResponse):
Handle GPGME_STATUS_KEY_CONSIDERED.

3 years agoapi: Add new function gpgme_set_ctx_flag.
Werner Koch [Thu, 19 May 2016 15:01:07 +0000 (17:01 +0200)]
api: Add new function gpgme_set_ctx_flag.

* src/gpgme.h.in (gpgme_set_ctx_flag): New prototype.
* src/gpgme.c (gpgme_set_ctx_flag): New.
* src/gpgme.def, src/libgpgme.vers: Add new function.
* src/context.h (struct gpgme_context): Add FULL_STATUS.
* src/decrypt.c (_gpgme_decrypt_status_handler): Do not call the
  status callback if FULL_STATUS is set.
* src/genkey.c (genkey_status_handler): Ditto.
* src/passphrase.c (_gpgme_passphrase_status_handler): Ditto.
* src/sign.c (_gpgme_sign_status_handler): Ditto.

* src/engine-backend.h (struct engine_ops): Add SET_STATUS_CB and add
adjust all definitions of that variable.
* src/engine.c (_gpgme_engine_set_status_cb): New.
* src/op-support.c (_gpgme_op_reset): Call this function.

* src/engine-gpg.c (struct engine_gpg): Add fields MON_CB and
MON_CB_VALUE.
(gpg_set_status_cb): New.
(_gpgme_engine_ops_gpg): Register that function.
(read_status): Call the monitor callback.

* src/engine-gpgsm.c (struct engine_gpgsm): Add fields MON_CB and
MON_CB_VALUE.
(_gpgme_engine_ops_gpgsm): Register that function.
(gpgsm_assuan_simple_command): Change first arg to be an engine
context and adjust call callers.  Call the monitor callback.

* src/engine-uiserver.c (struct engine_uiserver): Add fields MON_CB
and MON_CB_VALUE.
(_gpgme_engine_ops_uiserver): Register that function.
(uiserver_assuan_simple_command): Change first arg to be an engine
context and adjust call callers.  Call the monitor callback.

* tests/run-verify.c (status_cb): New.
(print_result): Print algo names.
(main): Add option --status.
--

This new feature is mainly intended for bug tracking.  Having access
to the raw status lines might also be useful for applications, though.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoapi: Remove arbitrary restriction from gpgme_op_verify.
Werner Koch [Thu, 19 May 2016 12:26:22 +0000 (14:26 +0200)]
api: Remove arbitrary restriction from gpgme_op_verify.

* src/verify.c (verify_start): Do not return GPG_ERR_INV_VALUES when
when SIGNED_TEXT is not given.
--

The original idea behind this restriction probably was that it is
useless to verify a non-detached signatures without also returning the
signed text.  However, it is sometimes useful to just check the
signature, for example to see who signed it.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agopython: Improve progress callbacks.
Justus Winter [Thu, 19 May 2016 13:53:19 +0000 (15:53 +0200)]
python: Improve progress callbacks.

* lang/python/helpers.c (pyProgressCb): Stash python errors, convert
'what' to Unicode object.
* lang/python/pyme/core.py (Context.set_progress_cb): Hand in 'self'.
* lang/python/tests/t-callbacks.py: Test progress callbacks.

Signed-off-by: Justus Winter <justus@gnupg.org>
3 years agopython: Robust exception handling in callbacks.
Justus Winter [Thu, 19 May 2016 09:03:27 +0000 (11:03 +0200)]
python: Robust exception handling in callbacks.

* lang/python/helpers.c (pygpgme_stash_callback_exception): New
function.
(pygpgme_raise_callback_exception): Likewise.
(pyPassphraseCb): Stash python errors.
* lang/python/helpers.h (pygpgme_raise_callback_exception): New
prototype.
* lang/python/pyme/core.py ({Context,Data}.__init__): Move common
initialization to superclass.
(Context.set_progress_cb): Hand in 'self'.
* lang/python/pyme/util.py (GpgmeWrapper.__init__): New function.
(GpgmeWrapper.__getattr__): Raise stashed exceptions.
* lang/python/tests/Makefile.am (py_tests): Add new test.
* lang/python/tests/t-callbacks.py: New file.

Signed-off-by: Justus Winter <justus@gnupg.org>
3 years agoQt: Check for graphviz and set HAVE_DOT correctly
Andre Heinecke [Thu, 19 May 2016 09:14:24 +0000 (11:14 +0200)]
Qt: Check for graphviz and set HAVE_DOT correctly

* configure.ac: Check for graphviz and define HAVE_DOT.
* lang/qt/doc/Doxyfile.in (HAVE_DOT): Use variable.

3 years agopython: Add more tests.
Justus Winter [Wed, 18 May 2016 13:33:36 +0000 (15:33 +0200)]
python: Add more tests.

* lang/python/tests/Makefile.am (py_tests): Add new tests.
* lang/python/tests/support.py (print_data): New function.
* lang/python/tests/t-decrypt.py: Use new function.
* lang/python/tests/t-encrypt.py: Likewise.
* lang/python/tests/t-sign.py: New file.
* lang/python/tests/t-encrypt-sym.py: Likewise.

Signed-off-by: Justus Winter <justus@gnupg.org>
3 years agopython: More type conversion fixes.
Justus Winter [Thu, 19 May 2016 08:55:34 +0000 (10:55 +0200)]
python: More type conversion fixes.

* lang/python/helpers.c (pyPassphraseCb): Cope with 'uid_hint' being
NULL, convert it to an Unicode object, and cope with the callback
returning both Unicode and bytes objects.

Signed-off-by: Justus Winter <justus@gnupg.org>
3 years agopython: Fix import.
Justus Winter [Thu, 19 May 2016 08:49:43 +0000 (10:49 +0200)]
python: Fix import.

* lang/python/helpers.c (pygpgme_exception_init): Make module import
relative.

Signed-off-by: Justus Winter <justus@gnupg.org>
3 years agoQt: Fix compilation of unit tests
Andre Heinecke [Thu, 19 May 2016 08:56:49 +0000 (10:56 +0200)]
Qt: Fix compilation of unit tests

* lang/qt/tests/Makefile.am (AM_CPPFLAGS): Add -DBUILDING_QGPGME.

--
Without building QGpgME the headers of gpgme++ are not included
corretly and taken from an already installed gpgme++.

3 years agopython: Various fixes.
Justus Winter [Wed, 18 May 2016 11:17:59 +0000 (13:17 +0200)]
python: Various fixes.

* configure.ac: Fix SWIG detection, bump required Python version.
* lang/python/Makefile.am: Portability fix.

Signed-off-by: Justus Winter <justus@gnupg.org>
3 years agoFix typo in compatibility declaration
Andre Heinecke [Wed, 18 May 2016 13:27:32 +0000 (15:27 +0200)]
Fix typo in compatibility declaration

* src/op-support.c (GPG_ERR_SUBKEYS_EXP_REV): Change to
GPG_ERR_SUBKEYS_EXP_OR_REV.

--
This fixes the build with libgpg-error < 1.23

3 years agotests: New maintenance helper run-encrypt.
Werner Koch [Tue, 17 May 2016 17:59:51 +0000 (19:59 +0200)]
tests: New maintenance helper run-encrypt.

* tests/run-encrypt.c: New.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoReturn dedicated error code for all subkeys expired or revoked.
Werner Koch [Tue, 17 May 2016 18:21:01 +0000 (20:21 +0200)]
Return dedicated error code for all subkeys expired or revoked.

* src/gpgme.h.in (GPGME_STATUS_KEY_CONSIDERED): New.
(GPGME_SIGSUM_TOFU_CONFLICT): New.
* src/status-table.c (KEY_CONSIDERED): New.
* src/op-support.c (_gpgme_parse_inv_recp): Add argc KC_FPR and
KC_FLAGS.  Use calloc.  Detect all expired or revoked subkeys.
(_gpgme_parse_key_considered): New.
* src/sign.c (op_data_t): Add fields KC_FPR and KC_FLAGS.
(release_op_data): Free KC_FPR.
(_gpgme_sign_status_handler): Handle STATUS_KEY_CONSIDERED.
* src/encrypt.c (op_data_t): Add fields KC_FPR and KC_FLAGS.
(release_op_data): Free KC_FPR.
(_gpgme_encrypt_status_handler): Handle STATUS_KEY_CONSIDERED.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoQt / Cpp: Port auto_ptr to unique_ptr
Andre Heinecke [Tue, 17 May 2016 15:49:56 +0000 (17:49 +0200)]
Qt / Cpp: Port auto_ptr to unique_ptr

* lang/cpp/src/context.cpp,
lang/cpp/src/context.h,
lang/cpp/src/context_p.h (Context::createForEngine),
(Context::edit, Context::startEditing),
(Context::takeLastEditInteractor, Context::cardEdit),
(Context::startCardEditing, Context::takeLastCardEditInteractor),
(Context::assuanTransact, Context::startAssuanTransaction),
(Context::takeLastAssuanTransaction): Port to unique_ptr.
* lang/qt/src/qgpgmeadduseridjob.cpp,
lang/qt/src/qgpgmechangeexpiryjob.cpp,
lang/qt/src/qgpgmechangeownertrustjob.cpp,
lang/qt/src/qgpgmechangepasswdjob.cpp,
lang/qt/src/qgpgmesignkeyjob.cpp: Update accordingly.

--
This is another API break but as we already broke API with GpgME++
and QGpgME from KDE Frameworks this is a good time to do this
to avoid using a deprected C++ class in the API.

3 years agopython: Delete duplicated license texts/
Werner Koch [Tue, 17 May 2016 14:57:11 +0000 (16:57 +0200)]
python: Delete duplicated license texts/

--

3 years agobuild: Add python autoconf macro.
Justus Winter [Tue, 17 May 2016 14:34:39 +0000 (16:34 +0200)]
build: Add python autoconf macro.

* m4/ax_python_devel.m4: New file.

Signed-off-by: Justus Winter <justus@gnupg.org>
3 years agoMerge branch 'master' of git+ssh://playfair.gnupg.org/git/gpgme
Justus Winter [Tue, 17 May 2016 13:13:46 +0000 (15:13 +0200)]
Merge branch 'master' of git+ssh://playfair.gnupg.org/git/gpgme

3 years agoMerge branch 'justus/pyme3'
Justus Winter [Tue, 17 May 2016 13:10:28 +0000 (15:10 +0200)]
Merge branch 'justus/pyme3'

3 years agoTrailing white space cleanup for 2 files in tests/.
Werner Koch [Tue, 17 May 2016 12:33:49 +0000 (14:33 +0200)]
Trailing white space cleanup for 2 files in tests/.

--

3 years agopython: Clean up examples.
Justus Winter [Tue, 17 May 2016 12:15:21 +0000 (14:15 +0200)]
python: Clean up examples.

* lang/python/examples/delkey.py: Clean up example.
* lang/python/examples/encrypt-to-all.py: Likewise.
* lang/python/examples/genkey.py: Likewise.
* lang/python/examples/inter-edit.py: Likewise.
* lang/python/examples/sign.py: Likewise.
* lang/python/examples/signverify.py: Likewise.
* lang/python/examples/simple.py: Likewise.
* lang/python/examples/t-edit.py: Likewise.
* lang/python/examples/verifydetails.py: Likewise.
* lang/python/pyme/__init__.py: Likewise.

Signed-off-by: Justus Winter <justus@gnupg.org>
3 years agopython: Import GPGMEError.
Justus Winter [Tue, 17 May 2016 12:14:25 +0000 (14:14 +0200)]
python: Import GPGMEError.

* pyme/core.py: Import GPGMEError.

Fixes c5d118b2.

Signed-off-by: Justus Winter <justus@gnupg.org>
3 years agopython: Port more tests.
Justus Winter [Tue, 17 May 2016 11:46:44 +0000 (13:46 +0200)]
python: Port more tests.

* lang/python/Makefile.am: Add bits from the c test suite.
* lang/python/support.py: New file.
* lang/python/t-decrypt.py: Likewise.
* lang/python/t-encrypt.py: Likewise.

Signed-off-by: Justus Winter <justus@gnupg.org>
3 years agoQt: Add keyLocateJob and test for it
Andre Heinecke [Fri, 13 May 2016 11:16:12 +0000 (13:16 +0200)]
Qt: Add keyLocateJob and test for it

* configure.ac (LIBQGPGME_LT_REVISION): Bump.
* lang/qt/src/protocol.h (locateKeysJob): Add Job.
* lang/qt/src/protocol_p.h (locateKeysJob): Implement.
* lang/qt/tests/Makefile.am: Add t-keylocate.
* lang/qt/tests/t-keylocate.cpp: New.

3 years agoQt: Add missing copyright header in test
Andre Heinecke [Fri, 13 May 2016 10:52:52 +0000 (12:52 +0200)]
Qt: Add missing copyright header in test

* lang/qt/tests/t-keylist.cpp: Add copyright header.

3 years agopython: Share generated methods between objects. justus/pyme3
Justus Winter [Thu, 12 May 2016 16:29:04 +0000 (18:29 +0200)]
python: Share generated methods between objects.

* lang/python/pyme/util.py (GpgmeWrapper.__getattr__): Monkey-patch
the class.
* lang/python/tests/t-wrapper.py: Demonstrate the sharing.

Signed-off-by: Justus Winter <justus@gnupg.org>
3 years agopython: Raise exceptions on write errors.
Justus Winter [Thu, 12 May 2016 16:00:16 +0000 (18:00 +0200)]
python: Raise exceptions on write errors.

* lang/python/pyme/core.py (Data.write): Handle errors.
* lang/python/pyme/errors.py (GPGMEError.fromSyserror): New function.

Signed-off-by: Justus Winter <justus@gnupg.org>
3 years agopython: Fix writing to data buffers.
Justus Winter [Thu, 12 May 2016 15:44:54 +0000 (17:44 +0200)]
python: Fix writing to data buffers.

* lang/python/gpgme.i: Add typemap for buffers.
* lang/python/pyme/core.py (Data.write): Fix function.
* lang/python/tests/Makefile.am: Add new test.
* lang/python/tests/t-data.py: New file.

Signed-off-by: Justus Winter <justus@gnupg.org>
3 years agopython: Add a test suite.
Justus Winter [Thu, 12 May 2016 13:27:50 +0000 (15:27 +0200)]
python: Add a test suite.

* configure.ac: Add new Makefile.
* lang/python/Makefile.am: Add subdirectory.
* lang/python/tests/Makefile.am: New file.
* lang/python/tests/t-wrapper.py: Likewise.

Signed-off-by: Justus Winter <justus@gnupg.org>
3 years agopython: Cache generated wrapper functions.
Justus Winter [Thu, 12 May 2016 12:57:42 +0000 (14:57 +0200)]
python: Cache generated wrapper functions.

* lang/python/util.py (GpgmeWrap.__getattr__): Cache generated wrapper
functions.

Signed-off-by: Justus Winter <justus@gnupg.org>
3 years agopython: Fix function invocation.
Justus Winter [Thu, 12 May 2016 10:54:15 +0000 (12:54 +0200)]
python: Fix function invocation.

* lang/python/pyme/core.py (Data.new_from_fd): Fix function
invocation.

Signed-off-by: Justus Winter <justus@gnupg.org>
3 years agopython: Fix name of exception, make slot methods explicit.
Justus Winter [Thu, 12 May 2016 10:51:30 +0000 (12:51 +0200)]
python: Fix name of exception, make slot methods explicit.

* lang/python/pyme/util.py (GpgmeWrapper._getctype): Fix exception,
add docstring.
(GpgmeWrapper._getnameprepend): New function.
(GpgmeWrapper._errorcheck): Likewise.

Signed-off-by: Justus Winter <justus@gnupg.org>
3 years agopython: Handle interpreter shutdown.
Justus Winter [Thu, 12 May 2016 09:53:43 +0000 (11:53 +0200)]
python: Handle interpreter shutdown.

* lang/python/pyme/core.py: Avoid races at interpreter shutdown.  This
silences the most annoying occurrences, however this problem also
affects the SWIG generated code, which might indicate that the real
problem is somewhere else.  If so, this change can be easily reverted.

Signed-off-by: Justus Winter <justus@gnupg.org>
3 years agopython: Make test case more robust.
Justus Winter [Thu, 12 May 2016 09:51:21 +0000 (11:51 +0200)]
python: Make test case more robust.

* lang/python/examples/t-edit.py: Check if key is found.

Signed-off-by: Justus Winter <justus@gnupg.org>
3 years agopython: Fix type translation.
Justus Winter [Thu, 12 May 2016 09:21:58 +0000 (11:21 +0200)]
python: Fix type translation.

* lang/python/gpgme.i: Adjust to Python3's string type being
'Unicode', not 'bytes'.  Fix type checking.
* lang/python/core.py (Data.write): Add docstring mentioning the
expected type of parameter 'buffer'.
(Data.read): Adjust read loop.  Also, use a saner chunk size, and join
all chunks at the end instead of adding them.
* lang/python/examples/simple.py: Adjust example.

Signed-off-by: Justus Winter <justus@gnupg.org>
3 years agoCpp: Ensure gpgme.h is taken from current build
Andre Heinecke [Wed, 11 May 2016 12:56:20 +0000 (14:56 +0200)]
Cpp: Ensure gpgme.h is taken from current build

* lang/cpp/src/Makefile.am (AM_CPPFLAGS): Add gpgme.h location.
--
This fixes the build in case an incompatible gpgme.h is also
installed in other include locations.

3 years agopython: Fix simple example.
Justus Winter [Wed, 11 May 2016 11:51:40 +0000 (13:51 +0200)]
python: Fix simple example.

* lang/python/examples/simple.py: Flush stdout, encode name as
UTF-8 before passing it to GPGME.

Signed-off-by: Justus Winter <justus@gnupg.org>
3 years agopython: Integrate into the build system.
Justus Winter [Wed, 11 May 2016 09:42:00 +0000 (11:42 +0200)]
python: Integrate into the build system.

* configure.ac: Make Python bindings configurable, add new Makefile.
* lang/python/Makefile.am: New file.
* lang/python/setup.py: Integrate into the build system.
* m4/ax_pkg_swig.m4: New file from the autoconf archive.
* m4/m4_ax_swig_python.m4: Likewise.

Signed-off-by: Justus Winter <justus@gnupg.org>
3 years agoMerge branch 'gpgmepp'
Andre Heinecke [Tue, 10 May 2016 14:43:36 +0000 (16:43 +0200)]
Merge branch 'gpgmepp'

3 years agoQt / Cpp: Fix make dist gpgmepp
Andre Heinecke [Tue, 10 May 2016 13:05:11 +0000 (15:05 +0200)]
Qt / Cpp: Fix make dist

* lang/cpp/src/Makefile.am (EXTRA_DIST): Fix typo.
(private_gpgmepp_headers): New. Private headers.
(libgpgmepp_la_SOURCES): Add private headers.
* lang/qt/src/Makefile.am (t_keylist_SOURCES): Remove non existent
header.

3 years agopython: PEP8 fixes.
Justus Winter [Tue, 10 May 2016 12:45:44 +0000 (14:45 +0200)]
python: PEP8 fixes.

Cherry picked from 0267c151.

Signed-off-by: Justus Winter <justus@gnupg.org>
3 years agoQt: Fix unkonwn doxygen keyword warnings
Andre Heinecke [Tue, 10 May 2016 12:32:22 +0000 (14:32 +0200)]
Qt: Fix unkonwn doxygen keyword warnings

--
Reimp is not a keqword and we inherit documentation anyway.

3 years agoQt: Make Protocol class public API
Andre Heinecke [Tue, 10 May 2016 12:05:10 +0000 (14:05 +0200)]
Qt: Make Protocol class public API

* lang/qt/src/Makefile.am (qgpgme_headers): Add protocol.h
(private_qgpgme_headers): Add protocol_p.h
* lang/qt/src/protocol.h: New. From QGpgMEBackend.
* lang/qt/src/protocol_p.h: New. From QGpgMEBackend.
* lang/qt/src/qgpgmebackend.h,
lang/qt/src/qgpgmebackend.cpp (Protocol): Removed.

--
The backend class does not make much sense anymore as we
only have the GpgME backend obviously. It's purpose was
for Libkleo's Backend abstraction.

3 years agoQt: Make doxygen quieter
Andre Heinecke [Tue, 10 May 2016 10:52:43 +0000 (12:52 +0200)]
Qt: Make doxygen quieter

* lang/qt/doc/Doxyfile.in: Quiet and no undocumented warnings.

3 years agoQt: Only install public headers
Andre Heinecke [Tue, 10 May 2016 10:47:53 +0000 (12:47 +0200)]
Qt: Only install public headers

* lang/qt/src/Makefile.am: Do not install all headers.
--
The qgpgme classes hide the implementation and thus make it
easier to change it without ABI breaks. They should not
be installed.

3 years agopython: Delete trailing whitespace.
Justus Winter [Tue, 10 May 2016 11:30:30 +0000 (13:30 +0200)]
python: Delete trailing whitespace.

--
Signed-off-by: Justus Winter <justus@gnupg.org>
3 years agopython: Drop Debian packaging.
Justus Winter [Tue, 10 May 2016 11:21:34 +0000 (13:21 +0200)]
python: Drop Debian packaging.

--
Signed-off-by: Justus Winter <justus@gnupg.org>
3 years agopython: Rename bindings.
Justus Winter [Tue, 10 May 2016 11:19:26 +0000 (13:19 +0200)]
python: Rename bindings.

--
Signed-off-by: Justus Winter <justus@gnupg.org>
3 years agoMerge branch 'master' into justus/pyme3
Justus Winter [Tue, 10 May 2016 11:03:34 +0000 (13:03 +0200)]
Merge branch 'master' into justus/pyme3

3 years agoQt: Add test for async keylisting
Andre Heinecke [Fri, 6 May 2016 14:33:49 +0000 (16:33 +0200)]
Qt: Add test for async keylisting

* src/lang/qt/tests/t-keylist.cpp(KeyListTest::testKeyListAsync): New.

3 years agoAllow cc to detect missing cases in a switch.
Werner Koch [Tue, 10 May 2016 08:27:54 +0000 (10:27 +0200)]
Allow cc to detect missing cases in a switch.

* src/delete.c (delete_status_handler): Remove default case from a
switch so that cc can check the use of all enum values.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoUse common error message style for qt lang checks
Andre Heinecke [Fri, 6 May 2016 12:47:24 +0000 (14:47 +0200)]
Use common error message style for qt lang checks

* configure.ac: Use common error highliting for qt lang options.

3 years agoQt: Fix license mentioned in README
Andre Heinecke [Fri, 6 May 2016 12:41:22 +0000 (14:41 +0200)]
Qt: Fix license mentioned in README

* lang/qt/README: License is GPLv2+ and not LGPL.
--
The only part under lgpl is the QByteArray dataprovider.

3 years agoQt: Fix library name in Copyright headers
Andre Heinecke [Fri, 6 May 2016 12:20:45 +0000 (14:20 +0200)]
Qt: Fix library name in Copyright headers

--
Files are not part of libkleopatra anymore.

3 years agoAdd maybe mode for langs and default to it
Andre Heinecke [Fri, 6 May 2016 12:17:15 +0000 (14:17 +0200)]
Add maybe mode for langs and default to it

* configure.ac (languages): Warn and disable langs for which
requirements are not met.

--
If the languages are explicitly enabled on the command line
missing dependencies for them will still lead to errors.

3 years agoCpp: Handle PINENTRY_LAUNCHED status line
Andre Heinecke [Fri, 6 May 2016 11:19:18 +0000 (13:19 +0200)]
Cpp: Handle PINENTRY_LAUNCHED status line

* lang/cpp/src/editinteractor.cpp (EditInteractor::needsNoResponse):
Add GPGME_STATUS_PINENTRY_LAUNCHED.

--
PINENTRY_LAUNCHED needs no response in any Job. This fixes
Jobs which errored out on unknown status lines.

3 years agoCpp: Add support for pubkey_algo_name
Andre Heinecke [Tue, 12 Apr 2016 14:08:10 +0000 (16:08 +0200)]
Cpp: Add support for pubkey_algo_name

* lang/cpp/src/key.cpp (Subkey::algoName): New.
* lang/cpp/src/key.h: Declare.

3 years agoCpp: Add support for gpgme_data_identify
Andre Heinecke [Tue, 12 Apr 2016 14:05:31 +0000 (16:05 +0200)]
Cpp: Add support for gpgme_data_identify

* lang/cpp/src/data.cpp (Data::type): New.
* lang/cpp/src/data.h (Data::Type): New enum mapping.

3 years agoFix configuration without Qt language
Andre Heinecke [Tue, 12 Apr 2016 07:42:36 +0000 (09:42 +0200)]
Fix configuration without Qt language

* configure.ac: Define HAVE_DOXYGEN also if qt should not be built.

3 years agoQt/Cpp: Bump so version to 6.
Andre Heinecke [Mon, 11 Apr 2016 16:21:26 +0000 (18:21 +0200)]
Qt/Cpp: Bump so version to 6.

* configure.ac (LIBGPGMEPP_LT_CURRENT, LIBQGPGME_LT_CURRENT): Bump.

--
While the KDE Frameworks versions had a different name increasing
the number avoids a conflict with KDE4 versions and is generally
more consistent.

3 years agoQt / Cpp: Mention coding style in READMES
Andre Heinecke [Mon, 11 Apr 2016 16:16:05 +0000 (18:16 +0200)]
Qt / Cpp: Mention coding style in READMES

* src/lang/cpp/README, src/lang/qt/README: Add hacking note.

3 years agoQt: Add doc generation with doxygen
Andre Heinecke [Mon, 11 Apr 2016 16:10:54 +0000 (18:10 +0200)]
Qt: Add doc generation with doxygen

* configure.ac: Look for doxygen if qt is built.
 Configure new files.
* lang/qt/doc/Doxyfile.in: New.
* lang/qt/doc/Makefile.am: New.
* lang/qt/README: Update.

--
Currently this is a standard doxyfile template without much
customization.

3 years agoQt: Fix unit test by adding initial.test dep
Andre Heinecke [Mon, 11 Apr 2016 15:46:03 +0000 (17:46 +0200)]
Qt: Fix unit test by adding initial.test dep

* lang/qt/tests/t-keylist.cpp: Verify that GNUPGHOME is set.
* lang/qt/tests/initial.test: New dummy test.
* lang/qt/tests/Makefile.am: Add dependency to initial.test

--
Feels weird but this follows the pattern in tests/gpg/Makefile.am
and solves the problem that the environment is dirty.

3 years agoQt: Remove remaining boost usage
Andre Heinecke [Mon, 11 Apr 2016 15:15:16 +0000 (17:15 +0200)]
Qt: Remove remaining boost usage

* lang/qt/src/dataprovider.h,
 lang/qt/src/decryptjob.h,
 lang/qt/src/decryptverifyjob.h,
 lang/qt/src/encryptjob.h,
 lang/qt/src/qgpgmeadduseridjob.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/qgpgmekeygenerationjob.cpp,
 lang/qt/src/qgpgmekeylistjob.cpp,
 lang/qt/src/qgpgmenewcryptoconfig.cpp,
 lang/qt/src/qgpgmenewcryptoconfig.h,
 lang/qt/src/qgpgmesignencryptjob.cpp,
 lang/qt/src/qgpgmesignjob.cpp,
 lang/qt/src/qgpgmesignkeyjob.cpp,
 lang/qt/src/qgpgmeverifydetachedjob.cpp,
 lang/qt/src/qgpgmeverifyopaquejob.cpp,
 lang/qt/src/signencryptjob.h,
 lang/qt/src/signjob.h,
 lang/qt/src/threadedjobmixin.cpp,
 lang/qt/src/threadedjobmixin.h,
 lang/qt/src/verifydetachedjob.h,
 lang/qt/src/verifyopaquejob.h: Remove boost usage.

--
Mostly done with search and replace.

3 years agoQt: Remove predicates.h and stl_util.h
Andre Heinecke [Mon, 11 Apr 2016 15:12:56 +0000 (17:12 +0200)]
Qt: Remove predicates.h and stl_util.h

* src/lang/qt/predicates.h, src/lang/qt/stl_util.h: Removed.

--
The magic is still better placed in libkleo.

3 years agoQt: Remove usage of stl_util.h and predicates.h
Andre Heinecke [Mon, 11 Apr 2016 15:06:35 +0000 (17:06 +0200)]
Qt: Remove usage of stl_util.h and predicates.h

* src/lang/qt/qgpgmelistallkeysjob.cpp: Use comperators from
  gpgmepp instead of detail. Remove boost usage.

3 years agoCpp: Add string comparators for keys
Andre Heinecke [Mon, 11 Apr 2016 15:02:04 +0000 (17:02 +0200)]
Cpp: Add string comparators for keys

* lang/cpp/src/global.h (GPGMEPP_MAKE_STRCMP): New.
  (_gpgmepp_strcmp): NULL save wrapper around std::strcmp.
* lang/cpp/src/key.h: Add comparators for various attributes.

--
This was taken from libkleo predicates.h. Appears generally useful.

3 years agoCpp: Remove last usages of boost
Andre Heinecke [Mon, 11 Apr 2016 13:50:17 +0000 (15:50 +0200)]
Cpp: Remove last usages of boost

* lang/cpp/src/configuration.cpp: Use std::remove_pointer.
  (Configuration::operator<<): std::for_each.
* lang/cpp/src/context.cpp: Delete manually instead of scoped ptr.
* lang/cpp/src/scdgetinfoassuantransaction.cpp: Use static_assert.
  (to_reader_list): Tokenize with getline.

3 years agoAdd pthread in gpgmepp config
Andre Heinecke [Tue, 8 Mar 2016 17:05:34 +0000 (18:05 +0100)]
Add pthread in gpgmepp config

* lang/cpp/src/GpgmeppConfig.cmake.in.in: Add pthread.

3 years agoCpp / Qt: Reduce boost usage (memory and tuple)
Andre Heinecke [Sun, 3 Apr 2016 12:52:16 +0000 (04:52 -0800)]
Cpp / Qt: Reduce boost usage (memory and tuple)

* cpp/src/assuanresult.h,
 cpp/src/configuration.cpp,
 cpp/src/configuration.h,
 cpp/src/data.h,
 cpp/src/decryptionresult.h,
 cpp/src/defaultassuantransaction.cpp,
 cpp/src/encryptionresult.cpp,
 cpp/src/encryptionresult.h,
 cpp/src/engineinfo.h,
 cpp/src/gpgagentgetinfoassuantransaction.cpp,
 cpp/src/gpgsignkeyeditinteractor.cpp,
 cpp/src/importresult.cpp,
 cpp/src/importresult.h,
 cpp/src/key.h,
 cpp/src/keygenerationresult.h,
 cpp/src/keylistresult.h,
 cpp/src/notation.h,
 cpp/src/signingresult.cpp,
 cpp/src/signingresult.h,
 cpp/src/verificationresult.cpp,
 cpp/src/verificationresult.h,
 cpp/src/vfsmountresult.h,
 qt/src/dataprovider.cpp,
 qt/src/dataprovider.h,
 qt/src/decryptjob.h,
 qt/src/decryptverifyjob.h,
 qt/src/downloadjob.h,
 qt/src/encryptjob.h,
 qt/src/qgpgmeadduseridjob.cpp,
 qt/src/qgpgmechangeexpiryjob.cpp,
 qt/src/qgpgmechangeownertrustjob.cpp,
 qt/src/qgpgmechangepasswdjob.cpp,
 qt/src/qgpgmedecryptjob.cpp,
 qt/src/qgpgmedecryptjob.h,
 qt/src/qgpgmedecryptverifyjob.cpp,
 qt/src/qgpgmedecryptverifyjob.h,
 qt/src/qgpgmedeletejob.cpp,
 qt/src/qgpgmedownloadjob.cpp,
 qt/src/qgpgmedownloadjob.h,
 qt/src/qgpgmeencryptjob.cpp,
 qt/src/qgpgmeencryptjob.h,
 qt/src/qgpgmeexportjob.cpp,
 qt/src/qgpgmeexportjob.h,
 qt/src/qgpgmeimportfromkeyserverjob.cpp,
 qt/src/qgpgmeimportfromkeyserverjob.h,
 qt/src/qgpgmeimportjob.cpp,
 qt/src/qgpgmeimportjob.h,
 qt/src/qgpgmekeygenerationjob.cpp,
 qt/src/qgpgmekeygenerationjob.h,
 qt/src/qgpgmekeylistjob.cpp,
 qt/src/qgpgmekeylistjob.h,
 qt/src/qgpgmelistallkeysjob.cpp,
 qt/src/qgpgmelistallkeysjob.h,
 qt/src/qgpgmenewcryptoconfig.cpp,
 qt/src/qgpgmenewcryptoconfig.h,
 qt/src/qgpgmesignencryptjob.cpp,
 qt/src/qgpgmesignencryptjob.h,
 qt/src/qgpgmesignjob.cpp,
 qt/src/qgpgmesignjob.h,
 qt/src/qgpgmesignkeyjob.cpp,
 qt/src/qgpgmeverifydetachedjob.cpp,
 qt/src/qgpgmeverifydetachedjob.h,
 qt/src/qgpgmeverifyopaquejob.cpp,
 qt/src/qgpgmeverifyopaquejob.h,
 qt/src/signencryptjob.h,
 qt/src/signjob.h,
 qt/src/threadedjobmixin.h,
 qt/src/verifydetachedjob.h,
 qt/src/verifyopaquejob.h: Reduce boost usage.

--
This was mostly done with search and replace to change the
templates / classes from memory and tuple to their c++11
equivalents.

3 years agoCpp: Require c++ 11 if cpp binding requested
Andre Heinecke [Sun, 3 Apr 2016 12:46:51 +0000 (04:46 -0800)]
Cpp: Require c++ 11 if cpp binding requested

* configure.ac: Call ax_cxx_compile_stdcxx
* m4/ax_cxx_compile_stdcxx.m4

--
Depending on c++11 is intended to make the port away from
Boost easier.

The m4 macro was taken from the website mentioned in the License
header of the file.

3 years agoQt: Add static factor methods for protocol
Andre Heinecke [Sun, 3 Apr 2016 10:29:14 +0000 (02:29 -0800)]
Qt: Add static factor methods for protocol

* lang/qt/src/qgpgmebackend.cpp (QGpgME::openpgp, QGpgME::smime): New.
* lang/qt/src/qgpgmebackend.h: Declare.
* lang/qt/tests/t-keylist.cpp (KeyListTest::testSingleKeyListSync):
  Use new functions.

--
This replaces the cryptobackendfactory functionality from libkleo.

3 years agoQt: Add a unit test for qgpgme
Andre Heinecke [Sun, 3 Apr 2016 09:48:46 +0000 (01:48 -0800)]
Qt: Add a unit test for qgpgme

* configure.ac: Configure test Makefile.
* m4/qt.m4: Look up Qt5Test flags.
* lang/qt/tests/t-keylist.cpp: New. Simple keylist check.
* lang/qt/tests/Makefile.am: New. General test framework.

--
This test mostly checks that it basically compiles / works and
adds a test framework.

3 years agoQt: Add missing MOC includes
Andre Heinecke [Sun, 3 Apr 2016 09:33:52 +0000 (01:33 -0800)]
Qt: Add missing MOC includes

* qgpgmeadduseridjob.cpp,
 qgpgmechangeexpiryjob.cpp,
 qgpgmechangeownertrustjob.cpp,
 qgpgmechangepasswdjob.cpp,
 qgpgmedecryptjob.cpp,
 qgpgmedecryptverifyjob.cpp,
 qgpgmedeletejob.cpp,
 qgpgmedownloadjob.cpp,
 qgpgmeencryptjob.cpp,
 qgpgmeexportjob.cpp,
 qgpgmeimportfromkeyserverjob.cpp,
 qgpgmeimportjob.cpp,
 qgpgmekeygenerationjob.cpp,
 qgpgmekeylistjob.cpp,
 qgpgmelistallkeysjob.cpp,
 qgpgmerefreshkeysjob.cpp,
 qgpgmesecretkeyexportjob.cpp,
 qgpgmesignencryptjob.cpp,
 qgpgmesignjob.cpp,
 qgpgmesignkeyjob.cpp,
 qgpgmeverifydetachedjob.cpp,
 qgpgmeverifyopaquejob.cpp: Add missing MOC includes.

--
In the CMake world this was handled by cmake automoc
suppport and not neccessary.

3 years agoQt: Declare pure virtuals as such
Andre Heinecke [Sun, 3 Apr 2016 09:30:57 +0000 (01:30 -0800)]
Qt: Declare pure virtuals as such

* lang/qt/src/qgpgmebackend.h (Protocol): Make all functions
 pure virtual.

--
Fixes errors when linking with QGpgME.

3 years agoQt: Don't declare showErrorDialog anymore
Andre Heinecke [Sun, 3 Apr 2016 09:27:58 +0000 (01:27 -0800)]
Qt: Don't declare showErrorDialog anymore

* cpp/qt/src/job.h: Remove showErrorDialog.

--
If additional error handling is neccessary emitting
signals to a gui application would be better API for qgpgme.

3 years agoQt: Only use GpgME based config class
Andre Heinecke [Sun, 3 Apr 2016 09:22:19 +0000 (01:22 -0800)]
Qt: Only use GpgME based config class

* lang/qt/src/qgpgmecryptoconfig.cpp,
 lang/qt/src/qgpgmecryptoconfig.h: Removed.
* lang/qt/src/qgpgmebackend.cpp: Return newcryptoconfig.

--
The GpgME based config class is the way forward and the
old class was using KDE Code. Probably needs some bugfixes
as previously the new class was only used for Windows CE

3 years agoAdd additional include path in config files
Andre Heinecke [Sat, 2 Apr 2016 17:14:10 +0000 (09:14 -0800)]
Add additional include path in config files

* lang/cpp/src/GpgmeppConfig.cmake.in.in
 lang/qt/src/QGpgmeConfig.cmake.in.in: Include directory above headers.

--
This ensures that code using #inlcude <gpgme++/header.h> still works.

3 years agoQt: Fix library name in nodist variable
Andre Heinecke [Sat, 2 Apr 2016 17:12:23 +0000 (09:12 -0800)]
Qt: Fix library name in nodist variable

* lang/qt/Makefile.am (nodist_qgpgme_SOURCES): Change to real name.

3 years agoAdd missing files to QGpgME
Andre Heinecke [Sat, 2 Apr 2016 16:06:45 +0000 (08:06 -0800)]
Add missing files to QGpgME

* lang/qt/src/gpgme_backend_debug.cpp,
 lang/qt/src/gpgme_backend_debug.h,
 lang/qt/src/predicates.h,
 lang/qt/src/stl_util.h: New.

3 years agoAdd QGpgME code from libkleo
Andre Heinecke [Sat, 2 Apr 2016 12:31:59 +0000 (04:31 -0800)]
Add QGpgME code from libkleo

* lang/qt/src/Makefile.am,
lang/qt/src/abstractimportjob.h,
lang/qt/src/adduseridjob.h,
lang/qt/src/changeexpiryjob.h,
lang/qt/src/changeownertrustjob.h,
lang/qt/src/changepasswdjob.h,
lang/qt/src/cryptoconfig.h,
lang/qt/src/decryptjob.h,
lang/qt/src/decryptverifyjob.h,
lang/qt/src/deletejob.h,
lang/qt/src/downloadjob.h,
lang/qt/src/encryptjob.h,
lang/qt/src/exportjob.h,
lang/qt/src/hierarchicalkeylistjob.h,
lang/qt/src/importfromkeyserverjob.h,
lang/qt/src/importjob.h,
lang/qt/src/job.cpp,
lang/qt/src/job.h,
lang/qt/src/keygenerationjob.h,
lang/qt/src/keylistjob.h,
lang/qt/src/listallkeysjob.h,
lang/qt/src/multideletejob.h,
lang/qt/src/qgpgmeadduseridjob.cpp,
lang/qt/src/qgpgmeadduseridjob.h,
lang/qt/src/qgpgmebackend.cpp,
lang/qt/src/qgpgmebackend.h,
lang/qt/src/qgpgmechangeexpiryjob.cpp,
lang/qt/src/qgpgmechangeexpiryjob.h,
lang/qt/src/qgpgmechangeownertrustjob.cpp,
lang/qt/src/qgpgmechangeownertrustjob.h,
lang/qt/src/qgpgmechangepasswdjob.cpp,
lang/qt/src/qgpgmechangepasswdjob.h,
lang/qt/src/qgpgmecryptoconfig.cpp,
lang/qt/src/qgpgmecryptoconfig.h,
lang/qt/src/qgpgmedecryptjob.cpp,
lang/qt/src/qgpgmedecryptjob.h,
lang/qt/src/qgpgmedecryptverifyjob.cpp,
lang/qt/src/qgpgmedecryptverifyjob.h,
lang/qt/src/qgpgmedeletejob.cpp,
lang/qt/src/qgpgmedeletejob.h,
lang/qt/src/qgpgmedownloadjob.cpp,
lang/qt/src/qgpgmedownloadjob.h,
lang/qt/src/qgpgmeencryptjob.cpp,
lang/qt/src/qgpgmeencryptjob.h,
lang/qt/src/qgpgmeexportjob.cpp,
lang/qt/src/qgpgmeexportjob.h,
lang/qt/src/qgpgmeimportfromkeyserverjob.cpp,
lang/qt/src/qgpgmeimportfromkeyserverjob.h,
lang/qt/src/qgpgmeimportjob.cpp,
lang/qt/src/qgpgmeimportjob.h,
lang/qt/src/qgpgmekeygenerationjob.cpp,
lang/qt/src/qgpgmekeygenerationjob.h,
lang/qt/src/qgpgmekeylistjob.cpp,
lang/qt/src/qgpgmekeylistjob.h,
lang/qt/src/qgpgmelistallkeysjob.cpp,
lang/qt/src/qgpgmelistallkeysjob.h,
lang/qt/src/qgpgmenewcryptoconfig.cpp,
lang/qt/src/qgpgmenewcryptoconfig.h,
lang/qt/src/qgpgmerefreshkeysjob.cpp,
lang/qt/src/qgpgmerefreshkeysjob.h,
lang/qt/src/qgpgmesecretkeyexportjob.cpp,
lang/qt/src/qgpgmesecretkeyexportjob.h,
lang/qt/src/qgpgmesignencryptjob.cpp,
lang/qt/src/qgpgmesignencryptjob.h,
lang/qt/src/qgpgmesignjob.cpp,
lang/qt/src/qgpgmesignjob.h,
lang/qt/src/qgpgmesignkeyjob.cpp,
lang/qt/src/qgpgmesignkeyjob.h,
lang/qt/src/qgpgmeverifydetachedjob.cpp,
lang/qt/src/qgpgmeverifydetachedjob.h,
lang/qt/src/qgpgmeverifyopaquejob.cpp,
lang/qt/src/qgpgmeverifyopaquejob.h,
lang/qt/src/refreshkeysjob.h,
lang/qt/src/signencryptjob.h,
lang/qt/src/signjob.h,
lang/qt/src/signkeyjob.h,
lang/qt/src/specialjob.h,
lang/qt/src/threadedjobmixin.cpp,
lang/qt/src/threadedjobmixin.h,
lang/qt/src/verifydetachedjob.h,
lang/qt/src/verifyopaquejob.h: New.
* lang/qt/src/Makefile.am:

--
The ShowErrorMessage calls were removed and are to be replaced
by error signals / error status which the UI should then handle.

This allowed to port away from KMessageBox and KLocalizedstring.

Additionally this removed the old process bases qgpgmeconfigdialog,
and GnuPGProcessBase. Classes using GnuPGProcessbase were changed
to KProcess api.

This is a first compiling version. API is subject to change to
resolve the split between base jobs and qgpgme classes.

3 years agoAdd qgpgme as qt language binding
Andre Heinecke [Tue, 8 Mar 2016 13:33:15 +0000 (14:33 +0100)]
Add qgpgme as qt language binding

* configure.ac: Add version defines. Check for qt if neccessary.
* lang/README: Mention qt
* lang/cpp/src/GpgmeppConfig.cmake.in.in: Remove comment. Find qgpgme.
* lang/qt/src/Makefile.am: New. Build qgpgme.
* lang/qt/README,
 lang/qt/src/Makefile.am,
 lang/qt/src/QGpgmeConfig.cmake.in.in,
 lang/qt/src/QGpgmeConfigVersion.cmake.in,
 lang/qt/src/dataprovider.cpp,
 lang/qt/src/dataprovider.h,
 lang/qt/src/qgpgme_export.h,
 m4/qt.m4: New.
* lang/cpp/src/GpgmeppConfig.cmake.in.in,
 lang/cpp/src/Makefile.am: Fix generated config file.

--
For now this is just the dataprovider which was part of the
KF5 Gpgmepp QGpgme variant. This is very thin but a useful
class which is used downstream.

3 years agoRemove obsolete w32-qt code
Andre Heinecke [Thu, 3 Mar 2016 11:46:53 +0000 (12:46 +0100)]
Remove obsolete w32-qt code

* configure.ac (w32-qt): Remove option and Qt checks.
* src/Makefile.am: Remove BUILD_W32_QT handling.
* src/kdpipeiodevice.cpp,
 src/kdpipeiodevice.h,
 src/kdpipeiodevice.moc,
 src/w32-qt-io.cpp: Removed.

--
This code was intended for Kleopatra but Kleopatra is not using
it anymore. QGpgme/dataprovider is a better replacement for this.

3 years agoAdd version info for gpgmepp
Andre Heinecke [Wed, 2 Mar 2016 17:56:12 +0000 (18:56 +0100)]
Add version info for gpgmepp

* lang/cpp/src/Makefile.am (libgpgmepp_la_LDFLAGS): Add version info.

3 years agoAdd cmake configuration files
Andre Heinecke [Wed, 2 Mar 2016 17:41:42 +0000 (18:41 +0100)]
Add cmake configuration files

* configure.ac: Add libgpgmepp version. Configure cmake files.
* lang/cpp/src/Makefile.am: Add targets for cmake files.
 (EXTRA_DIST): Add cmake files.

--
This should smooth the transition for downstream users that
have worked with KF5::Gpgmepp previously.

3 years agoFix export header and windows export macros
Andre Heinecke [Wed, 2 Mar 2016 15:24:09 +0000 (16:24 +0100)]
Fix export header and windows export macros

* lang/cpp/src/gpgme_export.h: Fix variable name. Add Windows ifdefs.

3 years agoAdd header installation
Andre Heinecke [Wed, 2 Mar 2016 15:22:20 +0000 (16:22 +0100)]
Add header installation

* lang/cpp/src/Makefile.am: Add headers as deps and install them.
 (AM_CPPFLAGS): Add BUILDING_GPGMEPP to be used in export macros.

3 years agoAdd enable-languages build option
Andre Heinecke [Wed, 2 Mar 2016 13:00:48 +0000 (14:00 +0100)]
Add enable-languages build option

* acinclude.m4 (LIST_MEMBER): New macro.
* configure.ac (enable-languages): New option. Add info output.
* lang/Makefile.am: Only add enabled language subdirs.

3 years agoAdd README for gpgmepp
Andre Heinecke [Mon, 22 Feb 2016 18:13:36 +0000 (19:13 +0100)]
Add README for gpgmepp

* lang/README: Note down cpp.
* cpp/README: Add README based on original repo version.

3 years agoAdd buildsystem for Gpgmepp
Andre Heinecke [Mon, 22 Feb 2016 18:09:54 +0000 (19:09 +0100)]
Add buildsystem for Gpgmepp

* configure.ac: Configure Makefiles.
* lang/Makefile.am: Add cpp subdir
* lang/cpp/Makefile.am: New. Add src subdir.
* lang/cpp/src/Makefile.am: New. Basic buildsystem.

3 years agoRemove feature check ifdefs
Andre Heinecke [Mon, 22 Feb 2016 18:07:41 +0000 (19:07 +0100)]
Remove feature check ifdefs

* lang/cpp/src/assuanresult.cpp,
 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/global.h,
 lang/cpp/src/gpgagentgetinfoassuantransaction.cpp,
 lang/cpp/src/importresult.cpp,
 lang/cpp/src/interfaces/assuantransaction.h,
 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/trustitem.cpp,
 lang/cpp/src/util.h,
 lang/cpp/src/verificationresult.cpp,
 lang/cpp/src/vfsmountresult.cpp: Remove feature checks.

3 years agoInitial checkin of gpgmepp sources
Andre Heinecke [Mon, 22 Feb 2016 17:28:08 +0000 (18:28 +0100)]
Initial checkin of gpgmepp sources

Based on git.kde.org/pim/gpgmepp rev. 0e3ebc02

* lang/cpp/src/assuanresult.cpp,
 lang/cpp/src/assuanresult.h,
 lang/cpp/src/callbacks.cpp,
 lang/cpp/src/callbacks.h,
 lang/cpp/src/configuration.cpp,
 lang/cpp/src/configuration.h,
 lang/cpp/src/context.cpp,
 lang/cpp/src/context.h,
 lang/cpp/src/context_glib.cpp,
 lang/cpp/src/context_p.h,
 lang/cpp/src/context_qt.cpp,
 lang/cpp/src/context_vanilla.cpp,
 lang/cpp/src/data.cpp,
 lang/cpp/src/data.h,
 lang/cpp/src/data_p.h,
 lang/cpp/src/decryptionresult.cpp,
 lang/cpp/src/decryptionresult.h,
 lang/cpp/src/defaultassuantransaction.cpp,
 lang/cpp/src/defaultassuantransaction.h,
 lang/cpp/src/editinteractor.cpp,
 lang/cpp/src/editinteractor.h,
 lang/cpp/src/encryptionresult.cpp,
 lang/cpp/src/encryptionresult.h,
 lang/cpp/src/engineinfo.cpp,
 lang/cpp/src/engineinfo.h,
 lang/cpp/src/error.h,
 lang/cpp/src/eventloopinteractor.cpp,
 lang/cpp/src/eventloopinteractor.h,
 lang/cpp/src/exception.cpp,
 lang/cpp/src/exception.h,
 lang/cpp/src/global.h,
 lang/cpp/src/gpgadduserideditinteractor.cpp,
 lang/cpp/src/gpgadduserideditinteractor.h,
 lang/cpp/src/gpgagentgetinfoassuantransaction.cpp,
 lang/cpp/src/gpgagentgetinfoassuantransaction.h,
 lang/cpp/src/gpgmefw.h,
 lang/cpp/src/gpgmepp_export.h,
 lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp,
 lang/cpp/src/gpgsetexpirytimeeditinteractor.h,
 lang/cpp/src/gpgsetownertrusteditinteractor.cpp,
 lang/cpp/src/gpgsetownertrusteditinteractor.h,
 lang/cpp/src/gpgsignkeyeditinteractor.cpp,
 lang/cpp/src/gpgsignkeyeditinteractor.h,
 lang/cpp/src/importresult.cpp,
 lang/cpp/src/importresult.h,
 lang/cpp/src/key.cpp,
 lang/cpp/src/key.h,
 lang/cpp/src/keygenerationresult.cpp,
 lang/cpp/src/keygenerationresult.h,
 lang/cpp/src/keylistresult.cpp,
 lang/cpp/src/keylistresult.h,
 lang/cpp/src/notation.h,
 lang/cpp/src/result.h,
 lang/cpp/src/result_p.h,
 lang/cpp/src/scdgetinfoassuantransaction.cpp,
 lang/cpp/src/scdgetinfoassuantransaction.h,
 lang/cpp/src/signingresult.cpp,
 lang/cpp/src/signingresult.h,
 lang/cpp/src/trustitem.cpp,
 lang/cpp/src/trustitem.h,
 lang/cpp/src/util.h,
 lang/cpp/src/verificationresult.cpp,
 lang/cpp/src/verificationresult.h,
 lang/cpp/src/vfsmountresult.cpp,
 lang/cpp/src/vfsmountresult.h,
 lang/cpp/src/interfaces/assuantransaction.h,
 lang/cpp/src/interfaces/dataprovider.h,
 lang/cpp/src/interfaces/passphraseprovider.h,
 lang/cpp/src/interfaces/progressprovider.h: New.

3 years agoFix possible _SC_OPEN_MAX max problem on AIX.
Werner Koch [Fri, 15 Jan 2016 15:16:38 +0000 (16:16 +0100)]
Fix possible _SC_OPEN_MAX max problem on AIX.

* src/posix-io.c [HAVE_STDINT_H]: Include stdint.h.
(get_max_fds): Limit returned value for too high values.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agow32: Avoid conflict with Mingw-w64 version 4.0.4-1
Werner Koch [Wed, 9 Dec 2015 10:39:26 +0000 (11:39 +0100)]
w32: Avoid conflict with Mingw-w64 version 4.0.4-1

* src/w32-util.c (mkstemp): Rename to my_mkstemp.  Change caller.
--

For some reason the linker seems to use the mkstemp now provided by
mingw instead of our static symbol.  Strange.

Reported-by: Andrej Kacian <andrej@kacian.sk>
Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoReturn on user cancellation of delete operation
Daiki Ueno [Mon, 9 Nov 2015 04:13:50 +0000 (13:13 +0900)]
Return on user cancellation of delete operation

* src/delete.c (delete_status_handler): Return on ERROR status, if the
error location is set to "delete_key.secret" and the code is either
CANCELED or FULLY_CANCELED, which indicates a situation that the user
selected "No" on the confirmation dialog.