From 7b46a8fddfce8d9c47c0220b426adcd7b8eecd84 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 10 Feb 2015 15:22:14 -0200 Subject: Don't set the state if it's the same Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/mainwindow.cpp | 5 +++++ qt-ui/mainwindow.h | 1 + 2 files changed, 6 insertions(+) (limited to 'qt-ui') 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 topSize = ui.topSplitter->sizes(); QList 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 applicationState; + QByteArray currentApplicationState; }; #endif // MAINWINDOW_H -- cgit v1.2.3-70-g09d2