1/****************************************************************************
2**
3** Copyright (C) 2013 Samuel Gaist <samuel.gaist@edeltech.ch>
4** Copyright (C) 2013 Teo Mrnjavac <teo@kde.org>
5** Copyright (C) 2016 The Qt Company Ltd.
6** Contact: https://www.qt.io/licensing/
7**
8** This file is part of the QtGui module of the Qt Toolkit.
9**
10** $QT_BEGIN_LICENSE:LGPL$
11** Commercial License Usage
12** Licensees holding valid commercial Qt licenses may use this file in
13** accordance with the commercial license agreement provided with the
14** Software or, alternatively, in accordance with the terms contained in
15** a written agreement between you and The Qt Company. For licensing terms
16** and conditions see https://www.qt.io/terms-conditions. For further
17** information use the contact form at https://www.qt.io/contact-us.
18**
19** GNU Lesser General Public License Usage
20** Alternatively, this file may be used under the terms of the GNU Lesser
21** General Public License version 3 as published by the Free Software
22** Foundation and appearing in the file LICENSE.LGPL3 included in the
23** packaging of this file. Please review the following information to
24** ensure the GNU Lesser General Public License version 3 requirements
25** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
26**
27** GNU General Public License Usage
28** Alternatively, this file may be used under the terms of the GNU
29** General Public License version 2.0 or (at your option) the GNU General
30** Public license version 3 or any later version approved by the KDE Free
31** Qt Foundation. The licenses are as published by the Free Software
32** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
33** included in the packaging of this file. Please review the following
34** information to ensure the GNU General Public License requirements will
35** be met: https://www.gnu.org/licenses/gpl-2.0.html and
36** https://www.gnu.org/licenses/gpl-3.0.html.
37**
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#include "qplatformsessionmanager.h"
43
44#include "qguiapplication_p.h"
45
46#ifndef QT_NO_SESSIONMANAGER
47
48QT_BEGIN_NAMESPACE
49
50QPlatformSessionManager::QPlatformSessionManager(const QString &id, const QString &key)
51 : m_sessionId(id),
52 m_sessionKey(key),
53 m_restartHint(QSessionManager::RestartIfRunning)
54{
55}
56
57QPlatformSessionManager::~QPlatformSessionManager()
58{
59}
60
61QString QPlatformSessionManager::sessionId() const
62{
63 return m_sessionId;
64}
65
66QString QPlatformSessionManager::sessionKey() const
67{
68 return m_sessionKey;
69}
70
71bool QPlatformSessionManager::allowsInteraction()
72{
73 return false;
74}
75
76bool QPlatformSessionManager::allowsErrorInteraction()
77{
78 return false;
79}
80
81void QPlatformSessionManager::release()
82{
83}
84
85void QPlatformSessionManager::cancel()
86{
87}
88
89void QPlatformSessionManager::setRestartHint(QSessionManager::RestartHint restartHint)
90{
91 m_restartHint = restartHint;
92}
93
94QSessionManager::RestartHint QPlatformSessionManager::restartHint() const
95{
96 return m_restartHint;
97}
98
99void QPlatformSessionManager::setRestartCommand(const QStringList &command)
100{
101 m_restartCommand = command;
102}
103
104QStringList QPlatformSessionManager::restartCommand() const
105{
106 return m_restartCommand;
107}
108
109void QPlatformSessionManager::setDiscardCommand(const QStringList &command)
110{
111 m_discardCommand = command;
112}
113
114QStringList QPlatformSessionManager::discardCommand() const
115{
116 return m_discardCommand;
117}
118
119void QPlatformSessionManager::setManagerProperty(const QString &name, const QString &value)
120{
121 Q_UNUSED(name)
122 Q_UNUSED(value)
123}
124
125void QPlatformSessionManager::setManagerProperty(const QString &name, const QStringList &value)
126{
127 Q_UNUSED(name)
128 Q_UNUSED(value)
129}
130
131bool QPlatformSessionManager::isPhase2() const
132{
133 return false;
134}
135
136void QPlatformSessionManager::requestPhase2()
137{
138}
139
140void QPlatformSessionManager::appCommitData()
141{
142 qGuiApp->d_func()->commitData();
143}
144
145void QPlatformSessionManager::appSaveState()
146{
147 qGuiApp->d_func()->saveState();
148}
149
150QT_END_NAMESPACE
151
152#endif // QT_NO_SESSIONMANAGER
153

source code of qtbase/src/gui/kernel/qplatformsessionmanager.cpp