From d5b5c33a0cb3fbe02d011a14f2028249220b0656 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Nicole?= Date: Fri, 9 Mar 2018 13:32:10 +0100 Subject: Automatic key import / export + Expected monad Summary: There are many things going on here (perhaps a bit much for a single patch): - When an attachment is of mime type "application/pgp-keys", a button is added to import the key to GPG - When sending a mail and crypto is enabled (encryption, signing or both), the public key of the first private key found is sent as an un-encrypted attachment (T6994) - The `mailcrypto.{h,cpp}` was, for the most part, rewritten - Introduction of the expected monad, inspired by what was proposed for C++ [here](https://isocpp.org/files/papers/n4015.pdf), but not at all a strict implementation of this specification. We may want to add some more features of this standard later. The rationale for some of the choices: - I found mailcrypto a bit hard to edit to add new features, and a great part was commented code to prepare for the support the SMIME crypto format, which would (in my current knowledge) not be used for sending emails. - One thing I found that may be missing in the code base was a standardized way of handling errors in C++ code. Since exceptions are disabled I think that the functional way is the way to go. After some research I found the Expected monad / tagged union / sum type, which seemed to suit the problem particularly well. In the long run, I hope we would move the entire code base to use `Expected` to indicate if a function might fail. Of course every choice made here is to be considered as a proposition for doing things / RFC, critics wholeheartedly accepted. Reviewers: cmollekopf Tags: #kube Maniphest Tasks: T6994, T8147, T6995 Differential Revision: https://phabricator.kde.org/D11158 --- .../icons/actions/22/view-certificate-import-inverted.svg | 14 ++++++++++++++ icons/breeze/icons/actions/22/view-certificate-import.svg | 14 ++++++++++++++ .../icons/actions/24/view-certificate-import-inverted.svg | 13 +++++++++++++ icons/breeze/icons/actions/24/view-certificate-import.svg | 13 +++++++++++++ icons/copybreeze.sh | 1 + 5 files changed, 55 insertions(+) create mode 100644 icons/breeze/icons/actions/22/view-certificate-import-inverted.svg create mode 100644 icons/breeze/icons/actions/22/view-certificate-import.svg create mode 100644 icons/breeze/icons/actions/24/view-certificate-import-inverted.svg create mode 100644 icons/breeze/icons/actions/24/view-certificate-import.svg (limited to 'icons') diff --git a/icons/breeze/icons/actions/22/view-certificate-import-inverted.svg b/icons/breeze/icons/actions/22/view-certificate-import-inverted.svg new file mode 100644 index 00000000..ff539ffc --- /dev/null +++ b/icons/breeze/icons/actions/22/view-certificate-import-inverted.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/icons/breeze/icons/actions/22/view-certificate-import.svg b/icons/breeze/icons/actions/22/view-certificate-import.svg new file mode 100644 index 00000000..ec5250cc --- /dev/null +++ b/icons/breeze/icons/actions/22/view-certificate-import.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/icons/breeze/icons/actions/24/view-certificate-import-inverted.svg b/icons/breeze/icons/actions/24/view-certificate-import-inverted.svg new file mode 100644 index 00000000..e0691d6d --- /dev/null +++ b/icons/breeze/icons/actions/24/view-certificate-import-inverted.svg @@ -0,0 +1,13 @@ + + + + + + diff --git a/icons/breeze/icons/actions/24/view-certificate-import.svg b/icons/breeze/icons/actions/24/view-certificate-import.svg new file mode 100644 index 00000000..f82c65b3 --- /dev/null +++ b/icons/breeze/icons/actions/24/view-certificate-import.svg @@ -0,0 +1,13 @@ + + + + + + diff --git a/icons/copybreeze.sh b/icons/copybreeze.sh index b7c85229..5697b4b6 100755 --- a/icons/copybreeze.sh +++ b/icons/copybreeze.sh @@ -13,6 +13,7 @@ wantedIcons = [ "document-decrypt.svg", "document-edit.svg", "document-encrypt.svg", + "view-certificate-import.svg", "document-save.svg", "document-sign.svg", "edit-delete.svg", -- cgit v1.2.3