Archive for November, 2009

Please help with testing! It’s easy!

If you’re running a current KDE SC 4.4 snapshot (all packages and self-compiled variants are okay), please compile/install KDiamond from kdegames. Start KDiamond, pause the game after some seconds, and unpause it after some seconds.

Please write back (either as a comment to this blog entry, or as a mail to me) what you observe: Normally, pausing should hide all diamonds and display a popup in the top left corner of the board, and after unpausing, you can continue to play the game as usual. But on some systems, the popup will get stuck in the middle of the appearing animation, stay there after unpausing, and the game will not be playable even after the unpausing.

Please also write back if everything works fine on your system, and in any case, include the following information in your report:
1. Which distribution do you run? Which version?
2. If you compiled your Qt and KDE from sources, which branch of Qt did you use, and when did you update KDE the last time?
3. If you installed your Qt and KDE from packages, which repositories did you use?

Update: Thanks to anyone who sent information. I’ve found the root cause of the issue: KStatefulBrush. Silly as it sounds, but usage of KStatefulBrush results in an infinite loop. I’m still puzzled why this problem appeared only for me. The problem is actually a bug in Qt.

Comments (13) »

Blog’s better than backup

It’s very common that people post the scripts they’ve written for their daily tasks. Seems like blogs have become the leading backup solution for Bash scripts these days. I’ve decided to join this growing group of people, and share with you a tiny script from my ~/bin which is called “cleanup”. The code is at the bottom of the post.

When you launch cleanup, it will remove any files that match “*~” (i.e., the backup files which KWrite, Kate and many other apps create), and it will print out any files that have been removed. Additionally, it will look for a Makefile, and execute “make clean” if it has a clean rule. Everything operates on the pwd only. All in all, a very handy tool to clean the ls output.

Disclaimer: The “*~” backup files have use cases, and the “clean” rule may not do what you think it does. So when using the cleanup script, be aware of the possible consequences.


#!/bin/sh
function hasMakeClean()
{
    FALSE=1; TRUE=0
    [ -f Makefile ] || return $FALSE
    grep '^clean *\:' Makefile &>/dev/null || return $FALSE
    return $TRUE
}

case $1 in
    --help|-h|--usage|-u)
        echo Usage: $0 '[-s|--simulate]'
        ;;
    --simulate|-s)
        find . -name '*~'
        hasMakeClean && echo "> make clean located."
        ;;
    *)
        find . -name '*~' -exec rm {} \; -exec echo {} \;
        hasMakeClean && echo "> make clean" && make clean
        ;;
esac

Comments (2) »

Levitation

I usually do not write about stuff not related to KDE. But here is something I would like to share with you: The Levitation project is having a logo contest. If you do not know it yet, Levitation is an effort to rewrite MediaWiki on the basis of a Git repository, to allow for local branches and stuff. The project was started just two weeks ago in response to the controversy about notability criteria in the German Wikipedia. I wish the project all the best. After all, that’s something that, when it reaches production quality, could also be very interesting for the KDE documentation writers.

Comments (8) »

Gnome + KDE

You know about these love calculators? Yes, it’s utter nonsense, but sometimes the calculator is lucky: http://www.lovecalculator.com/love.php?name1=Gnome&name2=KDE

Comments (11) »

And now for something completely different…

Palapeli is in kdereview, and I really got to cool down from the continued QGraphicsView hacking. I decided that the best way to do so would be some Phonon hacking. ;-) Actually, I have never worked with Phonon before, but here’s what I got after two hours of work:

Ljudfil, my own command-line music player

Actually, writing a GUI media player would have been easier, but I’ve grown accustomed to using command-line media players (mplayer and cvlc, to be exact) in combination with screen after a period when my X server crashed quite regularly.

The actual code of Ljudfil is exactly 100 lines long (according to sloccount). All it can do is play all files passed on the CLI in that order, then exit (no keyboard navigation). The name has been chosen with a proven procedure of mine: I opened the Wikipedia page of what the application does or what it handles (“audio file” in this case) and looked for the nicest-sounding translation. This time, it was the Swedish “ljudfil”. By this method, Palapeli’s name was chosen, too. (“palapeli” is Finnish for “jigsaw puzzle”.)

I originally had the intention to write a command-line media player with MPRIS support. There seems to be nothing like this. I would like my media player to survive every X server crash in its screen session, yet be controllable through the “Now playing” applet on my dashboard.

But during hacking together the minimal interface of Ljudfil, I noticed that there is no possibility in Qt to use advanced terminal features. You can only write line by line, although POSIX terminals have much more functions (see “man termios” for a first impression). So, to conclude with a question: Dear lazyweb, is there any library or stuff for Qt that gives me more control over terminal output? (Extra points if it’s portable to Windows.)

Comments (1) »

Broken stuff in Palapeli today

This is an important message to people using SVN to checkout the latest Palapeli. (All others can just skip this article.)

Before you do the next “svn update”, go to your checkout directory, delete the “*.puzzle” files in the puzzles/ subdirectory (i.e., the five ones created by make-puzzles.sh). You do not have to call make-puzzles.sh anymore, the puzzles are now on the SVN server again.

Second, I have changed the configuration format for a last time. You know, when we say “playground”, we mean it. (Also, it’s easier to change it now when I don’t have to write complicated update scripts to keep compatibility.) So what does that mean to you?

  • Before installing the updated Palapeli version, you should do a “sudo make uninstall” to avoid orphaned data files in your system directories.
  • If you want to keep your savegames or own puzzles, do the following:
 cd $(kde4-config --localprefix)
 mv share/config/palapeli-{libraryrc,collectionrc}
 mv share/apps/palapeli/{puzzlelibrary,collection}
 sed -i 's/puzzlelibrary/collection/g' share/config/palapeli-collectionrc

Update: Thx to Matthew for reminding me of the fourth command which I forgot in the first run.

Comments (2) »

Qt 4.6 notice

Just a quick notice for anyone out there who builds Palapeli from SVN: It does now officially require Qt 4.6. I’m in the process of cleaning up the animation code, and esp. the new QGraphicsObject class in Qt 4.6 helps me very much in this regard.

Update: I’ve also updated the Palapeli compilation guide. If you’ve used this guide to build a Palapeli from SVN, please do the following in the “build” directory:

sudo make uninstall

Then delete everything and use the guide to create a new checkout. Stuff has changed too much. Please note that the new guide makes you install Palapeli into the standard system directories. This should work around the problems people are having with slicers not found etc.

2nd update: By the way, I’ve also changed the puzzle file format. Instead of BZip2 compression, I’m now using GZip because this reduces loading time on my system by about one second for a medium-sized puzzle. (File size is about the same.) If you’re having problems with puzzles that don’t load (sorry for the missing messagebox that tells you when a puzzle file is broken), rerun the make-puzzles script and “sudo make install” everything again. This should fix your problems.

Leave a comment »