QCoreApplication::applicationDirPath/Linux: use /proc/self
There's no need to format our PID there if /proc/self exists and is a link to the current process. Drive-by replace with QStringLiteral, since we won't do any formatting anyway. Change-Id: I7a386ad4f0cb4e2ba629fffd1678fbf0a484ea69 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
This commit is contained in:
parent
e1c1558218
commit
f3446acbcd
@ -2336,7 +2336,7 @@ QString QCoreApplication::applicationFilePath()
|
||||
# if defined(Q_OS_LINUX) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_EMBEDDED))
|
||||
// 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()));
|
||||
QFileInfo pfi(QStringLiteral("/proc/self/exe"));
|
||||
if (pfi.exists() && pfi.isSymLink()) {
|
||||
QCoreApplicationPrivate::setApplicationFilePath(pfi.canonicalFilePath());
|
||||
return *QCoreApplicationPrivate::cachedApplicationFilePath;
|
||||
|
Loading…
Reference in New Issue
Block a user