Tizen: Fix QCoreApplication::applicationDirPath()
authorTomasz Olszak <olszak.tomasz@gmail.com>
Tue, 10 Nov 2015 14:41:48 +0000 (15:41 +0100)
committerTomasz Olszak <olszak.tomasz@gmail.com>
Tue, 10 Nov 2015 14:41:48 +0000 (15:41 +0100)
Disable the code path which queries /proc/<pid>/exe for the
current executable path, as from a Q_OS_LINUX_TIZEN perspective,
this executable will be the launch_app 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.

Change-Id: I3132266b8fa83cfad968e5d04883d88a731c1a87
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
src/corelib/kernel/qcoreapplication.cpp

index 8f4774a1e050ec8a14bcba13038cdab82721d7b2..2c6e5699f769e0e587d5b98deefc742b27a71dd2 100644 (file)
@@ -2162,7 +2162,7 @@ QString QCoreApplication::applicationFilePath()
     }
 #endif
 #if defined( Q_OS_UNIX )
-#  if defined(Q_OS_LINUX) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK))
+#  if defined(Q_OS_LINUX) && ((!defined(Q_OS_ANDROID) && !defined(Q_OS_LINUX_TIZEN)) || 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()));