Commit 97840379 authored by Robert Knight's avatar Robert Knight

Use KMainWindow's provided facilities to save and restore window size instead...

Use KMainWindow's provided facilities to save and restore window size instead of trying to record the line/column size of the last closed session which produces the wrong results for various reasons.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=700456
parent 95d479b6
......@@ -83,6 +83,9 @@ MainWindow::MainWindow()
// replace standard shortcuts which cannot be used in a terminal
// (as they are reserved for use by terminal programs)
correctShortcuts();
// enable save and restore of window size
setAutoSaveSettings("MainWindow",true);
}
void MainWindow::correctShortcuts()
......
......@@ -295,8 +295,8 @@ void ViewManager::sessionFinished()
Q_ASSERT(session);
// record the size of the last session
qDebug() << "Recording session size: " << session->size();
setDefaultDisplaySize( session->size().height() , session->size().width() );
//qDebug() << "Recording session size: " << session->size();
//setDefaultDisplaySize( session->size().height() , session->size().width() );
// close attached views
QList<TerminalDisplay*> children = _viewSplitter->findChildren<TerminalDisplay*>();
......@@ -475,12 +475,15 @@ void ViewManager::createView(Session* session)
applyProfile(display,session->profileKey());
// set initial size
#if 0
int defaultLines = 0;
int defaultColumns = 0;
getDefaultDisplaySize(defaultLines,defaultColumns);
qDebug() << "Setting default display size to " << QSize(defaultColumns,defaultLines);
display->setSize(defaultColumns,defaultLines);
#endif
display->setSize(80,40);
ViewProperties* properties = createController(session,display);
_sessionMap[display] = session;
......@@ -498,6 +501,7 @@ void ViewManager::createView(Session* session)
}
}
#if 0
void ViewManager::getDefaultDisplaySize(int& lines , int& columns) const
{
const KConfigGroup group = KGlobal::config()->group("Last Session");
......@@ -510,6 +514,7 @@ void ViewManager::setDefaultDisplaySize(int lines , int columns)
KConfigGroup group = KGlobal::config()->group("Last Session");
group.writeEntry("WindowSize",QSize(columns,lines));
}
#endif
ViewContainer* ViewManager::createContainer(const QString& profileKey)
{
......
......@@ -215,8 +215,8 @@ private:
SessionController* createController(Session* session , TerminalDisplay* display);
// save and load default size for new displays
void setDefaultDisplaySize(int lines , int columns);
void getDefaultDisplaySize(int& lines , int& columns) const;
//void setDefaultDisplaySize(int lines , int columns);
//void getDefaultDisplaySize(int& lines , int& columns) const;
private:
QPointer<ViewSplitter> _viewSplitter;
......
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