summaryrefslogtreecommitdiffstats
path: root/kate/app/katesession.h
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2015-10-23 17:59:00 +0700
committerMichele Calgaro <michele.calgaro@yahoo.it>2015-10-23 17:59:00 +0700
commitde91a161b1555bca58c4c30c6367dcc38750ca17 (patch)
treeec3ebc67b5391bc395a365ca13f267593eb4f9df /kate/app/katesession.h
parentf0f642f6b23b9a38727944a6db194bf4d16f0377 (diff)
downloadtdebase-de91a161b1555bca58c4c30c6367dcc38750ca17.tar.gz
tdebase-de91a161b1555bca58c4c30c6367dcc38750ca17.zip
Populated session panel. Now able to switch session within the new panel.
*** NOTE *** In this commit both the old and new session managers are active, therefore funny things occasionally happen. Then won't be the case from the next commit since the old session manager will be disabled. Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'kate/app/katesession.h')
-rw-r--r--kate/app/katesession.h37
1 files changed, 32 insertions, 5 deletions
diff --git a/kate/app/katesession.h b/kate/app/katesession.h
index 81a4a77c5..3904f9f0f 100644
--- a/kate/app/katesession.h
+++ b/kate/app/katesession.h
@@ -59,7 +59,7 @@ class KateSession
~KateSession();
/**
- * Returns the session name
+ * @return the session name
*/
const TQString& getSessionName() const { return m_sessionName; }
/**
@@ -69,7 +69,7 @@ class KateSession
void setSessionName(const TQString &sessionName);
/**
- * Returns whether the session is read only or not
+ * @return whether the session is read only or not
*/
bool isReadOnly() const { return m_readOnly; }
/**
@@ -79,16 +79,20 @@ class KateSession
void setReadOnly(bool readOnly);
/**
- * Returns the session filename
+ * @return the session filename
*/
const TQString& getSessionFilename() const { return m_filename; }
/**
* Save session info
- * @return true if the session config is saved, false otherwise
+ * @param saveDocList if true, save also the information about the documents currently open
*/
- void save();
+ void save(bool saveDocList);
+ /**
+ * Activate the session
+ */
+ void activate();
private:
TQString m_sessionName;
@@ -124,6 +128,28 @@ class KateSessionManager
*/
void saveConfig();
+ /**
+ * @return the active session id
+ */
+ int getActiveSessionId() const { return m_activeSessionId; }
+
+ /**
+ * @return a reference to the active session
+ */
+ KateSession* getActiveSession() { return m_sessions[m_activeSessionId]; }
+
+ /**
+ * @return a reference to the sessions list
+ */
+ TQPtrList<KateSession>& getSessionsList() { return m_sessions; }
+
+ /**
+ * Activates the selected session.
+ * @param sessionId the id of the session to activate
+ * @param saveCurr if true, save the current session before activating the new one
+ * @return whether the session was activated or not
+ */
+ bool activateSession(int sessionId, bool saveCurr = true);
private:
KateSessionManager();
@@ -131,6 +157,7 @@ class KateSessionManager
TQString m_baseDir; // folder where session files are stored
TQString m_configFile; // file where the session list config is stored
int m_sessionsCount; // number of sessions
+ int m_activeSessionId; // index of the active session
TQPtrList<KateSession> m_sessions; // session list
KSimpleConfig *m_config; // session manager config