]> git.lyx.org Git - features.git/commitdiff
* only use path to decide whether a path segment "helped" to make the
authorStefan Schimanski <sts@lyx.org>
Tue, 29 Apr 2008 15:45:06 +0000 (15:45 +0000)
committerStefan Schimanski <sts@lyx.org>
Tue, 29 Apr 2008 15:45:06 +0000 (15:45 +0000)
  string unique in the tabbar. Otherwise the "..." give strange
  behaviour because foo/.../bla.lyx is different from foo/bla.lyx.

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

src/frontends/qt4/GuiWorkArea.cpp

index 3794296b6715db5e3a016311f28ae3f912cd6a3f..8aeb5bd982f2bbc459eabe0d2fbe421ca6f0b376 100644 (file)
@@ -1220,6 +1220,7 @@ TabWorkArea::TabWorkArea(QWidget * parent)
        QTabBar* tb = new DragTabBar;
        connect(tb, SIGNAL(tabMoveRequested(int, int)),
                this, SLOT(moveTab(int, int)));
+       tb->setElideMode(Qt::ElideNone);
        setTabBar(tb);
 
        // make us responsible for the context menu of the tabbar
@@ -1445,17 +1446,14 @@ public:
                }
        }
        ///
-       QString forecastDisplayString() const
+       QString forecastPathString() const
        {
                if (postfix_.count() == 0)
                        return displayString();
                
-               bool postfixLeft = postfix_.count() > 1;
                return prefix_
                        + (dottedPrefix_ ? ".../" : "")
-                       + postfix_.front() + "/"
-                       + (postfixLeft ? ".../" : "")
-                       + filename_;
+                       + postfix_.front() + "/";
        }
        ///
        bool final() const
@@ -1559,25 +1557,25 @@ void TabWorkArea::updateTabTexts()
                        // that it makes the path more unique.
                        somethingChanged = true;
                        It sit = segStart;
-                       QString dspString = sit->forecastDisplayString();
+                       QString dspString = sit->forecastPathString();
                        LYXERR(Debug::GUI, "first forecast found for "
                               << fromqstr(sit->abs())
                               << " => " << fromqstr(dspString));
                        ++sit;
                        bool moreUnique = false;
                        for (; sit != next; ++sit) {
-                               if (sit->forecastDisplayString() != dspString) {
+                               if (sit->forecastPathString() != dspString) {
                                        LYXERR(Debug::GUI, "different forecast found for "
                                               << fromqstr(sit->abs())
                                               << " => "
-                                              << fromqstr(sit->forecastDisplayString()));
+                                              << fromqstr(sit->forecastPathString()));
                                        moreUnique = true;
                                        break;
                                } else {
                                        LYXERR(Debug::GUI, "same forecast found for "
                                               << fromqstr(sit->abs())
                                               << " => "
-                                              << fromqstr(sit->forecastDisplayString()));
+                                              << fromqstr(dspString));
                                }
                        }