When someone wants to learn the techniques and tricks of development with KDE libraries, they can head on over to Techbase. While we have a great amount of information there already with dozens and dozens of tutorials, we're still missing a lot of topics there. We really need to address that over time, but that's a different issue from the one this blog entry is about: example code.
There is a lot of example code scattered around in KDE's svn. Sometimes they are referenced from or even provide the entire basis for tutorials on Techbase. Getting them isn't very convenient or even easy for too many people.
Most of our third party developers do not build KDE's base libraries from source code, they just install the packages from their distribution which only include the binaries, development headers and text documentation. For those that do compile from source, the fact that there are examples hidden here and there is often not known to them. So despite all the work that has gone into those examples that are squirreled away in kdelibs, kdebase and elsewhere, they miss out on what is probably their most important audience.
Inspired by other projects out there, not least of which is Qt with it's inclusion of both an examples and a demos directory in its source tree, I suggested that we should have a "kdeexamples" module. This module would contain as many of our examples as possible and would be offered for download as a single tarball so developers can download them all at once and use them for current and future reference. They may even find a few technologies they didn't even know existed in the process, but more importantly they will have one place to check for examples.
Of course, KDE is a project that thrives because it is people doing rather than people just talking. With some help from the sys admin team (thanks, guys! :) we now have our very own kdeexamples module. You can find it here.
If you have example code that illustrates how to use KDE's various libraries and technologies effectively, please add them to the module. I'll be adding a top-level CMakeLists.txt in a moment for building the examples and examples included should be grouped by topic to make finding things reasonably easy.
A first tarball release will be made as soon as it makes sense to (e.g. there are a significant number of our examples in it) or 4.4 is released, whichever happens first. Personally, I'm hoping for the former. Also, although this is probably obvious: distributions should not package this module as the whole point is being able to study the source code directly. :)