diff --git a/src/frontends/qt4/GuiView.C b/src/frontends/qt4/GuiView.C index c6c68b9a29..43cd3fca0f 100644 --- a/src/frontends/qt4/GuiView.C +++ b/src/frontends/qt4/GuiView.C @@ -64,9 +64,8 @@ using std::vector; namespace lyx { using support::FileName; -using support::onlyFilename; -using support::subst; using support::libFileSearch; +using support::makeDisplayPath; namespace frontend { @@ -512,7 +511,7 @@ void GuiView::updateTab() // rebuild tabbar and function map from scratch if (names.size() > 1) { for(size_t i = 0; i < names.size(); i++) { - tabbar.addTab(toqstr(onlyFilename(names[i]))); + tabbar.addTab(toqstr(makeDisplayPath(names[i], 30))); // set current tab if (names[i] == cur_title) tabbar.setCurrentIndex(i); diff --git a/src/support/filetools.C b/src/support/filetools.C index 4bc0d99595..4e6224a1ba 100644 --- a/src/support/filetools.C +++ b/src/support/filetools.C @@ -999,9 +999,14 @@ FileName const unzipFile(FileName const & zipped_file, string const & unzipped_f docstring const makeDisplayPath(string const & path, unsigned int threshold) { string str = path; - string const home = package().home_dir(); + + // If file is from LyXDir, display it as if it were relative. + string const system = package().system_support(); + if (prefixIs(str, system)) + return from_utf8("[" + str.erase(0, system.length()) + "]"); // replace /home/blah with ~/ + string const home = package().home_dir(); if (!home.empty() && prefixIs(str, home)) str = subst(str, home, "~");