summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qlockfile_p.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2017-09-29 23:59:03 -0700
committerThiago Macieira <thiago.macieira@intel.com>2017-10-06 01:53:50 +0000
commit4dca0cba304d18d19ec54df7dac719799279bc18 (patch)
treeaeb047879fe0a351e6207a9f38600e3d259cff19 /src/corelib/io/qlockfile_p.h
parent3399d79773fcd57dded2a184ee94936469538b4b (diff)
QLockInfo: Centralize the management of the lock file's contents
We duplicated both the creation of the contents and the check if the file was stale. Centralize everything in qlockfile.cpp. Change-Id: I0b48fc8e90304e0dacc3fffd14e91174af79841f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/io/qlockfile_p.h')
-rw-r--r--src/corelib/io/qlockfile_p.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/io/qlockfile_p.h b/src/corelib/io/qlockfile_p.h
index a6f61b20f3..b41dfb38ad 100644
--- a/src/corelib/io/qlockfile_p.h
+++ b/src/corelib/io/qlockfile_p.h
@@ -78,12 +78,14 @@ public:
}
QLockFile::LockError tryLock_sys();
bool removeStaleLock();
- bool getLockInfo(qint64 *pid, QString *hostname, QString *appname) const;
+ QByteArray lockFileContents() const;
// Returns \c true if the lock belongs to dead PID, or is old.
// The attempt to delete it will tell us if it was really stale or not, though.
bool isApparentlyStale() const;
+
// used in dbusmenu
Q_CORE_EXPORT static QString processNameByPid(qint64 pid);
+ static bool isProcessRunning(qint64 pid, const QString &appname);
QString fileName;
#ifdef Q_OS_WIN