cogito ergo vagus

July 26, 2009

The Road to KDE and Qt Development

Filed under: open source,software — vagus @ 4:11 pm

I’ve previously blogged about my very brief encounters with open source development here and here.

Recently I came across the following blog posts on Planet KDE which inspired me to write this blog post:

Road to KDE devland Step 0
Road to KDE devland Step 1
Road to KDE devland Step 2

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 Entry]
Type=Service
Icon=security-high
Actions=ShowMD5Hash;ShowSHA1Hash;ShowSHA256Hash
ServiceTypes=KonqPopupMenu/Plugin
MimeType=all/allfiles

[Desktop Action ShowMD5Hash]
Exec=md5sum %U | xargs kdialog --title "MD5 hash" --msgbox
Icon=security-high
Name=Show MD5 hash

[Desktop Action ShowSHA1Hash]
Exec=sha1sum %U | xargs kdialog --title "SHA1 hash" --msgbox
Icon=security-high
Name=Show SHA1 hash

[Desktop Action ShowSHA256Hash]
Exec=sha256sum %U | xargs kdialog --title "SHA256 hash" --msgbox
Icon=security-high
Name=Show SHA256 hash

You do the following:

  • Put that in a file called, say, checksum.desktop.
  • Run “kde4-config –path services” to find out the location to place it.
  • Usually one path is per user (yours) and other is for all users.
  • Create a “ServiceMenus” subfolder under your chosen location.
  • For me it was “/home/myusername/.kde4/share/kde4/services/ServiceMenus”.
  • Copy the file there and the right-click menu should start working.
  • If not you might need to log out and log back in, or even restart KDE.
  • Some mistakes I made along the way which caused it to not work at first:

  • I used commas instead of semicolons for the Actions list.
  • Specified mime type as application/octet-stream instead of all/all-files.
  • Did not create the “ServiceMenus” subfolder and copied the file to the main “services” folder.
  • 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:

  • Actually verify the checksum with the actual one instead of just displaying it.
  • Show a progress or “please wait” dialog until the checksum appears.
  • 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.

    Screenshot

    Screenshot

    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 :-)

    Advertisements

    2 Comments »

    1. […] The Road to KDE and Qt Development Blogged about it: The Road to KDE and Qt Development cogito ergo vagus The Road to KDE and Qt Development | […]

      Pingback by The Road to KDE and Qt Development - TechEnclave — July 26, 2009 @ 4:24 pm | Reply

    2. […] and Qt Development Wrote this blog post today: The Road to KDE and Qt Development | veracity The Road to KDE and Qt Development cogito ergo vagus Missed the F1 race because of this Was inspired by the recent "Road to KDE devland" […]

      Pingback by The Road to KDE and Qt Development - Broadband Forum India — July 26, 2009 @ 4:30 pm | Reply


    RSS feed for comments on this post. TrackBack URI

    Leave a Reply

    Fill in your details below or click an icon to log in:

    WordPress.com Logo

    You are commenting using your WordPress.com account. Log Out / Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out / Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out / Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out / Change )

    Connecting to %s

    Blog at WordPress.com.

    %d bloggers like this: