Listing all files with QDir is slow.
Instead, use argv[0] for zygotized apps and _cmdname() for
non-zygotized.
Apps run through the terminal will fall in the zygotized case,
which is ok.
Note about zygotized apps:
Zygotized apps don't have an executable, they live in a shared
object file.
These apps are run through a deamon that forks and dlopens()
the shared object ( for performance reasons ).
For this reason we can't use _cmdname(), since it just contains
the the file path of the daemon.
On the other hand, non-zygotized apps have a bogus argv[0]
when run through the navigator ( command line is fine ).
Change-Id: I9953e8fa05c9fb11c33b3a38ebab00fe33ba4c44
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>