KDevelop API Documentation

ProjectSession Class Reference

This class stores and restores the last situation before the certain project was closed. More...

#include <projectsession.h>

Inheritance diagram for ProjectSession:

QObject List of all members.

Signals

void sig_restoreMainWindowProperties (const QDomElement *el)
void sig_saveMainWindowProperties (QDomElement *el)
void sig_restoreAdditionalViewProperties (const QString &viewName, const QDomElement *el)
void sig_saveAdditionalViewProperties (const QString &viewName, QDomElement *el)

Public Member Functions

 ProjectSession ()
virtual ~ProjectSession ()
bool saveToFile (const QString &fileName, const QDict< KDevPlugin > &projectPlugins)
 Opens the .kdevses file and saves the project session in XML format to it.

bool restoreFromFile (const QString &fileName, const QDict< KDevPlugin > &projectPlugins)
 Opens the .kdevses file and loads the project session from it.


Private Member Functions

void recreateDocs (QDomElement &el)
 Restores the part of the project session that concerns to the documents (files).

void recreateViews (KURL &url, QDomElement docEl)
 recreates views and their properties of a certain document.

void initXMLTree ()
 setup a valid XML file.


Private Attributes

QDomDocument domdoc
 the XML document object controlling the XML tree.


Detailed Description

This class stores and restores the last situation before the certain project was closed.

Session stuff that is not related to a certain project doesn't belong to here; it must be saved in a program session which likely is "kdeveloprc".

Definition at line 34 of file projectsession.h.


Constructor & Destructor Documentation

ProjectSession::ProjectSession  ) 
 

Definition at line 40 of file projectsession.cpp.

References initXMLTree().

ProjectSession::~ProjectSession  )  [virtual]
 

Definition at line 46 of file projectsession.cpp.


Member Function Documentation

void ProjectSession::initXMLTree  )  [private]
 

setup a valid XML file.

Definition at line 51 of file projectsession.cpp.

References domdoc.

Referenced by ProjectSession(), restoreFromFile(), and saveToFile().

void ProjectSession::recreateDocs QDomElement el  )  [private]
 

Restores the part of the project session that concerns to the documents (files).

Definition at line 122 of file projectsession.cpp.

References KDevMainWindow::callCommand(), API::getInstance(), API::mainWindow(), recreateDocs(), and recreateViews().

Referenced by recreateDocs(), and restoreFromFile().

void ProjectSession::recreateViews KURL url,
QDomElement  docEl
[private]
 

recreates views and their properties of a certain document.

Definition at line 159 of file projectsession.cpp.

References PartController::editDocument(), PartController::getInstance(), recreateViews(), PartController::showDocument(), sig_restoreAdditionalViewProperties(), and KURL::url().

Referenced by recreateDocs(), and recreateViews().

bool ProjectSession::restoreFromFile const QString fileName,
const QDict< KDevPlugin > &  projectPlugins
 

Opens the .kdevses file and loads the project session from it.

Definition at line 69 of file projectsession.cpp.

References domdoc, initXMLTree(), KXMLGUIClient::instance(), KInstance::instanceName(), recreateDocs(), restoreFromFile(), and KDevPlugin::restorePartialProjectSession().

Referenced by ProjectManager::loadProject(), and restoreFromFile().

bool ProjectSession::saveToFile const QString sessionFileName,
const QDict< KDevPlugin > &  projectPlugins
 

Opens the .kdevses file and saves the project session in XML format to it.

Todo:
Save relative path for project sharing?

Definition at line 208 of file projectsession.cpp.

References DocumentationPart::context(), KTextEditor::ViewCursorInterface::cursorPosition(), domdoc, initXMLTree(), KXMLGUIClient::instance(), KInstance::instanceName(), KDevPlugin::savePartialProjectSession(), saveToFile(), sig_saveAdditionalViewProperties(), KURL::url(), KParts::ReadOnlyPart::url(), and KParts::Part::widget().

Referenced by ProjectManager::closeProject(), and saveToFile().

void ProjectSession::sig_restoreAdditionalViewProperties const QString viewName,
const QDomElement el
[signal]
 

Referenced by recreateViews().

void ProjectSession::sig_restoreMainWindowProperties const QDomElement el  )  [signal]
 

void ProjectSession::sig_saveAdditionalViewProperties const QString viewName,
QDomElement el
[signal]
 

Referenced by saveToFile().

void ProjectSession::sig_saveMainWindowProperties QDomElement el  )  [signal]
 


Member Data Documentation

QDomDocument ProjectSession::domdoc [private]
 

the XML document object controlling the XML tree.

Definition at line 65 of file projectsession.h.

Referenced by initXMLTree(), restoreFromFile(), and saveToFile().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Oct 19 08:02:05 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003