summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-02-10 15:22:14 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-10 10:45:46 -0800
commit7b46a8fddfce8d9c47c0220b426adcd7b8eecd84 (patch)
tree8ae11a9db6c2267501847cb566cdddf07ff78b64 /qt-ui
parent3912adfe5b8026cfea6afa382f0c5abe01135da4 (diff)
downloadsubsurface-7b46a8fddfce8d9c47c0220b426adcd7b8eecd84.tar.gz
Don't set the state if it's the same
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/mainwindow.cpp5
-rw-r--r--qt-ui/mainwindow.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index a8e2d206f..550fd386f 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -1522,8 +1522,13 @@ void MainWindow::setApplicationState(const QByteArray& state) {
if (!applicationState.keys().contains(state))
return;
+ if (currentApplicationState == state)
+ return;
+
+ currentApplicationState = state;
QList<int> topSize = ui.topSplitter->sizes();
QList<int> bottomSize = ui.bottomSplitter->sizes();
+
// yes, index is zero both times. please don't change it.
if (ui.topSplitter->count() >= 2) {
ui.topSplitter->widget(0)->setParent(NULL);
diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h
index 40c1ad1aa..d91a80171 100644
--- a/qt-ui/mainwindow.h
+++ b/qt-ui/mainwindow.h
@@ -219,6 +219,7 @@ private:
QWidget *bottomRight;
};
QHash<QByteArray, WidgetForBorder> applicationState;
+ QByteArray currentApplicationState;
};
#endif // MAINWINDOW_H