mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-06 00:10:59 +00:00
* support/filetools.C (makeDisplayPath): if the file is in the lyx
support directory, return as a relative path (enclosed in brackets) * frontends/qt4/GuiView.C (updateTabs): use makeDisplayPath instead of onlyFileName. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17384 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
136403d64b
commit
a7c2c8e3d5
@ -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);
|
||||
|
@ -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, "~");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user