Split kdepim and kdepim-addons

Last week after some months I finally split lib from kdepim.

Why?

The main reason is that I wanted to make life easy for new developers.

Until now when we wanted to develop an extension for kmail/kaddressbook or other kdepim application it was necessary to build all kdepim.

Now we can create plugins outside of kdepim or in new kdepim-addons repository (Which was created last week too).

Another reason is that these libraries can be used by kontact-quick and by applications as Zanshin (which duplicated libkdepim).

When?

I didn’t do for 15.12 but for 16.04. So I have time to fix all problems.

Where?

All split packages are in kde/pim repository

kdepim-addons

I created this repository for putting all kdepim plugins.

So we can found here:

– messageviewer plugins => header style plugins and messageviewer plugins (create todo etc.)

– pimcommon plugins => customtools plugins as shorturl and translator plugin

– kmail plugins => antispam/antivirus plugins

– kaddressbook plugins => merge contact/search duplicate contacts etc.

So now you can develop more plugins without compile all kdepim.

I will continue to convert features as plugins so we can reduce kdepim code base. And it’s more easy to disable a broken code when it’s a plugin.

Future:

I want to create plugins for korganizer too (I will add plugin support).

I would like to create plugin which uses some different language as c++ but I need to investigate how to create it 🙂

Elf-dissector

Lorsque l’on linke des programmes on s’appuie sur des librairies statiques.

Le problème c’est que l’on peut en ajouter plein lors de la compilation et même si aucun symbole n’est utilisé on va charger cette lib au démarrage de l’application.

Cela va ralentir le démarrage de l’application.

On a plusieurs méthode pour réduire cela:

  1. Retirer chaque lib de la liste des librairies à utiliser et voir si ça linke (long et fastidieux)
  2. Utiliser une application dédiée pour cela => elf-dissector

Elf-dissector est une application développé par Volker Krause (kdepim dev + Qt Dev + KDAB dev + …. 🙂 ) donc pas un inconnu 🙂

Ou trouver Elf-dissector ?

Dans le git de KDE :

“git clone git://anongit.kde.org/elf-dissector”

Compilation:

Il nécessite libelf-devel/binutils/libdwarf-devel/gnuplot

Une fois cela installé il y a plus qu’à faire mkdir build && cd build && cmake -D<….> ../ && make install

C’est vraiment tout simple.

Utilisation:

exemple: elf-dissector /opt/kde5/lib64/libKF5MailCommon.so.5

C’est une application qui va vous permettre de voir quelles libs sont utilisées et ainsi voir si elles sont nécessaires ou non.

