Kleo/Dn and kube
Closed, ResolvedPublic

Description

currently mimetreeparser still needs libkleo to compile, because it is using Kleo/Dn to show SMIME niceley.
But this code also pulls in widget code [#include "ui/dnattributeorderconfigwidget.h"] (Kleo::DNAttributeMapper::instance()->attributeOrder())

  • Are there any plans to split the logic and widgets?
  • But still libkleo would pull in all widgets dependencies, so the logic has to move somewhere else afterwards maybe to QGpgme?

I have in mind a BaseFactory approch, to have a BaseFactory, that don't depend on widgets and a ChildFactory that includes the widgets, like i have done MimeTreeParser::BodyPartFormatterBaseFactory

knauss created this task.Nov 1 2016, 4:01 PM
knauss moved this task from Backlog to Milestone: Basic Mail Client on the Kube board.

I think the simple solution would be:

  • Move Kleo::DN into QGpgME
  • Add a Kleo::DN setAttributeOrder(const QStringList&)

So that if you want to use the attribute order configured in libkleo you would need to do

QGpgME::DN dn(x);
dn.setAttributeOrder (Kleo::DNAttributeMapper::instance()->attributeOrder());

Otherwise it would just use a default.

Yes this will mean that messagelib will always use the default attribute order if you don't pull in libkleo. But since the Attribute order is not configurable in KMail afaik this is an exotic feature. You could alternatively read libkleo's config and then set the attributeOrder accordingly if that config should be respected.

Without really knowing what Kleo::DN is; I like the approach aheinecke proposed. For Kube we don't care about kleopatras attribute order setting, and if we did we could easily apply it.
Being able to simply configure the library as a user of it is the right approach IMO.

To avoid having this on the stack and getting pushed down I just did it:

https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gpgme.git;a=commit;h=627c5deed84b4481710b6c0de06b26e886679bbe

I have an according patch for libkleo that I'll attach as differential. I don't want to commit this now to avoid depending on an unreleased QGpgME.

aheinecke claimed this task.Nov 1 2016, 5:43 PM

libkleo patch as attachment.

Clamining this issue so I do not to forget the removal in libkleo.

knauss added a comment.Nov 1 2016, 6:50 PM

I like the approch, too. I also think it is not very obvious for any user, that you can change a setting in kleopatra that will affect kmail. But don't find this setting in kmail settings. We will see if anyone complains, about this missing feature.

Are there any releasetime for QGpgMe 1.7.2?

After release and before applying your patch to libkleo we also need to update:

  • messagelib
  • kleopatra

too to use QGpgME::DN.

@cmollekopf DN(distinguished name) is a smime certificate field (e.g., "CN=CA1,ST=BC,c=CA") and this name can be very long, that's why you whant to shorten this to the important ones. This is done via DN(uid).prettyDN() and what fields are seleted in the prettyDN was bundled with kleo widget code.

In T4230#63020, @knauss wrote:

I like the approch, too. I also think it is not very obvious for any user, that you can change a setting in kleopatra that will affect kmail. But don't find this setting in kmail settings. We will see if anyone complains, about this missing feature.

Are there any releasetime for QGpgMe 1.7.2?

Will happen pretty soon, mostly because of the pyme name change which we want to get into stretch and the deadline there is middle of november., too. So I expect it within the next two weeks.

After release and before applying your patch to libkleo we also need to update:

  • messagelib
  • kleopatra too to use QGpgME::DN.

Yes. I'll handle Kleo and I guess you'll handle messagelib. But I would like to do this only after:

  • GpgME 1.7.2 is released
  • Applications 16.12 are branched off.

I guess for Kube it's not important that this is part of messagelib from Applications 16.12 so I'd rather avoid bumping the dependency even if GpgME is released shortly before the dependency freeze.

@cmollekopf DN(distinguished name) is a smime certificate field (e.g., "CN=CA1,ST=BC,c=CA") and this name can be very long, that's why you whant to shorten this to the important ones. This is done via DN(uid).prettyDN() and what fields are seleted in the prettyDN was bundled with kleo widget code.

It's also a general DN parser, DN's have their own RFC with escaping / quoting rules etc. general horribleness of S/MIME related standards.

knauss added a comment.Nov 1 2016, 7:18 PM

well the problem is that we want to release kube starting next year and we need messagelib for kube.
That's why I want messagelib ready with KDE/Applications 16.12.
But I can create a #ifdef to support boths versions. It is only one place where we use it, so not that much clutter.

And I agree with you that we should not rush things.

knauss added a comment.Nov 2 2016, 3:23 PM

patch for messagelib to only use QGpgme if version of gpgme >= 1.7.2

knauss added a comment.Nov 7 2016, 9:33 PM

the patch is already applied to the "kube" branch of messagelib:
http://commits.kde.org/clones/messagelib/knauss/libotp/0a1801bb01599acce55a4d97e1fa65129075048a

(git clone kde:clones/messagelib/knauss/libotp.git)

knauss moved this task from In Progress to Done on the Kube board.Nov 7 2016, 9:35 PM
cmollekopf moved this task from Done to Backlog on the Kube board.Nov 8 2016, 3:47 PM
cmollekopf moved this task from Backlog to 0.1 on the Kube board.Nov 14 2016, 7:58 PM
cmollekopf edited projects, added Kube (0.1); removed Kube.
knauss moved this task from Backlog to Done on the KDE PIM board.Dec 5 2016, 9:50 AM
knauss moved this task from Backlog to Done on the Kube (0.1) board.
knauss added a comment.Dec 5 2016, 9:52 AM

@aheinecke: is this also done from your side?

aheinecke closed this task as Resolved.Dec 5 2016, 10:09 AM

Yes, I think its done.