From 1142dde83e888f8d8ea15099c3634a59faf8fe33 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 7 Aug 2013 13:59:27 +0200 Subject: [PATCH] Android: Fix QCoreApplication::applicationDirPath() Disable the code path which queries /proc//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 --- src/corelib/kernel/qcoreapplication.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index efb1289a5c..a7b14b22b5 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -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//exe symlink first which points to // the absolute path of the executable QFileInfo pfi(QString::fromLatin1("/proc/%1/exe").arg(getpid()));