Friday, January 26, 2007

Daily Surprises

One thing I do each morning is run Smart to update my system. Most of the time it's just bugfix releases, but sometimes I get the nice surprise of getting a new version of a piece software. It's especially nice when I didn't know it had been released - like yesterday when I was given KDE 3.5.6, and today I got KDevelop 3.4. And I didn't have to pay anything.

Actually, I got a free Vista DVD at work yesterday - sent automatically by Microsoft in their action pack. I tried to update my Windows 2000 VMware image just to see what Vista is like. The installer said I didn't need to enter the product key, but if I didn't I might lost information, programmes and settings, and might need to buy a new copy of Vista. And then when I clicked Next it told me I only had 5Gb of free space so it couldn't continue. Oh well, I'll stick with Windows 2000 for when I really have to use Windows. Which isn't very often.

Sunday, January 21, 2007

Simple KDE4

I thought it was about time I got to know KDE4's libs better, so I started with the simplest programme I could - a hello world programme, and then extended it to start using kdelibs. So I made it produce an MD5 checksum of "Hello, world" as well. This way I didn't have to bother learning any GUI stuff - I could just concentrate on the very basic stuff. So here's what I wrote:

project( test1 )
find_package( KDE4 REQUIRED )
include_directories( ${KDE4_INCLUDES} )

set( SRC test1.cpp )
kde4_automoc( ${SRC} )
kde4_add_executable( test1 ${SRC} )
target_link_libraries( test1 ${KDE4_KDEUI_LIBS} ${KDE4_KPARTS_LIBS} )

#include <KDE/KCodecs>
#include <QtCore>
#include <iostream>

int main(int argc, char *argv) {
KMD5 context( "Hello, world" );
std::cout << "Digest output: " << context.hexDigest().data() << std::endl;

Very simple - but now I can start experimenting with the other kdelibs classes until I understand them well. Then I will be able to understand the rest of KDE better.