[Kde-pim] Cyclic link dependencies in kdepimlibs - how to resolve?
Ingo Klöcker
kloecker at kde.org
Tue May 5 00:16:23 BST 2009
On Tuesday 05 May 2009, Thomas McGuire wrote:
> Hi,
>
> now that KPIMTextEdit is basically complete, I wanted to support
> images in signatures.
> The signature editor is in kpimidentities, so kpimidentities needs to
> link to kpimtextedit so that the signature editor there can support
> images.
>
> Problem is, kpimtextedit already links to kpimidentities, because it
> has some functions to insert signatures into the text edit.
Why do those functions exist in kpimtextedit? Wouldn't it be sufficient
to have a method insertSignature() which is called by somebody (e.g.
KMail) who can link against both libraries?
> So there is a link cycle between kpimtextedit and kpimidentities, and
> CMake won't let me do that.
>
> Any idea how to resolve that? One idea would be to move all of
> kpimtextedit (two classes at the moment) to kpimidentities and get
> rid of the kpimtextedit library altogether.
> The downside of this is that a text edit doesn't really fit there.
Exactly.
> Does anybody see a better way out of this situation?
> If not I'll move the classes soon.
I object. Creating yet another libkdepim or libkpimutils (*sigh*) is a
no-go. Putting everything and the kitchensink in one library is no
solution for bugs in the class and/or library design. The solution is
to fix the design.
One solution would be to split kpimidentities into a backend library
kpimidentities-core (ideally using only non-GUI libraries) providing
access to the PIM identities and a second library kpimidentities-ui
providing the UI components for editting the PIM identities. I suppose
this would allow kpimtextedit to link against kpimidentities-core and
kpimidentities-ui to link against kpimtextedit. (The names of the
libraries are just suggestions.)
A similar solution, but with the benefit that it doesn't increase the
number of libraries, would be to merge kpimidentities-ui and
kpimtextedit into kpimui. Then kpimidentities-core could keep the name
kpimidentities. I think I prefer this solution.
Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20090505/cc83d44d/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
More information about the kde-pim
mailing list