Blackberry: Fix QCoreApplication::applicationFilePath() performance.
authorSergio Martins <sergio.martins.qnx@kdab.com>
Fri, 26 Oct 2012 08:41:23 +0000 (10:41 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 30 Oct 2012 16:32:28 +0000 (17:32 +0100)
commit88be388557cb164eff3436973a57ba5914f4ad3b
tree6bdf55b27720e3ff131bf329ae9a745368cdf773
parentc16471dd7aa6ce9b9768e70de66763f73584d880
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: I73d1cd742a70d1be36a8efe829671d6d7594a6fb
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
src/corelib/kernel/qcoreapplication.cpp