--- kdebase-3.1.93/kcontrol/konq/behaviour.h-- 2003-11-28 14:15:39.000000000 -0500 +++ kdebase-3.1.93/kcontrol/konq/behaviour.h 2003-11-28 14:18:13.000000000 -0500 @@ -69,6 +69,8 @@ private: QCheckBox *cbMoveToTrash; QCheckBox *cbDelete; + QCheckBox *cbSaveSession; + }; #endif // __BEHAVIOUR_H__ --- kdebase-3.1.93/konqueror/konq_mainwindow.cc-- 2003-11-28 14:22:40.000000000 -0500 +++ kdebase-3.1.93/konqueror/konq_mainwindow.cc 2003-11-28 14:25:11.000000000 -0500 @@ -4468,7 +4468,16 @@ void KonqMainWindow::closeEvent( QCloseE } } } - + KConfig *config = KGlobal::config(); + KConfigGroupSaver cs( config, QString::fromLatin1("FMSettings") ); + if ( config->readBoolEntry( "SaveSessionWhenClose", false ) ) + { + KConfig *savesession = new KConfig( "konqueror_save_session" ); + savesession->setGroup( "session" ); + saveProperties( savesession ); + savesession->sync(); + delete savesession; + } hide(); qApp->flushX(); } --- kdebase-3.1.94/kcontrol/konq/behaviour.cpp-- 2003-12-30 01:21:15.200471600 -0500 +++ kdebase-3.1.94/kcontrol/konq/behaviour.cpp 2003-12-30 01:25:02.938850104 -0500 @@ -112,6 +112,9 @@ KBehaviourOptions::KBehaviourOptions(KCo "renamed by clicking directly on the icon name. ")); connect(cbRenameDirectlyIcon, SIGNAL(clicked()), this, SLOT(changed())); + cbSaveSession = new QCheckBox(i18n("Save session"), vbox); + connect(cbSaveSession, SIGNAL(clicked()), this, SLOT(changed())); + QHBoxLayout *hlay = new QHBoxLayout( lay ); label = new QLabel(i18n("Home &URL:"), this); @@ -168,6 +171,7 @@ void KBehaviourOptions::slotShowTips(boo void KBehaviourOptions::load() { g_pConfig->setGroup( groupname ); + cbSaveSession->setChecked( g_pConfig->readBoolEntry("SaveSessionWhenClose", false ) ); cbNewWin->setChecked( g_pConfig->readBoolEntry("AlwaysNewWin", false) ); updateWinPixmap(cbNewWin->isChecked()); @@ -216,6 +220,7 @@ void KBehaviourOptions::defaults() cbMoveToTrash->setChecked( DEFAULT_CONFIRMTRASH ); cbDelete->setChecked( DEFAULT_CONFIRMDELETE ); + cbSaveSession->setChecked( false ); } void KBehaviourOptions::save() @@ -230,6 +235,7 @@ void KBehaviourOptions::save() // g_pConfig->writeEntry( "FileTipsItems", sbToolTip->value() ); g_pConfig->writeEntry( "RenameIconDirectly", cbRenameDirectlyIcon->isChecked()); + g_pConfig->writeEntry( "SaveSessionWhenClose", cbSaveSession->isChecked() ); g_pConfig->setGroup( "Trash" ); g_pConfig->writeEntry( "ConfirmTrash", cbMoveToTrash->isChecked()); --- kdebase-3.1.94/konqueror/konq_main.cc-- 2003-12-30 07:40:09.996257296 -0500 +++ kdebase-3.1.94/konqueror/konq_main.cc 2003-12-30 07:42:58.879583128 -0500 @@ -141,6 +141,21 @@ extern "C" int kdemain( int argc, char * QString profile = "webbrowsing"; QString profilePath = locate( "data", QString::fromLatin1("konqueror/profiles/")+profile ); if ( !profilePath.isEmpty() ) { + KConfigGroupSaver group( app.config(), "FMSettings" ); + bool bSaveSession = app.config()->readBoolEntry( "SaveSessionWhenClose", false ); + if ( bSaveSession ) + { + KonqMainWindow *mainWindow = new KonqMainWindow; + mainWindow->show(); + KConfig *savesession = new KConfig( "konqueror_save_session" ); + if ( savesession->hasGroup("session") ) + { + savesession->setGroup( "session" ); + mainWindow->readProperties( savesession ); + } + delete savesession; + } + else KonqMisc::createBrowserWindowFromProfile( profilePath, profile ); } else { KonqMainWindow *mainWindow = new KonqMainWindow;