diff options
author | Joerg Bornemann <joerg.bornemann@theqtcompany.com> | 2015-06-08 11:27:43 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@theqtcompany.com> | 2015-06-12 08:00:43 +0000 |
commit | 2a0c003e6b9099130e3aed52607ce9553f67bd92 (patch) | |
tree | e387144b79f373386f6f4d259de835c6aa12f06c /src/corelib/io | |
parent | b23f1d2c8beec380e594307fc32f70ad2c7635dd (diff) |
fix decoding of file paths in QLockFilePrivate::processNameByPid
QFile::decodeName should be used instead of a simple QString::fromUtf8.
Change-Id: I76955ab01af55dd373f860f6e3dbffa37e60892c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qlockfile_unix.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/io/qlockfile_unix.cpp b/src/corelib/io/qlockfile_unix.cpp index 6cc590d45f..aeb0a0ef86 100644 --- a/src/corelib/io/qlockfile_unix.cpp +++ b/src/corelib/io/qlockfile_unix.cpp @@ -218,7 +218,7 @@ QString QLockFilePrivate::processNameByPid(qint64 pid) #if defined(Q_OS_OSX) char name[1024]; proc_name(pid, name, sizeof(name) / sizeof(char)); - return QString::fromUtf8(name); + return QFile::decodeName(name); #elif defined(Q_OS_LINUX) if (!QFile::exists(QStringLiteral("/proc/version"))) return QString(); @@ -231,12 +231,12 @@ QString QLockFilePrivate::processNameByPid(qint64 pid) return QStringLiteral("/ERROR/"); } buf[len] = 0; - return QFileInfo(QString::fromUtf8(buf)).fileName(); + return QFileInfo(QFile::decodeName(buf)).fileName(); #elif defined(Q_OS_BSD4) && !defined(Q_OS_IOS) kinfo_proc *proc = kinfo_getproc(pid); if (!proc) return QString(); - QString name = QString::fromUtf8(proc->ki_comm); + QString name = QFile::decodeName(proc->ki_comm); free(proc); return name; #else |