Posts Tagged ‘KDE’

Becoming a KDeveloper

So, I’ve just been accepted into this year’s Summer of Code program. I’ll be working on KDevelop, introducing a system for using and sharing code templates. This includes both project templates (integrating KNewStuff into KAppTemplate) and more specialized templates (for code files,  classes, tests, make and cmake files, etc). The full proposal is online at http://www.google-melange.com/gsoc/proposal/review/google/gsoc2012/noughmad/37002.

However, all this is still in the future. I’ve already been doing some work on KDevelop, and so far I’ve enjoyed it very much. Not only do I use it every day, its plugin architecture makes it easy to add small pieces of functionality. Note that because of school getting harder every year, I have little free time and my progress is a bit slow. But anyway, I’ll show you what I wrote the past few moths.

Unit tests

KDevelop currently has no support for unit testing. However, both KDevelop and KDevPlatform have loads of them, so a good system for running tests and reporting their results would find a good use. So I introduced some new interfaces for unit tests, including finding and running them. A toolview was adapted from the old and unmaintained Veritas library, however I took steps to better separate the interfaces and their implementations. Currently supported are tests declared with CMake and those using the PHPUnit framework.

A toolview for listing unit test suites and their test cases

Apart from simply listing tests, the relevant declarations are also extracted and a “show source” action is available. Support for running unit tests and reporting results is also functional, however I have trouble deciding which icons to use. There is a difference between a failed test case and an error, and also between an individual testcase and suite results. As a short-term solution I implemented a mess of different icons.

The toolview showing results of a test run

Finding tests declared in CMake files works reliable, whether they use add_test() directly or some wrapper macro (like kde4_add_test()). Unfortunately, this is not true for php tests cases. The problem with PHPUnit is that a test case must inherit from a certain class, but  doesn’t have to include any special file, so the parser find the right declaration by itself. I managed to fix it by modifying the parser, so that most test cases are found, but unfortunately still not all.

Additionally, when running the test cases, their output is displayed in a separate toolview. For test cases using QtTest or PHPUnit, the output is highlighted appropriately (green for success, red for failure). For Qt-based tests, clicking a line in the output also takes you to the declaration in the code.

An output from a test using the QtTest framework

If you wish to test this, the code is in the “unittest” branches of kdevplatform, kdevelop and kdev-php. Any input is appreciated, especially regarding the presentation to the user.

Code checking

Another valuable resource for KDE developers is the Krazy code checker. Seeing how easy it is to create KDevelop plugins, I wrote another one to run Krazy and report back the results. Any issues found are inserted into the declaration-use chain, so they are visible in the Problems toolview, as well as in the code itself.

An issue found by Krazy displayed in the Problems view and in the code

The code is still in my personal scratch repository at http://quickgit.kde.org/index.php?p=scratch%2Fmihac%2Fkdev-krazy.git&a=summary

When all else fails

I also implemented a different kind of code checking: by humiliation. If you stumple upon a horrible piece of code, either written by you or inherited, you can earn a feeling of superiority by sending it over to The Daily WTF.

A context menu entry for submitting an offending code snippet to The Daily WTF

I haven’t yet submitted any code with it, but I tested the plugin with Alex, the site’s maintainer, and he says it works. So watch out, if you write bad code, even if you fool all the unit tests and code checking tools, someone can still expose you.

Release Party in Ljubljana, Slovenia

After a one-year break, the KDE release party tradition in Slovenia is back. As usual, it will take place in Kiberpipa on Tuesday, January 31. Apart from a display of KDE’s latest features, we will also discuss ways of contributing to KDE, especially by programming and translations.

There will be not one but three presentations:

  • Jure Repinc will show what’s new in the KDE Software Compilation, with a focus on Plasma and Plasma Active
  • Andrej Vernekar, the Slovenian translation coordinator and Linux user group president, will have a presentation about translating KDE.
  • Miha Čančula (myself) will talk about programming for KDE, my experience with the mentorship programs, and how KDE makes a programmer’s life easier.

More info is available on the community wiki or in the Slovene version.

Knights 2.4.1 Released

Today Knights has reached the stage where some exciting new features are completed and usable. The new release includes saving and loading PGN files, setting the difficulty, and supporting the UCI engine communication protocol. I also added a move history widget, which can display the moves so far in three different notations.

Playing against Stockfish, a strong chess engine using UCI

A handful of new themes appeared on kde-look which can be downloaded from the Knights configuration dialog.

St. George theme by Dave Kaye, with visible history and clock widgets.

Move history can be save quickly from the history widget, or from the dialog which appears after a game is over.

Knights can be downloaded from their usual site at kde-apps:

Knights 2.4 Released

A new stable version of Knights is now ready for public use. There are relatively few user-visible changes, especially considering the long time it took from the last release. However, there are a few behind-the-scenes improvements, which prompted me to bump the version number.

