Blackberry: Fix QCoreApplication::applicationFilePath() performance.
authorSergio Martins <sergio.martins.qnx@kdab.com>
Thu, 25 Oct 2012 16:50:47 +0000 (17:50 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 2 Nov 2012 17:07:35 +0000 (18:07 +0100)
commit527e67f232184d628d4ecbd7755da6a38d76e23d
tree9a370aa7fc22946369a205f7b76c6b7f9293c318
parentd625535728154fc9ca576bf6472c6b5057a96f17
Blackberry: Fix QCoreApplication::applicationFilePath() performance.

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>
src/corelib/kernel/qcoreapplication.cpp