]> git.lyx.org Git - features.git/commitdiff
* GuiView.C (updateTab): do not update early if current tab has
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sun, 25 Feb 2007 19:42:48 +0000 (19:42 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sun, 25 Feb 2007 19:42:48 +0000 (19:42 +0000)
changed (bug 3254)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17344 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiView.C

index f1d351badf910af0c81df2ce9c0d241d8b91d5dd..c6c68b9a295a9fbbd1efc0fca7089510c56780f4 100644 (file)
@@ -107,7 +107,8 @@ public:
 
 struct GuiView::GuiViewPrivate
 {
-       std::vector<std::string> tabnames;
+       vector<string> tabnames;
+       string cur_title;
 
        TabWidget* tabWidget;
 
@@ -488,11 +489,17 @@ void GuiView::updateTab()
 {
        std::vector<string> 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++) {