Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qlockfile_p.h
Go to the documentation of this file.
1// Copyright (C) 2013 David Faure <faure+bluesystems@kde.org>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QLOCKFILE_P_H
6#define QLOCKFILE_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtCore/private/qglobal_p.h>
20#include <QtCore/qlockfile.h>
21#include <QtCore/qfile.h>
22
24
26{
27public:
28 explicit QLockFilePrivate(const QString &fn);
30
32 bool removeStaleLock();
34 // Returns \c true if the lock belongs to dead PID, or is old.
35 // The attempt to delete it will tell us if it was really stale or not, though.
36 bool isApparentlyStale() const;
37
38 // used in dbusmenu
39 Q_CORE_EXPORT static QString processNameByPid(qint64 pid);
40 static bool isProcessRunning(qint64 pid, const QString &appname);
41
43
44#ifdef Q_OS_WIN
46#else
48#endif
49
50 std::chrono::milliseconds staleLockTime = std::chrono::seconds{30};
52 bool isLocked = false;
53
54 // used in tst_QLockFile:
55 static auto getLockFileHandle(QLockFile *f)
56 {
57 return f->d_func()->fileHandle;
58 }
59};
60
61QT_END_NAMESPACE
62
63#endif /* QLOCKFILE_P_H */
static auto getLockFileHandle(QLockFile *f)
Definition qlockfile_p.h:55
QLockFilePrivate(const QString &fn)
bool isApparentlyStale() const
static bool isProcessRunning(qint64 pid, const QString &appname)
std::chrono::milliseconds staleLockTime
Definition qlockfile_p.h:50
QByteArray lockFileContents() const
\inmodule QtCore
Definition qlockfile.h:19
static QString machineName()
Definition qlockfile.cpp:40
static bool getLockInfo_helper(const QString &fileName, LockFileInfo *info)