Fix loading the information of splitter sizes on empty config.

We previously did did bad things when running with an empty configuration.
This attemps to clean it. We will now correctly handle the splitters in
almost all cases ( if I didn't break anything on the way. )

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2013-11-12 18:25:49 -02:00 committed by Dirk Hohndel
parent b98157a519
commit d06e6b7d20

View file

@ -420,7 +420,7 @@ void MainWindow::on_actionViewAll_triggered()
}
void MainWindow::beginChangeState(CurrentState s){
if (state == VIEWALL){
if (state == VIEWALL && state != s){
saveSplitterSizes();
}
state = s;
@ -566,12 +566,11 @@ void MainWindow::initialUiSetup()
{
QSettings settings;
int i;
settings.beginGroup("MainWindow");
QSize sz = settings.value("size", qApp->desktop()->size()).value<QSize>();
resize(sz);
CurrentState state = (CurrentState) settings.value("lastState", 0).toInt();
state = (CurrentState) settings.value("lastState", 0).toInt();
switch(state){
case VIEWALL: on_actionViewAll_triggered(); break;
case GLOBE_MAXIMIZED : on_actionViewGlobe_triggered(); break;