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:

Inheritance graph
[legend]
Collaboration diagram for ProjectSession:

Collaboration graph
[legend]
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 QValueList< KDevPlugin * > plugins)
 Opens the .kdevses file and saves the project session in XML format to it.
bool restoreFromFile (const QString &fileName, const QValueList< KDevPlugin * > plugins)
 Opens the .kdevses file and loads the project session from it.

Private Slots

void loadDocument ()
 This slot loads one document from _docDataList and sets a timer to load the next.

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, bool activate)
 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.
QValueList< DocumentData_docDataList

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 35 of file projectsession.h.


Constructor & Destructor Documentation

ProjectSession::ProjectSession  ) 
 

Definition at line 41 of file projectsession.cpp.

References initXMLTree().

ProjectSession::~ProjectSession  )  [virtual]
 

Definition at line 47 of file projectsession.cpp.


Member Function Documentation

void ProjectSession::initXMLTree  )  [private]
 

setup a valid XML file.

Definition at line 52 of file projectsession.cpp.

References domdoc.

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

void ProjectSession::loadDocument  )  [private, slot]
 

This slot loads one document from _docDataList and sets a timer to load the next.

Definition at line 415 of file projectsession.cpp.

References _docDataList, ProjectSession::DocumentData::activate, PartController::editDocument(), PartController::editDocumentInternal(), PartController::getInstance(), ProjectSession::DocumentData::line, PartController::showDocument(), ProjectSession::DocumentData::type, and ProjectSession::DocumentData::url.

Referenced by restoreFromFile().

void ProjectSession::recreateDocs QDomElement el  )  [private]
 

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

Definition at line 126 of file projectsession.cpp.

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

Referenced by restoreFromFile().

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

recreates views and their properties of a certain document.

Definition at line 164 of file projectsession.cpp.

References _docDataList, ProjectSession::DocumentData::activate, ProjectSession::DocumentData::line, ProjectSession::DocumentData::type, and ProjectSession::DocumentData::url.

Referenced by recreateDocs().

bool ProjectSession::restoreFromFile const QString fileName,
const QValueList< KDevPlugin * >  plugins
 

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

Definition at line 70 of file projectsession.cpp.

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

Referenced by ProjectManager::slotLoadProject().

bool ProjectSession::saveToFile const QString fileName,
const QValueList< KDevPlugin * >  plugins
 

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

Definition at line 230 of file projectsession.cpp.

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

Referenced by ProjectManager::closeProject().

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

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

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

void ProjectSession::sig_saveMainWindowProperties QDomElement el  )  [signal]
 


Member Data Documentation

QValueList<DocumentData> ProjectSession::_docDataList [private]
 

Definition at line 84 of file projectsession.h.

Referenced by loadDocument(), and recreateViews().

QDomDocument ProjectSession::domdoc [private]
 

the XML document object controlling the XML tree.

Definition at line 73 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.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Feb 22 09:46:06 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003