Changeset View
Changeset View
Standalone View
Standalone View
src/SessionManager.cpp
Show All 39 Lines | |||||
40 | #include "TerminalDisplay.h" | 40 | #include "TerminalDisplay.h" | ||
41 | 41 | | |||
42 | using namespace Konsole; | 42 | using namespace Konsole; | ||
43 | 43 | | |||
44 | SessionManager::SessionManager() : | 44 | SessionManager::SessionManager() : | ||
45 | _sessions(QList<Session *>()), | 45 | _sessions(QList<Session *>()), | ||
46 | _sessionProfiles(QHash<Session *, Profile::Ptr>()), | 46 | _sessionProfiles(QHash<Session *, Profile::Ptr>()), | ||
47 | _sessionRuntimeProfiles(QHash<Session *, Profile::Ptr>()), | 47 | _sessionRuntimeProfiles(QHash<Session *, Profile::Ptr>()), | ||
48 | _restoreMapping(QHash<Session *, int>()) | 48 | _restoreMapping(QHash<Session *, int>()), | ||
49 | _isClosingAllSessions(false) | ||||
49 | { | 50 | { | ||
50 | ProfileManager *profileMananger = ProfileManager::instance(); | 51 | ProfileManager *profileMananger = ProfileManager::instance(); | ||
51 | connect(profileMananger, &Konsole::ProfileManager::profileChanged, this, | 52 | connect(profileMananger, &Konsole::ProfileManager::profileChanged, this, | ||
52 | &Konsole::SessionManager::profileChanged); | 53 | &Konsole::SessionManager::profileChanged); | ||
53 | } | 54 | } | ||
54 | 55 | | |||
55 | SessionManager::~SessionManager() | 56 | SessionManager::~SessionManager() | ||
56 | { | 57 | { | ||
Show All 10 Lines | |||||
67 | } | 68 | } | ||
68 | 69 | | |||
69 | Q_GLOBAL_STATIC(SessionManager, theSessionManager) | 70 | Q_GLOBAL_STATIC(SessionManager, theSessionManager) | ||
70 | SessionManager* SessionManager::instance() | 71 | SessionManager* SessionManager::instance() | ||
71 | { | 72 | { | ||
72 | return theSessionManager; | 73 | return theSessionManager; | ||
73 | } | 74 | } | ||
74 | 75 | | |||
76 | bool SessionManager::isClosingAllSessions() const | ||||
77 | { | ||||
78 | return _isClosingAllSessions; | ||||
79 | } | ||||
80 | | ||||
75 | void SessionManager::closeAllSessions() | 81 | void SessionManager::closeAllSessions() | ||
76 | { | 82 | { | ||
77 | // close remaining sessions | 83 | _isClosingAllSessions = true; | ||
78 | foreach (Session *session, _sessions) { | 84 | foreach (Session *session, _sessions) { | ||
79 | session->close(); | 85 | session->close(); | ||
80 | } | 86 | } | ||
81 | _sessions.clear(); | 87 | _sessions.clear(); | ||
82 | } | 88 | } | ||
83 | 89 | | |||
84 | const QList<Session *> SessionManager::sessions() const | 90 | const QList<Session *> SessionManager::sessions() const | ||
85 | { | 91 | { | ||
▲ Show 20 Lines • Show All 304 Lines • Show Last 20 Lines |