Playing on freechess.org with Knights version 2.4.0

Features

One is the ability to speak opponents’ moves using Jovie. Another, with less immediate advantages but with more effect in the future, is the ability to control Knights via a D-Bus interface. It has no current uses, except with an unreleased version of Simon, enabling voice-only interaction. It could also lead to other interfaces reusing the code of Knights, for example a Plasma widget.As you can see from the screenshots, the feature of turning around the board when the local player changes is now optional, making it possible to use Knights on a tablet as a chess board replacement. I also made use of some recent developments in the KDE libraries, like the nice KMessageWidget as a replacement for the existing offer display.

Finally, some bugs with both the computer and server interfaces were fixed since the last version. The most notable is probably better handling of moves undoing. The XmlGui is also cleaned up, fixing some behavior issues.

Download

As usual, the latest version can be downloaded from KDE-Apps with the help of OpenSuse Build Service.

Alternatively, you can get source from the git repository (tag v2.4.0) or from Dropbox (direct link). Binary packages for most popular Linux distributions are available at the OBS site here.

Bugs and wishes

Please report and bugs (I’m sure there are some) and wishes to http://bugs.kde.org.

Changes in my life

I didn’t do much for KDE this summer, even after GSoC was over, despite my best intentions. The time was instead spent for major changes I made. I hope they will all pay off in that I’ll be more productive on the future.

The real

Maja and I finally found a place to rent, so we’ll be living together now. The flat is rather small, only 30 square meters, but it’s nice and we managed to decorate it really well. We’ve been together for five years now, so out was about time, and we’re closer to our school this way. This is the first time I’m moving away from home, so it’s a big step for me.

The digital

I decided to take the opportunity of moving to also refresh my computers. I bought an Android phone, and I installed more appropriate distributions on the desktop and laptop. I’m still experimenting with the setup, but I think I’ll go with Arch on the desk and Ubuntu or Fedora on the lap.
I also renamed them all after fictional spacecraft, and added desktop backgrounds matching their names.

And the cloudy

I’m also finishing the experiment of running my blog with Drupal on the Amazon cloud. The free period is running out, and a fuzzy feeling is not worth the 15 bucks a month, so I’m moving back to WordPress. It was fun, but I figured I had better things to do than searching and configuring a plethora of modules to replicate the functionality WP has by default. I found that for me, writing code was much more interesting than administering a server, so I’ll focus on that instead.

Amazon’s free micro instances are also rather slow, and the load was showing whenever I posted an article to PlanetKDE. I tried aggressive caching, CloudFlare and FeedBurner, but the site still wasn’t performing as it should.

My new Android phone

I just bought a Samsung Galaxy Ace, the cheaper and weaker version of the S2. This is my first experience with Android, so I thought I should share some of my findings.

The user interface is basically what we’ve come to expect from a phone, similar to Plasma with widgets and to Symbian with menus. I quickly noticed that typing on a touchscreen is hard and slow, but then I found the great Swype keyboard which makes it so much easier. It’s amazing how much faster it is that typing on a phone keyboard.

A somewhat worse experience was the market. I heard critiques of Linux package repositories because of the large number of programs and too much duplication; all this applies tenfold to the Android market. I had to try at least ten notes widgets and apps before deciding on the one to use. And with many of possible apps costing money, it’s hard and expensive to try them all.

I already used many Google features (the money for the phone came from them via GSoC), so the account integration was welcome for me. Calendars and notes syncing with the desktop is really useful. My previous phone didn’t have wi-fi, and I only now noticed what a godsend it is, with wireless everywhere and carrier internet slow and expensive.

The only downside of owning a smartphone seems to be the battery life. Now, when I’m still installing apps and configuring it, it barely lasts two days. I suppose I’ll have to get used to nightly charging.

Last Month in Knights

It’s almost a full month since the 2.2 release, and I’m proud to say there are some new features in your future favourite chess program.

The first thing I did was to add support for the different dialect of the XBoard protocol that is spoken by some engines. Knights now supports GnuChess, Crafty, Sjeng, Sloppy, Phalanx, Fruit, and probably many more which I didn’t test.

Another is the introduction of several protocol-dependent actions such as Undo-Redo, proposing Draws and Resigning.

Time control got some little love too, so you can specify either conventional Fischer-style timing or FICS-style incremental clock. I’m sure the usability of the dialog could be improved, I’d be grateful for any suggestions here.

There is also the oft-requested feature from eBoard: The Seek Graph. I used a KPlotWidget, much better than trying to figure out label placement by hand.

And last but not least, both chat and console interaction with the chess server

Unfortunately, due to lack of an exposed API, I could not use the Konsole widget for the console and had to come up with my own.

As usual, comments from any usability experts and/or chess player are welcome.