Commit 272c9f51 authored by Christian Loose's avatar Christian Loose

Fix session management

svn path=/trunk/kdesdk/cervisia/; revision=303734
parent 0a6fc9f9
2004-04-14 Christian Loose <christian.loose@kdemail.net>
* Fix session management
2004-04-13 Christian Loose <christian.loose@kdemail.net>
* Implemented BR #74754:
......
......@@ -49,7 +49,6 @@ CervisiaShell::CervisiaShell( const char *name )
return;
}
setupActions();
//
......@@ -72,7 +71,9 @@ CervisiaShell::CervisiaShell( const char *name )
// and apply the previously saved settings
setAutoSaveSettings("MainWindow", true);
readSettings();
// if the session is restoring, we already read the settings
if( !kapp->isRestored() )
readSettings();
}
CervisiaShell::~CervisiaShell()
......@@ -169,21 +170,19 @@ bool CervisiaShell::queryExit()
}
void CervisiaShell::readSettings()
void CervisiaShell::readProperties(KConfig* config)
{
KConfig* config = KGlobal::config();
config->setGroup("Session");
m_lastOpenDir = config->readPathEntry("Current Directory");
// if the session is restoring, make sure we open the URL
// since it's not handled by main()
if( kapp->isRestored() )
openURL();
}
void CervisiaShell::writeSettings()
void CervisiaShell::saveProperties(KConfig* config)
{
KConfig* config = KGlobal::config();
config->setGroup("Session");
// Save current working directory (if part was created)
if( m_part )
{
......@@ -195,6 +194,24 @@ void CervisiaShell::writeSettings()
}
void CervisiaShell::readSettings()
{
KConfig* config = KGlobal::config();
config->setGroup("Session");
readProperties(config);
}
void CervisiaShell::writeSettings()
{
KConfig* config = KGlobal::config();
config->setGroup("Session");
saveProperties(config);
}
#include "cervisiashell.moc"
......
......@@ -46,6 +46,8 @@ protected:
void setupActions();
bool queryExit();
virtual void readProperties(KConfig* config);
virtual void saveProperties(KConfig* config);
private:
void readSettings();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment