Making DesktopBSD ready for KDE 4
- Posted by ph on October 21st, 2008 filed in Uncategorized
KDE 4 has been around for some time now and, while many still feel it has not matured enough, it will undoubtedly be the future of the K Desktop Environment. Therefore, it is important to adapt DesktopBSD, which currently uses KDE 3 as its desktop environment, to this new major release. This is rather difficult because of some of the technological changes in KDE 4, in particular that KDE 4 now uses the Qt 4 development framework instead of its predecessor Qt 3 used in KDE 3 and the DesktopBSD Tools. Since Qt 4 is not backwards-comptabile, the DesktopBSD Tools would have to be ported to Qt 4 first in order to be able to utilize KDE 4 functionality, a process involving a lot of effort and very few gains.
As an alternative, the decision was made to stick with Qt 3 as framework for now and replace all of the KDE functionality in DesktopBSD code so it still works fine under KDE 4 without requiring users to have KDE 3 installed, in particular:
- System tray icons: KSystemTray
- Passive popups (”balloon notifications”): KPassivePopup
- Icon loading: KIconLoader
- Embedded terminal control: Konsole KPart, TerminalInterface
- Inter-process communication: DCOP
- Integration in the control center: KCModule
I have already found a replacement for KSystemTray in the Psi messenger’s code base, writing own code for passive popups and the icon loading shouldn’t be too hard and I’ll likely use DBUS as a replacement for DCOP. As for the control center integration, providing glue code for both KDE 3 and KDE 4 shouldn’t be too hard, I’m thinking about having to choose (or even auto-detecting) which to build when installing from the ports collection.
However, I haven’t been able to find a replacement for the Konsole KPart and I really do not want to port or even code a terminal emulator myself. Any suggestions for a Qt 3 terminal widget? Otherwise, I guess I’ll have a look at the Konsole code…
October 21st, 2008 at 9:47 am
Hi,
Don’t you think it would be easier to simply port to Qt4 ? Qt3 is simply not maintain anymore which for instance means no security update, and that the code might break in the future leaving you alone to fix those issues. I do think that writting a replacement to Konsole KPart is going to use way more of your time than just porting. Integrating a KCModule written in Qt3 into a KDE4 based is also a difficult call, since KCModule are plugins, and you can’t have an application that link to Qt3 and Qt4 at the same time (even through plugins), the only solution would be to capture a window created by an external process…
That said since you intend to replace dcop by dbus, the KPassivePopup can be replaced by calling the KDE4 notify server to display the popup.
And last but not least, one of the great strength of KDE is the integrated look and feel, which is something that you will lose if you choose a mix of Qt3 and Qt4.
October 24th, 2008 at 12:26 am
Hi Cyrille,
I want to avoid writing a Konsole KPart replacement at any cost, so I was rather looking at extracting a terminal widget from KDE 3 Konsole’s code than making my own. I am also aware that I will not be able to embed Qt3 widgets in a KDE4 KCModule, so instead I was thinking about making the configuration modules standalone applications and provide KCModules that merely act as launchers for them.
Thanks for the advice to use DBUS to get the KDE notify server to display passive popups, however I have already written KDE-independent code and will stick with it.
Why I prefer to avoid porting the whole code base to Qt 4 is simply because it is a lot of work. Currently the DesktopBSD tools consist of 22406 lines in 116 header files and 91 source files, not counting .ui files and generated code from them. Porting all that code requires a lot of effort, especially for a single developer. I am aware that Qt 4 includes the Qt3Support classes for (limited) backward compatibility, but Trolltech announced they will be removed at some point (do they still plan on doing that?) Also, my attempts with using the qt3to4 porting tool indicate it still leaves a lot of issues for the developers to deal with.
October 27th, 2008 at 4:30 pm
This seems like a big project to be carrying on as a single developer. Is it possible to get more people involved with the porting?
October 27th, 2008 at 4:38 pm
Everyone who wants to help is welcome. Write me a mail at ph@desktopbsd.net and I’ll be glad to provide you with an account for our SVN repository and get you started with our code base.
October 28th, 2008 at 9:11 pm
Why not simply install kde3 and kde4 under their own directories, refer to them as $kde3_dir, $kde4_dir, don’t allow them to interact at all (at the cost of some bloat and redundancy, of course), and let the user decide? When kde4 was still in beta stage, this is the approach most distros took to encourage users to try kde4 and post feedback. I feel that kde4 is not feature-complete at all, and would prefer to have kde3 available as an option. Mandriva 2009 did mess their packaging up and kde3/4 distinction is not clear in the install, some packages are missing, replaced by incompatible versions. I’m hoping that mistake won’t be repeated around here.
October 28th, 2008 at 9:32 pm
A-Style,
at this point, it’s more a matter of getting DesktopBSD ready for KDE4 so we can easily switch later. The next release of DesktopBSD (1.7) will still come with KDE 3, but afterwards it shouldn’t be required to still have KDE 3 installed in order to use DesktopBSD with KDE 4.
October 31st, 2008 at 2:44 pm
KDE4 is downright sexy. It’s definitely worth getting support in for. There are a few relatively minor bugs. The most severe is actually an nvidia binary drivers bug, when using OpenGL “desktop effects” in KDE4 (which is a really cool and impressive-looking feature) you can end up suffering from the “black windows bug”. This isn’t specific to KDE4 or even BSD, but it does occur here. Another is some minor screen garbling, but I’ve only had it happen under certain circumstances, and it doesn’t happen in a way that is “in the way”, so I haven’t found it cause to dump KDE4.
I’ve been using it for about a month now, and am overall very happy.
November 2nd, 2008 at 8:15 am
Well I think you should just bite the bullet and switch to qt 4. You’re gonna have to sooner or later. I have tested KDE 4 on a live CD and am looking forward to using it on freebsd. Currently Desktop BSD is my OS of choice but I really want KDE 4
It sounds like you are writing a lot of code to avoid writing a lot of code that you’re gonna have to write anyway
wally
November 19th, 2008 at 5:54 pm
There is a tool called qt3to4 that should help in converting all that code from Qt3/KDE3 to Qt4/KDE4. There’s a guide for porting to KDE4 as well on KDE’s website:
http://techbase.kde.org/Development/Tutorials/KDE4_Porting_Guide
Perhaps that could help ease the pain of the transition.