Recently I came across the following blog posts on Planet KDE which inspired me to write this blog post:
Those blog links have further links within links to various introductions and tutorials which should be very useful.
Nokia recently acquired Trolltech (the developers of the Qt toolkit used by KDE) renamed them to Qt Software and added some license options like the LGPL: http://www.qtsoftware.com/about
A while ago I’d posted a brainstorm idea in the KDE forum requesting the developers add a right-click context menu to the file manager Dolphin which performs MD5/SHA checksums on the selected file so there is no need to go into the command prompt or install additional tools/apps.
Today out of the blue it occurred to me you should be able to do it yourself! I also posted about this in a similar thread at a fun Indian technology forum.
I looked at Dolphin settings menu and saw something called “Service Menus” which listed the right-click menu items like Ark extract etc. so I searched online and found this link: http://techbase.kde.org/Development/Tutorials/Creating_Konqueror_Service_Menus
So I thought I would try to add the context menus myself. After some time I came up with the following quick solution:
[Desktop Action ShowMD5Hash]
Exec=md5sum %U | xargs kdialog --title "MD5 hash" --msgbox
Name=Show MD5 hash
[Desktop Action ShowSHA1Hash]
Exec=sha1sum %U | xargs kdialog --title "SHA1 hash" --msgbox
Name=Show SHA1 hash
[Desktop Action ShowSHA256Hash]
Exec=sha256sum %U | xargs kdialog --title "SHA256 hash" --msgbox
Name=Show SHA256 hash
You do the following:
Some mistakes I made along the way which caused it to not work at first:
It took me a while to figure out I could use the kdialog and xargs commands and I’ve got to get better at shell scripting etc. so I can make some improvements like:
The progress dialog is needed because if I run the action on a large file, like a 700 MB iso, then it appears as if nothing is happening while the checksum is being calculated until the dialog appears after a few seconds.
So, I think I must spend my weekends learning more about KDE and Qt development because I think these platforms have a very bright future with lots of exciting things going on. Oh, and I need to learn Python too, since it’s all the rage these days :-)