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
qcocoasessionmanager.cpp
Go to the documentation of this file.
1// Copyright (C) 2019 Samuel Gaist <samuel.gaist@idiap.ch>
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 QT_NO_SESSIONMANAGER
6#include <private/qsessionmanager_p.h>
7#include <private/qguiapplication_p.h>
8
10#include <qstring.h>
11
13
14QCocoaSessionManager::QCocoaSessionManager(const QString &id, const QString &key)
15 : QPlatformSessionManager(id, key),
16 m_canceled(false)
17{
18}
19
20QCocoaSessionManager::~QCocoaSessionManager()
21{
22}
23
24bool QCocoaSessionManager::allowsInteraction()
25{
26 return false;
27}
28
29void QCocoaSessionManager::resetCancellation()
30{
31 m_canceled = false;
32}
33
34void QCocoaSessionManager::cancel()
35{
36 m_canceled = true;
37}
38
39bool QCocoaSessionManager::wasCanceled() const
40{
41 return m_canceled;
42}
43
44QCocoaSessionManager *QCocoaSessionManager::instance()
45{
46 auto *qGuiAppPriv = QGuiApplicationPrivate::instance();
47 auto *managerPrivate = static_cast<QSessionManagerPrivate*>(QObjectPrivate::get(qGuiAppPriv->session_manager));
48 return static_cast<QCocoaSessionManager *>(managerPrivate->platformSessionManager);
49}
50
51QT_END_NAMESPACE
52
53#endif // QT_NO_SESSIONMANAGER