aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-11-12 18:25:49 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-13 12:00:17 +0900
commitd06e6b7d20f12e3fe4fdf7ac8e1c6e99f1c5c4ea (patch)
treead00c8de9ec14abdf87646dc7a8e4cdbc4c4d250 /qt-ui/mainwindow.cpp
parentb98157a51932c1bf584eb5ac830c5e3b681c654c (diff)
downloadsubsurface-d06e6b7d20f12e3fe4fdf7ac8e1c6e99f1c5c4ea.tar.gz
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>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r--qt-ui/mainwindow.cpp5
1 files changed, 2 insertions, 3 deletions
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<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;