]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt4/GuiWorkArea.cpp
Better fix for part 3 of bug #7182: LyX truncates file names to about 25 chars.
[features.git] / src / frontends / qt4 / GuiWorkArea.cpp
index 4488c701a8661276f5767b7a9043f289004fb6be..1d627bcf9fec1ea0558ddb19d5b1645ff4c6be8d 100644 (file)
@@ -1578,8 +1578,7 @@ GuiWorkArea * TabWorkArea::addWorkArea(Buffer & buffer, GuiView & view)
        // when hiding it again below).
        if (!(currentWorkArea() && currentWorkArea()->isFullScreen()))
                showBar(count() > 0);
-       int const index = addTab(wa, wa->windowTitle());
-       setTabToolTip(index, wa->windowTitle());
+       addTab(wa, wa->windowTitle());
        QObject::connect(wa, SIGNAL(titleChanged(GuiWorkArea *)),
                this, SLOT(updateTabTexts()));
        if (currentWorkArea() && currentWorkArea()->isFullScreen())
@@ -1868,12 +1867,13 @@ void TabWorkArea::updateTabTexts()
 
        // set new tab titles
        for (It it = paths.begin(); it != paths.end(); ++it) {
-               GuiWorkArea * i_wa = workArea(it->tab());
-               Buffer & buf = i_wa->bufferView().buffer();
+               int const tab_index = it->tab();
+               Buffer const & buf = workArea(tab_index)->bufferView().buffer();
+               QString tab_text = it->displayString();
                if (!buf.fileName().empty() && !buf.isClean())
-                       setTabText(it->tab(), it->displayString() + "*");
-               else
-                       setTabText(it->tab(), it->displayString());
+                       tab_text += "*";
+               setTabText(tab_index, tab_text);
+               setTabToolTip(tab_index, it->abs());
        }
 }