From 799660d679e5cc1638d403a19871534627e17dc6 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 8 Dec 2021 10:20:56 -0800 Subject: QLockFile/Linux: skip QFileInfo if we're just doing string manipulation Avoids a lot of overhead. Could be even simpler, but we don't need to duplicate QFileSystemEntry. Pick-to: 6.2 Change-Id: Ib42b3adc93bf4d43bd55fffd16beda971e4b2ae7 Reviewed-by: Edward Welbourne Reviewed-by: Igor Kushnir Reviewed-by: Marc Mutz --- src/corelib/io/qlockfile_unix.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/corelib/io') diff --git a/src/corelib/io/qlockfile_unix.cpp b/src/corelib/io/qlockfile_unix.cpp index fb728144a4..4123543c28 100644 --- a/src/corelib/io/qlockfile_unix.cpp +++ b/src/corelib/io/qlockfile_unix.cpp @@ -52,6 +52,7 @@ #include "private/qcore_unix_p.h" // qt_safe_open #include "private/qabstractfileengine_p.h" +#include "private/qfilesystementry_p.h" #include "private/qtemporaryfile_p.h" #if !defined(Q_OS_INTEGRITY) @@ -244,7 +245,7 @@ QString QLockFilePrivate::processNameByPid(qint64 pid) if (buf.endsWith(deleted)) buf.chop(strlen(deleted)); - return QFileInfo(QFile::decodeName(buf)).fileName(); + return QFileSystemEntry(buf, QFileSystemEntry::FromNativePath()).fileName(); #elif defined(Q_OS_HAIKU) thread_info info; if (get_thread_info(pid, &info) != B_OK) -- cgit v1.2.3