summaryrefslogtreecommitdiff
path: root/src/plugins/projectexplorer/session_p.h
blob: 40f691ab2d19919b33cb28a2b8b3f62684840f05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#include <utils/persistentsettings.h>

#include <QFutureInterface>

using namespace Utils;

namespace ProjectExplorer {

class SessionManagerPrivate
{
public:
    void restoreStartupSession();

    void restoreValues(const PersistentSettingsReader &reader);
    void restoreSessionValues(const PersistentSettingsReader &reader);
    void restoreEditors();

    bool isStartupSessionRestored();
    void saveSettings();
    void restoreSettings();
    bool isAutoRestoreLastSession();
    void setAutoRestoreLastSession(bool restore);

    static QString windowTitleAddition(const FilePath &filePath);
    static QString sessionTitle(const FilePath &filePath);

    QString m_sessionName = "default";
    bool m_isStartupSessionRestored = false;
    bool m_isAutoRestoreLastSession = false;
    bool m_virginSession = true;
    bool m_loadingSession = false;

    mutable QStringList m_sessions;
    mutable QHash<QString, QDateTime> m_sessionDateTimes;
    QHash<QString, QDateTime> m_lastActiveTimes;

    QMap<QString, QVariant> m_values;
    QMap<QString, QVariant> m_sessionValues;
    QFutureInterface<void> m_future;
    PersistentSettingsWriter *m_writer = nullptr;
};

extern SessionManagerPrivate *sb_d;

} // namespace ProjectExplorer