From de19b8fc2d255f0e7bcbd14c31db1317b7f8d479 Mon Sep 17 00:00:00 2001 From: Guillaume Munch Date: Mon, 10 Oct 2016 00:35:35 +0200 Subject: [PATCH] Take advantage of new bufferViewChanged signal --- src/frontends/qt4/GuiDocument.cpp | 7 +++++++ src/frontends/qt4/GuiDocument.h | 3 +++ src/frontends/qt4/GuiView.cpp | 5 ----- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index c0e9605118..09d926029b 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -1456,6 +1456,13 @@ GuiDocument::GuiDocument(GuiView & lv) } +void GuiDocument::on_bufferViewChanged() +{ + if (isVisibleView()) + initialiseParams(""); +} + + void GuiDocument::saveDefaultClicked() { saveDocDefault(); diff --git a/src/frontends/qt4/GuiDocument.h b/src/frontends/qt4/GuiDocument.h index e0d42c9470..c2f944dcb8 100644 --- a/src/frontends/qt4/GuiDocument.h +++ b/src/frontends/qt4/GuiDocument.h @@ -82,6 +82,9 @@ public: /// BufferParams const & params() const { return bp_; } +public Q_SLOTS: + void on_bufferViewChanged();//override + private Q_SLOTS: void updateNumbering(); void change_adaptor(); diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 6445f94e16..9c698cb757 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -1217,11 +1217,6 @@ void GuiView::on_currentWorkAreaChanged(GuiWorkArea * wa) void GuiView::on_bufferViewChanged() { structureChanged(); - - // The document settings needs to be reinitialised. - // TODO: no longer needed now there is bufferViewChanged? - updateDialog("document", ""); - // Buffer-dependent dialogs must be updated. This is done here because // some dialogs require buffer()->text. updateDialogs();