From d06e6b7d20f12e3fe4fdf7ac8e1c6e99f1c5c4ea Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 12 Nov 2013 18:25:49 -0200 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-ui/mainwindow.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 0b3eea424..a73e89434 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -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(); 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; -- cgit v1.2.3-70-g09d2