Android: Fix QCoreApplication::applicationDirPath()

Disable the code path which queries /proc/<pid>/exe for the
current executable path, as from a Q_OS_ANDROID perspective,
this executable will be the Dalvik binary. Instead we
get the application directory via the fallback, by
looking in argv[0], since this is set to the location of the
application binary.

Task-number: QTBUG-32852
Change-Id: Ib93050f41cbd47aaf71284e8bfa6a3247131d978
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
bb10
Eskil Abrahamsen Blomfeldt 2013-08-07 13:59:27 +02:00 committed by The Qt Project
parent c54aafad36
commit 1142dde83e
1 changed files with 1 additions and 1 deletions

View File

@ -1973,7 +1973,7 @@ QString QCoreApplication::applicationFilePath()
}
#endif
#if defined( Q_OS_UNIX )
# ifdef Q_OS_LINUX
# if defined(Q_OS_LINUX) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK))
// Try looking for a /proc/<pid>/exe symlink first which points to
// the absolute path of the executable
QFileInfo pfi(QString::fromLatin1("/proc/%1/exe").arg(getpid()));