Tuesday, October 12, 2010

Marble: configurable routing profiles

Wow, long time since the last blog entry.
This time it won't be about KDevelop - as I found another very interesting KDE project.

I started contributing to OpenStreetMap like two years ago (only local area) and got a Garmin eTrex that can load OSM maps. I use it for bicycling.

The thing that needs improvement is bicycle routing. I mean in general it works, but when using it in practice it matters a lot (a) what bike you use and (b) what kind of driver you are. So it's nonsense to have a single bicycle routing profile. I want:
  • MTB offroad
  • MTB shortest route
  • racing using the shortest route (traffic doesn't matter)
  • racing using the "nicest" route (cycleways, not too much traffic)
  • family (cycleways only if possible)
You see my needs are very special, and this I will never get from google maps or a garmin.

What I found are a number of open source routing applications using osm data. The most promising one (for my special needs) is routino - as you can easily create profiles using xml files.

And, of course I want a proper application - nothing web based. (easier to run, faster, better usability)
Marble fits in perfectly.

So I started writing a routino plugin for marble - was quite easy. The only problem was that marble had only a limited number of routing options - as it supports multiple routing backends (online and offline).

The proper solution are fully configurable profiles - and I just merged this feature into trunk. (I feel very happy about that, thanks to Dennis and Torsten for their help and patience)

The user can easily create new profiles or adjust them. A default set similar to the previous ones set is loaded on first startup. Just see screenshots below...


Saturday, February 20, 2010

Using KDevelop for debugging only

As you might know, KDevelop has an integrated gdb debugger. But it a bit difficult to set up the launch configuration, especially when not using KDevelop for coding.
There is now an easy way to run the kdevelop debugger only:
kdevelop --debug gdb executable --args-to-executable

When running that command kdevelop starts, runs the executable and breaks in main. You then can do the usual debugging.


Another thing I implemented is a resizable variable tooltip, with that you can look even at vallules like this one:


Tuesday, February 16, 2010

Css Language Support Update

I'm here at the KDevelop/Kate/Okteta sprint here in Berlin. Having a great time here :D
One thing I made progress on is Css Language Support, it is now supported in style elements embedded in html. Additionally outline navigation works now as expected:


Code completion still works ofcourse:

It's now in a pretty usable state, so you might want to try it.

Saturday, February 13, 2010

KDevelop XDebug (Php Debugger)

Another important part of a Web IDE is a debugger. The KDevelop XDebug Plugin is a frontend for the php debugger xdebug, and just had it's first beta release.
I'll explain in this post how to set it up.

Prerequisites:

  • Php
  • XDebug extension
  • xdebug configured to accept remote connections

    • xdebug.remote_enable = 1
    • xdebug.remote_host = localhost (yourhost if on remote server)
  • KDevplatform, KDevelop
  • The following KDevelop Plugins:
    • executescript
    • executebrowser
    • xdebug
    (download here)

Debugging a CLI Script

1. Create Launch Configuration

  • Run » Configure Launches...
  • add Launch Configuration (+)
  • choose Type "Script Application"
  • enter interpreter "php"
  • enter script path
  • activate the new Launch Configuration in Run » Current Launch Config
You may test the Launch Configuration now by executing it (Run » Execute Launch)

2. Start Debugger

  • Set a breakpoint (Run » Toggle Breakpoint, or rightclick on icon border in editor
  • Run » Debug Launch
  • Happy Debugging :D
The debug session is stopped once the script has ended.

Debugging a Website

1. Create Launch Configuration

  • Run » Configure Launches...
  • add Launch Configuration (+)
  • choose Type "Browser Application"
  • enter server host and path
  • activate the new Launch Configuration in Run » Current Launch Config
You may test the Launch Configuration now by executing it (Run » Execute Launch)

2. Start Debugger

  • Set a breakpoint (Run » Toggle Breakpoint, or rightclick on icon border in editor
  • Run » Debug Launch
  • Happy Debugging :D
The debug session continues the script has ended, you can navigate in the browser to debug further scripts. To end the session execute Run » Stop Jobs.

Remote debugging is possible too, but that is not described in this tutorial.

If you have problems with configuration, or find any other problem send a mail to kdevelop-devel _at_ kdevelop.org.

Sunday, February 7, 2010

KDevelop Php Update

I finished today the (for me) most missing feature in the KDevelop Php language plugin. It fixes parsing problems that occur when a project is initially parsed and the code makes heavy use of classes together with an autoloader. That means no include() statements for parent classes or static function calls. (Typical when using eg. Zend Framewok)

Previously code completion was broken until you manually forced a reparse, now this reparsing is automatically done once a identifier is not found - the file is added to the parse queue with very low priority - and the base class will be parsed meanwhile - and found correctly in the second pass.

Credits for this should mainly go to Hamish - who implemented that more or less the same way in Java language support.

As KDevelop is currently frozen for Beta8 I couldn't commit yet, until then I created a temporary git repository.

Saturday, January 23, 2010

KDevelop/Quanta4 Css Language Support

I'm currently working on a important part of Quanta4, Css Language support. The only thing supported for now is code completion for standalone css files:


But that is the most useful feature a Web IDE can have.


Still on my todo list is:
  • validation (should be easy with the existing parser)
  • Outline navigation (should be not that hard either)
  • Support <style> tags and inline styles in html files
A few notes on how I implemented the plugin:
  • I reused WebKit's flex lexer
  • then wrote a parser using kdevelop-pg-qt based on WebKits bison grammar. A major difference is that it successfully parses incomplete Css - as it is during writing in the editor.
  • The code completion parses the file on invocation and goes through the Ast (resulting from the parser) to find the correct type to show.
  • Then, using an XML file borrowed from Aptana's code assist, the shown completion items are determined.

How to test (feedback is very welcome!)
  • install kdevelop
  • install trunk/playground/devtools/kdevelop4-extra-plugins/css
Ruan recently recently announced on kdevelop-devel that he will work on html/xml language support. There is hope for Quanta4!

Gdb Qt pretty printers updated

I just commited an update to the Gdb Qt pretty printers, they work now for Qt 4.6. (I didn't test 4.5, but most won't work anymore I guess)

The printers need to poke around in private members, that's why they depend on a specific Qt version.

They are still located in the kdevelop git, instructions on how to enable them see here. (the svn url changed as kdevelop is now in extragear)

Unfortunately my merge request for Qt that would add them directly to Qt got rejected, so it is a bit difficult to support multiple Qt versions - for now 4.6 only is supported. Perhaps in future more people will discover this feature in Gdb and they will get added... You know where to find them.