Il y a  6 onglets:

  • Elf structure: nous fournit la structure de la librairie (on peut voir le point d’entrée etc.
  • Size Tree Map permet de voir l’organization dans la librairie
  • Dependancy c’est vraiment l’onglet le plus utile il permet de voir les différentes librairies utilisées et voir le nombre de symboles utilisés dans chaque lib. On peut voir cette qui sont chargées mais qui ne sont pas utile. Si l’on clique sur un item on peut voir les symboles utilisées et donc ceux qu’on doit supprimer si l’on veut plus avoir une dépendance sur telle ou telle lib.
  • Issue permet de voir les erreurs dans la librairie ça prend énormément de ressources donc à manier avec parcimonie

Après vous avez plus qu’à réduire le nombre de bibliothèques utilisées pour votre application.

Attention les dépendances peuvent aussi venir de dépendances indirectes donc difficile des fois à faire les ménages.

Mais cette application nous a permis de réduire le temps de chargement de KMail de 1.3 secondes à 0.6 seconde donc vraiment utile.

Scan-build (clang static analyser)

Clang fournit dans sa suite divers plugins et aussi un analyser statique de code.

Il va simplement analyser le code compilé par clang et il va en faire un rapport en sortie.

Donc tout code non compilé par Clang ne sera pas analysé forcément. Genre il ne va pas aller chercher du code

ou il y a un  #ifdef OPTION par exemple si on n’a pas définit OPTION lors de la compilation.

Comment l’utiliser?

Très simple:

Pour un programme compilé genre kdepim:

mkdir build && cd build && CXX=clang++ CC=clang scan-build -k cmake -DCMAKE_BUILD_TYPE=Debug ../
scan-build -k -o results make

Vous laissez builder et vous aurez le résultat dans le répertoire results sous forme de fichier html.

Attention il peut générer des faux positifs on ne peut pas corriger sans se poser des questions mais ça donne de très bonnes informations sur les erreurs possibles dans le code.

Je vous laisse lire les autres options sur le site officiel http://clang-analyzer.llvm.org/scan-build.html

Clazy

Les développeurs KDE ne sont pas en reste pour ce qui est des outils pour aider à améliorer la qualité du code.

Sérgio Martins a développé “Clazy” un outils qui utilise Clang pour rechercher et avertir de certaines améliorations à faire dans votre code. Certains de ces plugins peuvent directement modifier le code source.

Comment le builder ?

Déjà récupérer le code source git clone git://anongit.kde.org/clazy

Il faut clang-devel >= 3.6

Ensuite il faut le builder et cela contre clang.

mkdir build && cd build && cmake  -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_INSTALL_PREFIX=<path> …/ && make install

Maintenant il faut s’assurer que <path>/lib64/ est dans votre LD_LIBRARY_PATH sinon ça ne marchera pas.

Dès que tout cela est fait vous pouvez l’essayer sur un projet.

Comment l’utiliser ?

Il faut export la variable CXX

export CXX=”clazy”

Ensuite il faut dire ce que vous voulez évaluer.

Si vous voulez avoir tous les warning reportés par clazy, il suffit d’exporter une deuxième variable:

export CLAZY_CHECKS=all_checks

Après il faut reconfigurer le build sur votre projet

cmake -DCMAKE_INSTALL_PREFIX=<path> ../

et là vous aller pouvoir voir tous les variables et les infos résultant.

Les divers plugins:

  • bogus-dynamic-cast
  • foreacher
  • global-const-char-pointer
  • inefficient-qlist
  • qstring-uneeded-heap-allocations
  • qstring-arg
  • qstring-ref
  • function-args-by-ref
  • qmap-with-key-pointer
  • non-pod-global-static
  • reserve-candidates
  • variant-sanitizer
  • virtual-call-ctor
  • missing-typeinfo
  • implicit-casts
  • old-style-connect
  • detaching-temporary
  • assert-with-side-effects
  • qgetenv

Comment faire les fixes directement dans le code?

C’est très simple 🙂 Il suffit de le dire à Clazy en exportant la variable CLAZY_FIXIT

Par exemple:

export CLAZY_FIXIT=”fix-missing-qstringref”

Il y a que quelques plugins qui permettent la modification directe.

export CLAZY_FIXIT=”fix-old-style-connects” (change le style de connexion signal/slots (la nouvelle API qui est arrivée avec Qt5)
export CLAZY_FIXIT=”fix-missing-qstringref” (ça adapte le code pour utiliser const + ref lorsque c’est possible)
export CLAZY_FIXIT=”fix-fromCharPtrAllocations” (les 3 autres c’est pour réduire l’allocation lors de l’utilisation des QString)
export CLAZY_FIXIT=”fix-qlatin1string-allocations”
export CLAZY_FIXIT=”fix-fromLatin1_fromUtf8-allocations”

CLAZY_FIXIT ne permet pas de faire tout ensemble c’est un plugin par compilation ce qui est un peu logique car changer un fichier en court de route et remodifier encore derrière serait très risqué)

Mais pour fixer kde j’ai créé un script. Vous pouvez l’utiliser clazy-compile

il suffit de le renommer en .sh et le l’exécuter il fait tout pour vous.

Le futur ?

Ben il y a toujours des vérifications de code à faire et des optimisations donc ça va continuer. Mais j’en sais pas plus 🙂

KDEPIM 5.0

KDEPIM 5.0 is the port of kdepim to kf5/qt5.

The porting was started in may 2014. It was a long way because kdepim is not just kmail. It’s based on Akonadi server and all libraries from kdepimlibs.

The first step was to make Akonadi worked against Qt5.

The second step was porting kdepimlibs to make it work with akonadi server and KF5.

The last step was porting kdepim to kdepimlibs.

But we are able to obtain a stable version for 15.08 !

What contains kdepim 5.0 ?

It contains all original applications:

  • KMail
  • KAddressBook
  • KOrganizer
  • Kontact
  • KAlarm
  • Blogilo
  • AccountWizard
  • KNotes
  • grantleeeditor*
  • importwizard

What applications were removed?

KNodes was not ported to KDE4 pure and there is not a maintainer for it. So it was a big work for me if I wanted to port to pure KDE4 and porting after that to kf5

KTimeTracker was not maintains during some years and it was not really a pim application.

KDEPIM-Mobile: it was removed too because it depends against QtQuick1.0 it was not tested in 4.14 so in KF5 it was completly broken. So if some guy wants in the future to have it, it will be necessary to rewrite all.

KMailCVT: it was merged in the application importwizard.

What is news in kdepim 5.0?

  • First at all we ported to Qt5/KF5 🙂
  • New composer for KMail which has search/replace component integrated in composer directly.
  • contactprintthemeeditor allows to create some grantlee theme for kaddressbook
  • KAddressBook allows to send vcard file directly
  • Now we can manage IMAP folder which can be show in KOrganizer/KAddressBook.
  • Now we can share url on social network (as Facebook/Twitter etc.)
  • Add support for texttospeech based on Qt5TextToSpeech (which is not release yet).
  • Pimsettingexport has a console program now. (so we can backup from a script directly)
  • I merge all setting for email completion in an unique dialog.
  • SieveEditor has bookmark support.
  • a lot of others features that I don’t remember 🙂
  • KContacts has full vcard4 support.
  • Dan made a big work on Akonadi. He speeded up it a lot. It’s very fast now.

Future:

The future is in progress 🙂 KF5.1 is in development.

We have some new feature:

  • Sieveeditor has debug script support implemented based on “sieve-test” application.
  • KAddreebook has complement gravatar support
  • KAddressbook can display image based on an url
  • A lot of optimization was done
  • Some obsolete features were removed during Akademy coding session

KDEPIM report (week 26)

My focus was KAddressBook last week.

KAddressBook:

It’s not a complicated application, so I didn’t find a lot of bugs. But indeed as I maintain it I already fixed critical bugs.

Some fixes:

  • I improved gravatar support.
  • I added “Server Side Subscription” action. Before that it was necessary to go to kmail or go to resource settings and click on “ServerSide subscription” button. I was not userfriendly.
  • I continued to clean up code and I use new qt5 connect api.
  • I fixed a lot of bugs (as layout bugs etc.)

Other works in KDEPIM:

  • I fixed LDAP support which was broken when we ported it to QUrl now we can use it. It’s great 🙂
  • I fixed translation in korganizer.
  • AkonadiSearch dbus interface name was changed. So we couldn’t have email indexing information. Fixed.
  • I fixed Imap Resource interface too.
  • A lot of bugs were fixed in korganizer/kmail/sieveeditor etc.

Future:

Next week I will focus on KNotes and Kleopatra.

Other info:

Dan merged his work about replacing text protocol by a binary protocol for Akonadi. I confirm it’s faster.

He worked a lot to improve speed. Now kmail is very speed 🙂

I hope that he will add more speed patch 🙂

Sergio continued to add some optimizations in kdepimlibs/kdepim/akonadi. !!!

KDEPIM report

This week I focused my work on Akregator.

Akregator:

  • I fixed some errors on signal/slots
  • I reimplemented TextToSpeech support
  • I replaced QList to QVector where it was possible
  • I added some QStringLiteral
  • I used new Qt5 connect Api
  • I fixed some bugs.
  • I added support for share url (it allows to share url in Facebook/Twitter etc.)

Others work in KDEPIM:

  • I implemented ShareUrl, I use it in kmail/akregator
  • I fixed some bugs in Dav resource (thanks to Bruno Friedmann to provide me an access to an owncloud server). It was mainly GUI bugs.
  • I fixed some crashes in Accountwizard
  • KMail uses KPIM::CompletionConfigureDialog to configure addressline settings (it avoids 3 different dialogbox).
  • I added bookmarks support in Sieveeditor
  • I added spellchecking support in plaintexteditor.
  • I fixed application translations

Future:

Next week I will focus on the KAddressbook.

I hope that I will have more bug report about it.

Other Info:

Dan works on akonadi to replace protocol based on text to use a binary protocol directly.

He saw a lot of improvement. He hopes to merge it in master soon.

To conclude:

We are in good way to have a stable version for 15.08.

I was not sure some about it some weeks ago 🙂

KDEPIM KF5 status and test plan

Status:

As you know we decided to release kdepim kf5 in 15.08. (We have 2 months yet).

I use kdepim kf5 by default now on my main computer. Of course when I started to use it all apps crashed, or there was some part of code which was not ported to kf5 yet.

I tried to fix all crash that I found, I fixed a lot of bugs, and I finished some features (as Gravatar support, rewrite the kmail composer, reimplement text to speech etc.)

Now all applications work fine (no direct crash when I launch them). But of course it’s not perfect. I can’t use all application all the time. So I need some help to find bugs.

Test plan:

There is a lot of application in kdepim:

  • KMail
  • KAddressBook
  • KNotes
  • Kontact
  • KOrganizer
  • SieveEditor
  • AccountWizard
  • ImportWizard
  • etc. (Some others minor applications)

So I decided to focus each week on an application.

I will not work at 100% on a specific application, but I will use it a lot during this period and I will try to fix each bug that I will find.

As I worked a lot on KMail, I will not focus on it next week.

I will focus on Akregator, so if you can test it and you can report me bugs. I will not fix all bugs about akregator but I will try to for all porting bugs. I don’t have time to debug all akregator bugs 😉

How to test it ?

It’s better to use last version from git because I fix a lot of bugs each week. (I don’t know if distro provides snapshots).

I will increase version of kdepim each week so we will be sure that bug is against last version.

Limitation:

KDEPIM uses a lot of resource as Dav, Openxchange, etc. I don’t have access to them. So I can’t debug so it will good if some people will able to test them.

Thanks for your help.

KDEPIM KF5

History:

I started porting of kdepim to KF5 1 year ago (in may 2014). When I started it I thought that it should be easy. But it was not easy because firstly KF5 was not release and it was not stable, there was some bugs. Secondary kdepim is not just KMail, it contains the kdepim libs + akonadi + kdepim runtime + kdepim apps (as korganizer, kmail, etc.).

The first step was to adapt cmake files to new framework environment.

I removed some applications which were not ported to pure kde4 (depended to kde3support), or some unmaintained applications (as ktimertracker) etc.

The second step was to split kdepimlibs as frameworks (for the moment just one lib is released).

The last step was removing kdelibs4support (it’s still in progress). This step is very long because we need to port each kdepimlibs library (The big problem is the KLocale porting… It’s complicated and there is not Howto for it…).

Status:

Last week I decided to use kdepim kf5 as default on my computer.

It was not an easy decision because I use KMail for my work.

But before to do it, I implemented a class for migrating data applications, because now we use XDG path and not .kde path for config/apps data etc. as it was in kde4

First impression:

I am impressed because KMail works fine 🙂 I can send/receive emails !

KAddressBook was totally broken but I fixed it last week end.

KOrganizer worked correctly.

SieveEditor works very fine.

For other applications they are working fine but I didn’t have time to evaluate them correctly.

Dead line:

We decided to release kdepim with kf5-15.08, so in 2 months.

Is it possible to do it ?

I hope 🙂 But it will hard to fix all bugs without some helps.

kdepim-4.14 ?

I never stopped to work on kdepim-4.14, but indeed now that I switch to kf5 I will reduce the time that I took to debug it.

But I will continue to backport the fixes on kdepim-4.14 until we release kf5, because I am not sure at 100% that new version will kf5 version.

Future:

I will continue to debug all applications, I will finish some new features until we release it.

How to help ?

Just take an application, use it as usual and report all bugs that you find.

Full KF5

Depuis la semaine dernière j’utilise aucune application kde4.

ça veut dire que j’utilise kdepim kf5.

Oui j’ai tenté mais je l’ai pas fait n’importe comment. Déjà j’ai mis en place une vraie migration. (les folders n’étant pas migré ça posait quelques problèmes). De plus j’avais déjà fait un maximum de test à coté.

Mais bien sur ça vaut pas le test en live 🙂 Et là ben… comment dire… des bugs à profusion. Genre kaddressbook ne pouvait pas stocker les nouveaux contacts.

Donc j’ai passé du temps à rendre kdepim utilisable.

Mais maintenant c’est parti pour une longue chasse aux bugs 🙂

L’objectif c’est 15.08.

Est ce que je crois que ça sera opérationnel ? Heu… bien sur 🙂 Enfin si on est plus que 2 à bosser dessus. Dan est en train d’améliorer Akonadi, et moi je fixe le reste.

Donc forcément ça prend du temps.

Faut en même temps avoir des gens qui testent kf5 🙂

Est ce que je vais laisser tomber kde 4.14 ?

Bien sur que non je vais continuer à le fixer sans problème surtout que je suis pas sur que kdepim kf5 sorte vraiment pour la 15.08.

Là aussi j’ai besoin de bugs reports.

Voilà 🙂