kdenlive_renderer search path

I have just discovered that kdenlive when calling kdenlive_renderer it honors system PATH.
It should honor the directory where kdenlive binary is executed at the first place.
I thing is bug or at least is not convenient when you have multiple kdenlive version installed (for tersting reason for example).
You have to struggle with PATH settings etc. this is very error prone.
Some of my rendering may have been wrong due this issue! And probably not only mine!

Temporary workaround:
set PATH in command line session and call kdenlive:
PATH=.:$PATH ./kdenlive

Forums:

I couldn't find a reliable way to find the path from where the kdenlive executable is started. Also I am afraid that this could lead to some security issue if this is not done properly.

As a workaround, you could make some adjustments to your great build script so that when everything is built, it moves the kdenlive binary to kdenlive-svn and then creates a bash script called kdenlive that contains the following:

#!/bin/sh
export PATH=.:$PATH
kdenlive-svn

Then of course change permissions to make this script executable.
I know it's a bit hackish, but I prefer to have a hack in the build script rather than hardcoded in Kdenlive...
regards

j-b-m wrote:
I couldn't find a reliable way to find the path from where the kdenlive executable is started.

QString QApplication::applicationDirPath () 
 Returns the directory that contains the application executable.

..no help from this method?

AD wrapping scripts
That exactly what I'm trying to avoid :(
Yes I'm currently using something like this. But this not a clear solution. Complicates debugging etc.. There must be a safe way round.