From: Jean-Marc Lasgouttes Date: Sun, 25 Feb 2007 19:42:48 +0000 (+0000) Subject: * GuiView.C (updateTab): do not update early if current tab has X-Git-Tag: 1.6.10~10680 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=e5a46922e916a06ad1b958d5895cc3cfb4f13d2c;p=features.git * GuiView.C (updateTab): do not update early if current tab has changed (bug 3254) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17344 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiView.C b/src/frontends/qt4/GuiView.C index f1d351badf..c6c68b9a29 100644 --- a/src/frontends/qt4/GuiView.C +++ b/src/frontends/qt4/GuiView.C @@ -107,7 +107,8 @@ public: struct GuiView::GuiViewPrivate { - std::vector tabnames; + vector tabnames; + string cur_title; TabWidget* tabWidget; @@ -488,11 +489,17 @@ void GuiView::updateTab() { std::vector const & names = theBufferList().getFileNames(); + string cur_title; + if (view()->buffer()) { + cur_title = view()->buffer()->fileName(); + } + // avoid unnecessary tabbar rebuild: // check if something has changed - if (d.tabnames == names) + if (d.tabnames == names && d.cur_title == cur_title) return; d.tabnames = names; + d.cur_title = cur_title; QTabBar & tabbar = *d.tabWidget->tabbar; @@ -502,11 +509,6 @@ void GuiView::updateTab() // remove all tab bars d.tabWidget->clearTabbar(); - string cur_title; - if (view()->buffer()) { - cur_title = view()->buffer()->fileName(); - } - // rebuild tabbar and function map from scratch if (names.size() > 1) { for(size_t i = 0; i < names.size(); i++) {