mirror of
https://github.com/KDE/konsole.git
synced 2026-05-03 12:15:33 -04:00
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
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user