Commit 9cf8c3e1 authored by Martin Koller's avatar Martin Koller
Browse files

forwardport for fix to 63276

save and restore last known window size if the profile currently 
used does not have the size in it. 
 
The position is not stored, as I got the comment that the application 
shall only take care about the size, but the position is a case for 
the window manager. Other KDE apps seem also to only store the size.


svn path=/trunk/KDE/kdebase/konqueror/; revision=623415
parent 18aa722a
......@@ -5358,6 +5358,9 @@ void KonqMainWindow::closeEvent( QCloseEvent *e )
}
}
// save size to have something to restore if the profile does not contain size
saveWindowSize();
hide();
qApp->flush();
}
......@@ -6006,6 +6009,28 @@ KonqView * KonqMainWindow::currentView() const
return m_currentView;
}
void KonqMainWindow::saveWindowSize() const
{
QString savedGroup = KGlobal::config()->group();
KGlobal::config()->setGroup( "KonqMainWindow_Size" );
KParts::MainWindow::saveWindowSize( KGlobal::config() );
KGlobal::config()->setGroup( savedGroup );
KGlobal::config()->sync();
}
void KonqMainWindow::restoreWindowSize()
{
QString savedGroup = KGlobal::config()->group();
KGlobal::config()->setGroup( "KonqMainWindow_Size" );
KParts::MainWindow::restoreWindowSize( KGlobal::config() );
KGlobal::config()->setGroup( savedGroup );
}
#include "konq_mainwindow.moc"
#include "konq_mainwindow_p.moc"
/* vim: et sw=4 ts=4
......
......@@ -329,6 +329,9 @@ public:
QStringList configModules() const;
void saveWindowSize() const;
void restoreWindowSize();
Q_SIGNALS:
void viewAdded( KonqView *view );
void viewRemoved( KonqView *view );
......
......@@ -1289,8 +1289,8 @@ void KonqViewManager::loadViewProfile( KConfig &cfg, const QString & filename,
QSize size = readConfigSize( cfg, m_pMainWindow );
if ( size.isValid() )
m_pMainWindow->resize( size );
else if( resetWindow )
m_pMainWindow->resize( 700, 480 ); // size from KonqMainWindow ctor
else // no size in the profile; use last known size
m_pMainWindow->restoreWindowSize();
}
}
......
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