SpeedDial for KDE4
Over a year ago a bug was filed in the KDE Bug Tracking System requesting a "Speed Dial" page for Konqueror. I made a comment myself, listing the required steps to implement this feature. But as I was busy at this time and did not use KDE 4.x (only in a virtual machine), I did not work on this issue myself. Since then, I switch to KDE4 completely and thus I wrote a prototype implementation.
The speed dial (codename ‘Tristan’) is implemented as a KPart and the file to be opened is the configuration file containing the URLs. Screenshots from web pages are retrieved by simply creating a KHTMLPart widget and rendering its content to a pixmap object.
The prototype looks as following. Initially, no images of web pages are available, so only blue globes mark the empty positions.
Gradually, the pages are loaded:
Finally, all web pages are available and shown:
URLs can be added from the bookmark menu (Konqueror's bookmarks)
Beware that the code is far from perfect. It produces warnings both during compilation time and when the part is used within Konqueror.
You can download the current version and test it on your KDE 4.x system. To use SpeedDial, you have to perform the following steps:
- Create a new directory debug inside the source folder. Go into this directory.
- Compile the source code
cmake -DCMAKE_INSTALL_PREFIX=KDEDIR \
-DCMAKE_BUILD_TYPE=debugfull ../ \
where KDEDIR is the location of your KDE installation, e.g. /usr.
- Install the compiled code in your system
sudo make install
or without sudo as superuser (root).
- Rebuild the system configuration cache
kbuildsycoca4 (as normal user)
- Configure the file association settings to use the embeddable Tristan part for the mime type application/x-tristan and its ending .trs.
- Restart Konqueror and open the file example.trs (supplied with the source code).
This speed dial piece of code is my first code for KDE 4. I used other parts from the KDE svn repository for inspiration as there is only little official documentation on KParts and browser extensions programming.
The code contains the following known issues:
- Code produces warnings, is not well formatted and does not adhere any coding styles.
- Embedding the part into Konqueror causes warnings about the QPainter object.
- You have to open an
application/x-tristanfile to see the part.
I'd appreciate feedback on this code, especially from more experienced KDE programmers. Maybe the code can be included into the official codebase in the future...