mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Proper camel case for FileName.absFilename
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34234 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
448fae02c7
commit
62ca7f3ae5
@ -97,25 +97,25 @@ AspellConfig * getConfig()
|
||||
|
||||
if ( strlen(framework) && getPrivateFrameworkPathName(buf, sizeof(buf), framework) ) {
|
||||
lyx::support::FileName const base(buf);
|
||||
lyx::support::FileName const data(base.absFilename() + "/Resources/data");
|
||||
lyx::support::FileName const dict(base.absFilename() + "/Resources/dict");
|
||||
lyx::support::FileName const data(base.absFileName() + "/Resources/data");
|
||||
lyx::support::FileName const dict(base.absFileName() + "/Resources/dict");
|
||||
LYXERR(Debug::FILES, "aspell bundle path: " << buf);
|
||||
have_dict = dict.isDirectory() && data.isDirectory();
|
||||
if (have_dict) {
|
||||
aspell_config_replace(config, "dict-dir", dict.absFilename().c_str());
|
||||
aspell_config_replace(config, "data-dir", data.absFilename().c_str());
|
||||
aspell_config_replace(config, "dict-dir", dict.absFileName().c_str());
|
||||
aspell_config_replace(config, "data-dir", data.absFileName().c_str());
|
||||
LYXERR(Debug::FILES, "aspell dict: " << dict);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if ( !have_dict ) {
|
||||
lyx::support::FileName const base("/opt/local"); // check for mac-ports data
|
||||
lyx::support::FileName const data(base.absFilename() + "/lib/aspell-0.60");
|
||||
lyx::support::FileName const dict(base.absFilename() + "/share/aspell");
|
||||
lyx::support::FileName const data(base.absFileName() + "/lib/aspell-0.60");
|
||||
lyx::support::FileName const dict(base.absFileName() + "/share/aspell");
|
||||
have_dict = dict.isDirectory() && data.isDirectory();
|
||||
if (have_dict) {
|
||||
aspell_config_replace(config, "dict-dir", dict.absFilename().c_str());
|
||||
aspell_config_replace(config, "data-dir", data.absFilename().c_str());
|
||||
aspell_config_replace(config, "dict-dir", dict.absFileName().c_str());
|
||||
aspell_config_replace(config, "data-dir", data.absFileName().c_str());
|
||||
LYXERR(Debug::FILES, "aspell dict: " << dict);
|
||||
}
|
||||
}
|
||||
|
@ -302,13 +302,13 @@ static FileName createBufferTmpDir()
|
||||
// We are in our own directory. Why bother to mangle name?
|
||||
// In fact I wrote this code to circumvent a problematic behaviour
|
||||
// (bug?) of EMX mkstemp().
|
||||
FileName tmpfl(package().temp_dir().absFilename() + "/lyx_tmpbuf" +
|
||||
FileName tmpfl(package().temp_dir().absFileName() + "/lyx_tmpbuf" +
|
||||
convert<string>(count++));
|
||||
|
||||
if (!tmpfl.createDirectory(0777)) {
|
||||
throw ExceptionMessage(WarningException, _("Disk Error: "), bformat(
|
||||
_("LyX could not create the temporary directory '%1$s' (Disk is full maybe?)"),
|
||||
from_utf8(tmpfl.absFilename())));
|
||||
from_utf8(tmpfl.absFileName())));
|
||||
}
|
||||
return tmpfl;
|
||||
}
|
||||
@ -399,7 +399,7 @@ Buffer::~Buffer()
|
||||
if (!d->cloned_buffer_ && !d->temppath.destroyDirectory()) {
|
||||
Alert::warning(_("Could not remove temporary directory"),
|
||||
bformat(_("Could not remove the temporary directory %1$s"),
|
||||
from_utf8(d->temppath.absFilename())));
|
||||
from_utf8(d->temppath.absFileName())));
|
||||
}
|
||||
|
||||
// Remove any previewed LaTeX snippets associated with this buffer.
|
||||
@ -411,7 +411,7 @@ Buffer::~Buffer()
|
||||
|
||||
Buffer * Buffer::clone() const
|
||||
{
|
||||
Buffer * buffer_clone = new Buffer(fileName().absFilename(), false, this);
|
||||
Buffer * buffer_clone = new Buffer(fileName().absFileName(), false, this);
|
||||
buffer_clone->d->macro_lock = true;
|
||||
buffer_clone->d->children_positions.clear();
|
||||
// FIXME (Abdel 09/01/2010): this is too complicated. The whole children_positions and
|
||||
@ -507,7 +507,7 @@ LyXVC const & Buffer::lyxvc() const
|
||||
|
||||
string const Buffer::temppath() const
|
||||
{
|
||||
return d->temppath.absFilename();
|
||||
return d->temppath.absFileName();
|
||||
}
|
||||
|
||||
|
||||
@ -546,7 +546,7 @@ string Buffer::latexName(bool const no_path) const
|
||||
FileName latex_name =
|
||||
makeLatexName(d->exportFileName());
|
||||
return no_path ? latex_name.onlyFileName()
|
||||
: latex_name.absFilename();
|
||||
: latex_name.absFileName();
|
||||
}
|
||||
|
||||
|
||||
@ -559,7 +559,7 @@ FileName Buffer::Impl::exportFileName() const
|
||||
|
||||
string const name = filename.onlyFileNameWithoutExt()
|
||||
+ to_utf8(branch_suffix);
|
||||
FileName res(filename.onlyPath().absFilename() + "/" + name);
|
||||
FileName res(filename.onlyPath().absFileName() + "/" + name);
|
||||
res.changeExtension(filename.extension());
|
||||
|
||||
return res;
|
||||
@ -604,7 +604,7 @@ string Buffer::logName(LogType * type) const
|
||||
LYXERR(Debug::FILES, "Log name calculated as: " << bname);
|
||||
if (type)
|
||||
*type = buildlog;
|
||||
return bname.absFilename();
|
||||
return bname.absFileName();
|
||||
// If we have a newer master file log or only a master log, show this
|
||||
} else if (fname != masterfname
|
||||
&& (!fname.exists() && (masterfname.exists()
|
||||
@ -612,12 +612,12 @@ string Buffer::logName(LogType * type) const
|
||||
LYXERR(Debug::FILES, "Log name calculated as: " << masterfname);
|
||||
if (type)
|
||||
*type = mtype;
|
||||
return masterfname.absFilename();
|
||||
return masterfname.absFileName();
|
||||
}
|
||||
LYXERR(Debug::FILES, "Log name calculated as: " << fname);
|
||||
if (type)
|
||||
*type = latexlog;
|
||||
return fname.absFilename();
|
||||
return fname.absFileName();
|
||||
}
|
||||
|
||||
|
||||
@ -771,7 +771,7 @@ bool Buffer::readDocument(Lexer & lex)
|
||||
if (!params().master.empty()) {
|
||||
FileName const master_file = makeAbsPath(params().master,
|
||||
onlyPath(absFileName()));
|
||||
if (isLyXFilename(master_file.absFilename())) {
|
||||
if (isLyXFilename(master_file.absFileName())) {
|
||||
Buffer * master =
|
||||
checkAndLoadLyXFile(master_file, true);
|
||||
if (master) {
|
||||
@ -877,7 +877,7 @@ Buffer::ReadStatus Buffer::readFile(Lexer & lex, FileName const & filename,
|
||||
if (!lex.checkFor("\\lyxformat")) {
|
||||
Alert::error(_("Document format failure"),
|
||||
bformat(_("%1$s is not a readable LyX document."),
|
||||
from_utf8(filename.absFilename())));
|
||||
from_utf8(filename.absFileName())));
|
||||
return failure;
|
||||
}
|
||||
|
||||
@ -899,7 +899,7 @@ Buffer::ReadStatus Buffer::readFile(Lexer & lex, FileName const & filename,
|
||||
// Save the timestamp and checksum of disk file. If filename is an
|
||||
// emergency file, save the timestamp and checksum of the original lyx file
|
||||
// because isExternallyModified will check for this file. (BUG4193)
|
||||
string diskfile = filename.absFilename();
|
||||
string diskfile = filename.absFileName();
|
||||
if (suffixIs(diskfile, ".emergency"))
|
||||
diskfile = diskfile.substr(0, diskfile.size() - 10);
|
||||
saveCheckSum(FileName(diskfile));
|
||||
@ -918,7 +918,7 @@ Buffer::ReadStatus Buffer::readFile(Lexer & lex, FileName const & filename,
|
||||
" version of LyX, but a temporary"
|
||||
" file for converting it could"
|
||||
" not be created."),
|
||||
from_utf8(filename.absFilename())));
|
||||
from_utf8(filename.absFileName())));
|
||||
return failure;
|
||||
}
|
||||
FileName const lyx2lyx = libFileSearch("lyx2lyx", "lyx2lyx");
|
||||
@ -928,7 +928,7 @@ Buffer::ReadStatus Buffer::readFile(Lexer & lex, FileName const & filename,
|
||||
" version of LyX, but the"
|
||||
" conversion script lyx2lyx"
|
||||
" could not be found."),
|
||||
from_utf8(filename.absFilename())));
|
||||
from_utf8(filename.absFileName())));
|
||||
return failure;
|
||||
}
|
||||
ostringstream command;
|
||||
@ -948,13 +948,13 @@ Buffer::ReadStatus Buffer::readFile(Lexer & lex, FileName const & filename,
|
||||
bformat(_("%1$s is from an older version"
|
||||
" of LyX, but the lyx2lyx script"
|
||||
" failed to convert it."),
|
||||
from_utf8(filename.absFilename())));
|
||||
from_utf8(filename.absFileName())));
|
||||
else
|
||||
Alert::error(_("Conversion script failed"),
|
||||
bformat(_("%1$s is from a newer version"
|
||||
" of LyX and cannot be converted by the"
|
||||
" lyx2lyx script."),
|
||||
from_utf8(filename.absFilename())));
|
||||
from_utf8(filename.absFileName())));
|
||||
return failure;
|
||||
} else {
|
||||
bool const ret = readFile(tmpfile);
|
||||
@ -968,7 +968,7 @@ Buffer::ReadStatus Buffer::readFile(Lexer & lex, FileName const & filename,
|
||||
Alert::error(_("Document format failure"),
|
||||
bformat(_("%1$s ended unexpectedly, which means"
|
||||
" that it is probably corrupted."),
|
||||
from_utf8(filename.absFilename())));
|
||||
from_utf8(filename.absFileName())));
|
||||
return failure;
|
||||
}
|
||||
|
||||
@ -1002,7 +1002,7 @@ bool Buffer::save() const
|
||||
backupName = FileName(absFileName() + '~');
|
||||
if (!lyxrc.backupdir_path.empty()) {
|
||||
string const mangledName =
|
||||
subst(subst(backupName.absFilename(), '/', '!'), ':', '!');
|
||||
subst(subst(backupName.absFileName(), '/', '!'), ':', '!');
|
||||
backupName = FileName(addName(lyxrc.backupdir_path,
|
||||
mangledName));
|
||||
}
|
||||
@ -1012,7 +1012,7 @@ bool Buffer::save() const
|
||||
Alert::error(_("Backup failure"),
|
||||
bformat(_("Cannot create backup file %1$s.\n"
|
||||
"Please check whether the directory exists and is writeable."),
|
||||
from_utf8(backupName.absFilename())));
|
||||
from_utf8(backupName.absFileName())));
|
||||
//LYXERR(Debug::DEBUG, "Fs error: " << fe.what());
|
||||
}
|
||||
}
|
||||
@ -1037,7 +1037,7 @@ bool Buffer::writeFile(FileName const & fname) const
|
||||
bool retval = false;
|
||||
|
||||
docstring const str = bformat(_("Saving document %1$s..."),
|
||||
makeDisplayPath(fname.absFilename()));
|
||||
makeDisplayPath(fname.absFileName()));
|
||||
message(str);
|
||||
|
||||
string const encoded_fname = fname.toSafeFilesystemEncoding(os::CREATE);
|
||||
@ -1092,7 +1092,7 @@ docstring Buffer::emergencyWrite()
|
||||
}
|
||||
|
||||
// 2) In HOME directory.
|
||||
string s = addName(package().home_dir().absFilename(), absFileName());
|
||||
string s = addName(package().home_dir().absFileName(), absFileName());
|
||||
s += ".emergency";
|
||||
lyxerr << ' ' << s << endl;
|
||||
if (writeFile(FileName(s))) {
|
||||
@ -1106,7 +1106,7 @@ docstring Buffer::emergencyWrite()
|
||||
// 3) In "/tmp" directory.
|
||||
// MakeAbsPath to prepend the current
|
||||
// drive letter on OS/2
|
||||
s = addName(package().temp_dir().absFilename(), absFileName());
|
||||
s = addName(package().temp_dir().absFileName(), absFileName());
|
||||
s += ".emergency";
|
||||
lyxerr << ' ' << s << endl;
|
||||
if (writeFile(FileName(s))) {
|
||||
@ -1456,7 +1456,7 @@ void Buffer::makeDocBookFile(FileName const & fname,
|
||||
if (!openFileWrite(ofs, fname))
|
||||
return;
|
||||
|
||||
writeDocBookSource(ofs, fname.absFilename(), runparams, body_only);
|
||||
writeDocBookSource(ofs, fname.absFileName(), runparams, body_only);
|
||||
|
||||
ofs.close();
|
||||
if (ofs.fail())
|
||||
@ -1615,7 +1615,7 @@ int Buffer::runChktex()
|
||||
|
||||
// get LaTeX-Filename
|
||||
FileName const path(temppath());
|
||||
string const name = addName(path.absFilename(), latexName());
|
||||
string const name = addName(path.absFileName(), latexName());
|
||||
string const org_path = filePath();
|
||||
|
||||
PathChanger p(path); // path to LaTeX file
|
||||
@ -2155,7 +2155,7 @@ void Buffer::dispatch(FuncRequest const & func, DispatchResult & dr)
|
||||
docstring text = bformat(
|
||||
_("The file %1$s already exists.\n\n"
|
||||
"Do you want to overwrite that file?"),
|
||||
makeDisplayPath(filename.absFilename()));
|
||||
makeDisplayPath(filename.absFileName()));
|
||||
if (Alert::prompt(_("Overwrite file?"),
|
||||
text, 0, 1, _("&Overwrite"), _("&Cancel")) != 0)
|
||||
break;
|
||||
@ -2391,13 +2391,13 @@ FileName Buffer::fileName() const
|
||||
|
||||
string Buffer::absFileName() const
|
||||
{
|
||||
return d->filename.absFilename();
|
||||
return d->filename.absFileName();
|
||||
}
|
||||
|
||||
|
||||
string Buffer::filePath() const
|
||||
{
|
||||
return d->filename.onlyPath().absFilename() + "/";
|
||||
return d->filename.onlyPath().absFileName() + "/";
|
||||
}
|
||||
|
||||
|
||||
@ -3075,7 +3075,7 @@ public:
|
||||
int start()
|
||||
{
|
||||
command_ = to_utf8(bformat(_("Auto-saving %1$s"),
|
||||
from_utf8(fname_.absFilename())));
|
||||
from_utf8(fname_.absFileName())));
|
||||
return run(DontWait);
|
||||
}
|
||||
private:
|
||||
@ -3367,11 +3367,11 @@ bool Buffer::doExport(string const & format, bool put_in_tempdir,
|
||||
return false;
|
||||
|
||||
if (put_in_tempdir) {
|
||||
result_file = tmp_result_file.absFilename();
|
||||
result_file = tmp_result_file.absFileName();
|
||||
return true;
|
||||
}
|
||||
|
||||
result_file = changeExtension(d->exportFileName().absFilename(), ext);
|
||||
result_file = changeExtension(d->exportFileName().absFileName(), ext);
|
||||
// We need to copy referenced files (e. g. included graphics
|
||||
// if format == "dvi") to the result dir.
|
||||
vector<ExportedFile> const files =
|
||||
@ -3484,7 +3484,7 @@ bool Buffer::readFileHelper(FileName const & s)
|
||||
{
|
||||
// File information about normal file
|
||||
if (!s.exists()) {
|
||||
docstring const file = makeDisplayPath(s.absFilename(), 50);
|
||||
docstring const file = makeDisplayPath(s.absFileName(), 50);
|
||||
docstring text = bformat(_("The specified document\n%1$s"
|
||||
"\ncould not be read."), file);
|
||||
Alert::error(_("Could not read document"), text);
|
||||
@ -3492,10 +3492,10 @@ bool Buffer::readFileHelper(FileName const & s)
|
||||
}
|
||||
|
||||
// Check if emergency save file exists and is newer.
|
||||
FileName const e(s.absFilename() + ".emergency");
|
||||
FileName const e(s.absFileName() + ".emergency");
|
||||
|
||||
if (e.exists() && s.exists() && e.lastModified() > s.lastModified()) {
|
||||
docstring const file = makeDisplayPath(s.absFilename(), 20);
|
||||
docstring const file = makeDisplayPath(s.absFileName(), 20);
|
||||
docstring const text =
|
||||
bformat(_("An emergency save of the document "
|
||||
"%1$s exists.\n\n"
|
||||
@ -3515,7 +3515,7 @@ bool Buffer::readFileHelper(FileName const & s)
|
||||
else
|
||||
str = _("Document was NOT successfully recovered.");
|
||||
str += "\n\n" + bformat(_("Remove emergency file now?\n(%1$s)"),
|
||||
makeDisplayPath(e.absFilename()));
|
||||
makeDisplayPath(e.absFileName()));
|
||||
|
||||
if (!Alert::prompt(_("Delete emergency file?"), str, 1, 1,
|
||||
_("&Remove"), _("&Keep it"))) {
|
||||
@ -3538,10 +3538,10 @@ bool Buffer::readFileHelper(FileName const & s)
|
||||
}
|
||||
|
||||
// Now check if autosave file is newer.
|
||||
FileName const a(onlyPath(s.absFilename()) + '#' + onlyFilename(s.absFilename()) + '#');
|
||||
FileName const a(onlyPath(s.absFileName()) + '#' + onlyFilename(s.absFileName()) + '#');
|
||||
|
||||
if (a.exists() && s.exists() && a.lastModified() > s.lastModified()) {
|
||||
docstring const file = makeDisplayPath(s.absFilename(), 20);
|
||||
docstring const file = makeDisplayPath(s.absFileName(), 20);
|
||||
docstring const text =
|
||||
bformat(_("The backup of the document "
|
||||
"%1$s is newer.\n\nLoad the "
|
||||
@ -3955,7 +3955,7 @@ bool Buffer::reload()
|
||||
removeAutosaveFile();
|
||||
// e.g., read-only status could have changed due to version control
|
||||
d->filename.refresh();
|
||||
docstring const disp_fn = makeDisplayPath(d->filename.absFilename());
|
||||
docstring const disp_fn = makeDisplayPath(d->filename.absFileName());
|
||||
|
||||
bool const success = loadLyXFile(d->filename);
|
||||
if (success) {
|
||||
@ -3995,7 +3995,7 @@ void Buffer::checkChildBuffers()
|
||||
docstring const & incfile = inset_inc->getParam("filename");
|
||||
string oldloc = cbuf->absFileName();
|
||||
string newloc = makeAbsPath(to_utf8(incfile),
|
||||
onlyPath(absFileName())).absFilename();
|
||||
onlyPath(absFileName())).absFileName();
|
||||
if (oldloc == newloc)
|
||||
continue;
|
||||
// the location of the child file is incorrect.
|
||||
|
@ -518,7 +518,7 @@ string BufferParams::readToken(Lexer & lex, string const & token,
|
||||
string tcp;
|
||||
LayoutFileList & bcl = LayoutFileList::get();
|
||||
if (tcp.empty() && !filepath.empty())
|
||||
tcp = bcl.addLocalLayout(classname, filepath.absFilename());
|
||||
tcp = bcl.addLocalLayout(classname, filepath.absFileName());
|
||||
if (!tcp.empty())
|
||||
setBaseClass(tcp);
|
||||
else
|
||||
@ -1309,8 +1309,8 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
|
||||
bool first = true;
|
||||
for (; it != includedChildren_.end() ; ++it) {
|
||||
string incfile = *it;
|
||||
FileName inc = makeAbsPath(incfile, filepath.absFilename());
|
||||
string mangled = DocFileName(changeExtension(inc.absFilename(), ".tex")).
|
||||
FileName inc = makeAbsPath(incfile, filepath.absFileName());
|
||||
string mangled = DocFileName(changeExtension(inc.absFileName(), ".tex")).
|
||||
mangledFilename();
|
||||
if (!features.runparams().nice)
|
||||
incfile = mangled;
|
||||
|
@ -2401,9 +2401,9 @@ void BufferView::insertLyXFile(FileName const & fname)
|
||||
|
||||
// Get absolute path of file and add ".lyx"
|
||||
// to the filename if necessary
|
||||
FileName filename = fileSearch(string(), fname.absFilename(), "lyx");
|
||||
FileName filename = fileSearch(string(), fname.absFileName(), "lyx");
|
||||
|
||||
docstring const disp_fn = makeDisplayPath(filename.absFilename());
|
||||
docstring const disp_fn = makeDisplayPath(filename.absFileName());
|
||||
// emit message signal.
|
||||
message(bformat(_("Inserting document %1$s..."), disp_fn));
|
||||
|
||||
@ -2681,7 +2681,7 @@ docstring BufferView::contentsOfPlaintextFile(FileName const & fname)
|
||||
{
|
||||
if (!fname.isReadableFile()) {
|
||||
docstring const error = from_ascii(strerror(errno));
|
||||
docstring const file = makeDisplayPath(fname.absFilename(), 50);
|
||||
docstring const file = makeDisplayPath(fname.absFileName(), 50);
|
||||
docstring const text =
|
||||
bformat(_("Could not read the specified document\n"
|
||||
"%1$s\ndue to the error: %2$s"), file, error);
|
||||
@ -2690,7 +2690,7 @@ docstring BufferView::contentsOfPlaintextFile(FileName const & fname)
|
||||
}
|
||||
|
||||
if (!fname.isReadableFile()) {
|
||||
docstring const file = makeDisplayPath(fname.absFilename(), 50);
|
||||
docstring const file = makeDisplayPath(fname.absFileName(), 50);
|
||||
docstring const text =
|
||||
bformat(_("%1$s\n is not readable."), file);
|
||||
Alert::error(_("Could not open file"), text);
|
||||
|
@ -284,7 +284,7 @@ bool Converters::convert(Buffer const * buffer,
|
||||
// if no special converter defined, then we take the
|
||||
// default one from ImageMagic.
|
||||
string const from_ext = from_format.empty() ?
|
||||
getExtension(from_file.absFilename()) :
|
||||
getExtension(from_file.absFileName()) :
|
||||
formats.extension(from_format);
|
||||
string const to_ext = formats.extension(to_format);
|
||||
string const command =
|
||||
@ -340,7 +340,7 @@ bool Converters::convert(Buffer const * buffer,
|
||||
// This has the added benefit that all other files that may be
|
||||
// generated by the converter are deleted when LyX closes and do not
|
||||
// clutter the real working directory.
|
||||
string const path(onlyPath(from_file.absFilename()));
|
||||
string const path(onlyPath(from_file.absFileName()));
|
||||
// Prevent the compiler from optimizing away p
|
||||
FileName pp(path);
|
||||
PathChanger p(pp);
|
||||
@ -349,8 +349,8 @@ bool Converters::convert(Buffer const * buffer,
|
||||
errorList.clear();
|
||||
|
||||
bool run_latex = false;
|
||||
string from_base = changeExtension(from_file.absFilename(), "");
|
||||
string to_base = changeExtension(to_file.absFilename(), "");
|
||||
string from_base = changeExtension(from_file.absFileName(), "");
|
||||
string to_base = changeExtension(to_file.absFileName(), "");
|
||||
FileName infile;
|
||||
FileName outfile = from_file;
|
||||
for (Graph::EdgePath::const_iterator cit = edgepath.begin();
|
||||
@ -363,7 +363,7 @@ bool Converters::convert(Buffer const * buffer,
|
||||
}
|
||||
infile = outfile;
|
||||
outfile = FileName(conv.result_dir.empty()
|
||||
? changeExtension(from_file.absFilename(), conv.To->extension())
|
||||
? changeExtension(from_file.absFileName(), conv.To->extension())
|
||||
: addName(subst(conv.result_dir,
|
||||
token_base, from_base),
|
||||
subst(conv.result_file,
|
||||
@ -378,7 +378,7 @@ bool Converters::convert(Buffer const * buffer,
|
||||
if (buffer)
|
||||
outfile = FileName(addName(buffer->temppath(), "tmpfile.out"));
|
||||
else
|
||||
outfile = FileName(addName(package().temp_dir().absFilename(),
|
||||
outfile = FileName(addName(package().temp_dir().absFileName(),
|
||||
"tmpfile.out"));
|
||||
}
|
||||
|
||||
@ -398,16 +398,16 @@ bool Converters::convert(Buffer const * buffer,
|
||||
|
||||
// FIXME UNICODE
|
||||
string const infile2 =
|
||||
to_utf8(makeRelPath(from_utf8(infile.absFilename()), from_utf8(path)));
|
||||
to_utf8(makeRelPath(from_utf8(infile.absFileName()), from_utf8(path)));
|
||||
string const outfile2 =
|
||||
to_utf8(makeRelPath(from_utf8(outfile.absFilename()), from_utf8(path)));
|
||||
to_utf8(makeRelPath(from_utf8(outfile.absFileName()), from_utf8(path)));
|
||||
|
||||
string command = conv.command;
|
||||
command = subst(command, token_from, quoteName(infile2));
|
||||
command = subst(command, token_base, quoteName(from_base));
|
||||
command = subst(command, token_to, quoteName(outfile2));
|
||||
command = subst(command, token_path, quoteName(infile.onlyPath().absFilename()));
|
||||
command = subst(command, token_orig_path, quoteName(orig_from.onlyPath().absFilename()));
|
||||
command = subst(command, token_path, quoteName(infile.onlyPath().absFileName()));
|
||||
command = subst(command, token_orig_path, quoteName(orig_from.onlyPath().absFileName()));
|
||||
command = libScriptSearch(command);
|
||||
|
||||
if (!conv.parselog.empty())
|
||||
@ -512,15 +512,15 @@ bool Converters::move(string const & fmt,
|
||||
return true;
|
||||
|
||||
bool no_errors = true;
|
||||
string const path = onlyPath(from.absFilename());
|
||||
string const base = onlyFilename(removeExtension(from.absFilename()));
|
||||
string const to_base = removeExtension(to.absFilename());
|
||||
string const to_extension = getExtension(to.absFilename());
|
||||
string const path = onlyPath(from.absFileName());
|
||||
string const base = onlyFilename(removeExtension(from.absFileName()));
|
||||
string const to_base = removeExtension(to.absFileName());
|
||||
string const to_extension = getExtension(to.absFileName());
|
||||
|
||||
support::FileNameList const files = FileName(path).dirList(getExtension(from.absFilename()));
|
||||
support::FileNameList const files = FileName(path).dirList(getExtension(from.absFileName()));
|
||||
for (support::FileNameList::const_iterator it = files.begin();
|
||||
it != files.end(); ++it) {
|
||||
string const from2 = it->absFilename();
|
||||
string const from2 = it->absFileName();
|
||||
string const file2 = onlyFilename(from2);
|
||||
if (prefixIs(file2, base)) {
|
||||
string const to2 = changeExtension(
|
||||
|
@ -60,9 +60,9 @@ public:
|
||||
: timestamp(t), checksum(c)
|
||||
{
|
||||
ostringstream os;
|
||||
os << setw(10) << setfill('0') << do_crc(orig_from.absFilename())
|
||||
os << setw(10) << setfill('0') << do_crc(orig_from.absFileName())
|
||||
<< '-' << to_format;
|
||||
cache_name = FileName(addName(cache_dir.absFilename(), os.str()));
|
||||
cache_name = FileName(addName(cache_dir.absFileName(), os.str()));
|
||||
LYXERR(Debug::FILES, "Add file cache item " << orig_from
|
||||
<< ' ' << to_format << ' ' << cache_name
|
||||
<< ' ' << long(timestamp) << ' ' << checksum << '.');
|
||||
@ -105,7 +105,7 @@ public:
|
||||
void ConverterCache::Impl::readIndex()
|
||||
{
|
||||
time_t const now = current_time();
|
||||
FileName const index(addName(cache_dir.absFilename(), "index"));
|
||||
FileName const index(addName(cache_dir.absFileName(), "index"));
|
||||
ifstream is(index.toFilesystemEncoding().c_str());
|
||||
Lexer lex;
|
||||
lex.setStream(is);
|
||||
@ -165,7 +165,7 @@ void ConverterCache::Impl::readIndex()
|
||||
|
||||
void ConverterCache::Impl::writeIndex()
|
||||
{
|
||||
FileName const index(addName(cache_dir.absFilename(), "index"));
|
||||
FileName const index(addName(cache_dir.absFileName(), "index"));
|
||||
ofstream os(index.toFilesystemEncoding().c_str());
|
||||
os.close();
|
||||
if (!index.changePermission(0600))
|
||||
@ -178,7 +178,7 @@ void ConverterCache::Impl::writeIndex()
|
||||
FormatCacheType::const_iterator it2 = format_cache.begin();
|
||||
FormatCacheType::const_iterator const end2 = format_cache.end();
|
||||
for (; it2 != end2; ++it2)
|
||||
os << Lexer::quoteString(it1->first.absFilename())
|
||||
os << Lexer::quoteString(it1->first.absFileName())
|
||||
<< ' ' << it2->first << ' '
|
||||
<< it2->second.timestamp << ' '
|
||||
<< it2->second.checksum << '\n';
|
||||
@ -234,7 +234,7 @@ void ConverterCache::init()
|
||||
return;
|
||||
// We do this here and not in the constructor because package() gets
|
||||
// initialized after all static variables.
|
||||
cache_dir = FileName(addName(package().user_support().absFilename(), "cache"));
|
||||
cache_dir = FileName(addName(package().user_support().absFileName(), "cache"));
|
||||
if (!cache_dir.exists())
|
||||
if (!cache_dir.createDirectory(0700)) {
|
||||
lyxerr << "Could not create cache directory `"
|
||||
@ -265,10 +265,10 @@ void ConverterCache::add(FileName const & orig_from, string const & to_format,
|
||||
|
||||
// FIXME: Should not hardcode this (see bug 3819 for details)
|
||||
if (to_format == "pstex") {
|
||||
FileName const converted_eps(changeExtension(converted_file.absFilename(), "eps"));
|
||||
FileName const converted_eps(changeExtension(converted_file.absFileName(), "eps"));
|
||||
add(orig_from, "eps", converted_eps);
|
||||
} else if (to_format == "pdftex") {
|
||||
FileName const converted_pdf(changeExtension(converted_file.absFilename(), "pdf"));
|
||||
FileName const converted_pdf(changeExtension(converted_file.absFileName(), "pdf"));
|
||||
add(orig_from, "pdf", converted_pdf);
|
||||
}
|
||||
|
||||
@ -294,7 +294,7 @@ void ConverterCache::add(FileName const & orig_from, string const & to_format,
|
||||
}
|
||||
item->checksum = checksum;
|
||||
if (!mover.copy(converted_file, item->cache_name,
|
||||
onlyFilename(item->cache_name.absFilename()))) {
|
||||
onlyFilename(item->cache_name.absFileName()))) {
|
||||
LYXERR(Debug::FILES, "Could not copy file " << orig_from << " to "
|
||||
<< item->cache_name);
|
||||
} else if (!item->cache_name.changePermission(0600)) {
|
||||
@ -305,7 +305,7 @@ void ConverterCache::add(FileName const & orig_from, string const & to_format,
|
||||
CacheItem new_item(orig_from, to_format, timestamp,
|
||||
orig_from.checksum());
|
||||
if (mover.copy(converted_file, new_item.cache_name,
|
||||
onlyFilename(new_item.cache_name.absFilename()))) {
|
||||
onlyFilename(new_item.cache_name.absFileName()))) {
|
||||
if (!new_item.cache_name.changePermission(0600)) {
|
||||
LYXERR(Debug::FILES, "Could not change file mode"
|
||||
<< new_item.cache_name);
|
||||
@ -429,11 +429,11 @@ bool ConverterCache::copy(FileName const & orig_from, string const & to_format,
|
||||
|
||||
// FIXME: Should not hardcode this (see bug 3819 for details)
|
||||
if (to_format == "pstex") {
|
||||
FileName const dest_eps(changeExtension(dest.absFilename(), "eps"));
|
||||
FileName const dest_eps(changeExtension(dest.absFileName(), "eps"));
|
||||
if (!copy(orig_from, "eps", dest_eps))
|
||||
return false;
|
||||
} else if (to_format == "pdftex") {
|
||||
FileName const dest_pdf(changeExtension(dest.absFilename(), "pdf"));
|
||||
FileName const dest_pdf(changeExtension(dest.absFileName(), "pdf"));
|
||||
if (!copy(orig_from, "pdf", dest_pdf))
|
||||
return false;
|
||||
}
|
||||
@ -442,7 +442,7 @@ bool ConverterCache::copy(FileName const & orig_from, string const & to_format,
|
||||
LASSERT(item, /**/);
|
||||
Mover const & mover = getMover(to_format);
|
||||
return mover.copy(item->cache_name, dest,
|
||||
onlyFilename(dest.absFilename()));
|
||||
onlyFilename(dest.absFileName()));
|
||||
}
|
||||
|
||||
} // namespace lyx
|
||||
|
@ -464,7 +464,7 @@ void putClipboard(ParagraphList const & paragraphs,
|
||||
// some kind of garbage collection there, or a shared_ptr, then this
|
||||
// would not be needed.
|
||||
static Buffer * buffer = theBufferList().newBuffer(
|
||||
FileName::tempName().absFilename() + "_clipboard.internal");
|
||||
FileName::tempName().absFileName() + "_clipboard.internal");
|
||||
buffer->setUnnamed(true);
|
||||
buffer->paragraphs() = paragraphs;
|
||||
buffer->inset().setBuffer(*buffer);
|
||||
@ -1027,7 +1027,7 @@ void pasteClipboardGraphics(Cursor & cur, ErrorList & /* errorList */,
|
||||
// create inset for graphic
|
||||
InsetGraphics * inset = new InsetGraphics(cur.buffer());
|
||||
InsetGraphicsParams params;
|
||||
params.filename = support::DocFileName(filename.absFilename());
|
||||
params.filename = support::DocFileName(filename.absFileName());
|
||||
inset->setParams(params);
|
||||
cur.recordUndo();
|
||||
cur.insert(inset);
|
||||
|
@ -130,7 +130,7 @@ bool DepTable::extchanged(string const & ext) const
|
||||
DepList::const_iterator cit = deplist.begin();
|
||||
DepList::const_iterator end = deplist.end();
|
||||
for (; cit != end; ++cit) {
|
||||
if (suffixIs(cit->first.absFilename(), ext)) {
|
||||
if (suffixIs(cit->first.absFileName(), ext)) {
|
||||
if (cit->second.changed())
|
||||
return true;
|
||||
}
|
||||
@ -144,7 +144,7 @@ bool DepTable::ext_exist(string const & ext) const
|
||||
DepList::const_iterator cit = deplist.begin();
|
||||
DepList::const_iterator end = deplist.end();
|
||||
for (; cit != end; ++cit) {
|
||||
if (suffixIs(cit->first.absFilename(), ext)) {
|
||||
if (suffixIs(cit->first.absFileName(), ext)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -163,7 +163,7 @@ void DepTable::remove_files_with_extension(string const & suf)
|
||||
DepList::iterator cit = deplist.begin();
|
||||
DepList::iterator end = deplist.end();
|
||||
while (cit != end) {
|
||||
if (suffixIs(cit->first.absFilename(), suf)) {
|
||||
if (suffixIs(cit->first.absFileName(), suf)) {
|
||||
// Can't erase the current iterator, but we
|
||||
// can increment and then erase.
|
||||
// Deplist is a map so only the erased
|
||||
|
@ -44,7 +44,7 @@ static int checkOverwrite(FileName const & filename)
|
||||
|
||||
docstring text = bformat(_("The file %1$s already exists.\n\n"
|
||||
"Do you want to overwrite that file?"),
|
||||
makeDisplayPath(filename.absFilename()));
|
||||
makeDisplayPath(filename.absFileName()));
|
||||
return Alert::prompt(_("Overwrite file?"),
|
||||
text, 0, 3,
|
||||
_("&Overwrite"), _("Overwrite &all"),
|
||||
@ -72,7 +72,7 @@ CopyStatus copyFile(string const & format,
|
||||
// other directories than the document directory is desired.
|
||||
// Also don't overwrite files that already exist and are identical
|
||||
// to the source files.
|
||||
if (!prefixIs(onlyPath(sourceFile.absFilename()), package().temp_dir().absFilename())
|
||||
if (!prefixIs(onlyPath(sourceFile.absFileName()), package().temp_dir().absFileName())
|
||||
|| sourceFile.checksum() == destFile.checksum())
|
||||
return ret;
|
||||
|
||||
@ -95,8 +95,8 @@ CopyStatus copyFile(string const & format,
|
||||
if (!mover.copy(sourceFile, destFile, latexFile))
|
||||
Alert::error(_("Couldn't copy file"),
|
||||
bformat(_("Copying %1$s to %2$s failed."),
|
||||
makeDisplayPath(sourceFile.absFilename()),
|
||||
makeDisplayPath(destFile.absFilename())));
|
||||
makeDisplayPath(sourceFile.absFileName()),
|
||||
makeDisplayPath(destFile.absFileName())));
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -131,7 +131,7 @@ void ExportData::addExternalFile(string const & format,
|
||||
void ExportData::addExternalFile(string const & format,
|
||||
FileName const & sourceName)
|
||||
{
|
||||
addExternalFile(format, sourceName, onlyFilename(sourceName.absFilename()));
|
||||
addExternalFile(format, sourceName, onlyFilename(sourceName.absFileName()));
|
||||
}
|
||||
|
||||
|
||||
|
@ -134,7 +134,7 @@ string Formats::getFormatFromFile(FileName const & filename) const
|
||||
return format;
|
||||
|
||||
// try to find a format from the file extension.
|
||||
string const ext = getExtension(filename.absFilename());
|
||||
string const ext = getExtension(filename.absFileName());
|
||||
if (!ext.empty()) {
|
||||
// this is ambigous if two formats have the same extension,
|
||||
// but better than nothing
|
||||
@ -263,7 +263,7 @@ bool Formats::view(Buffer const & buffer, FileName const & filename,
|
||||
if (filename.empty() || !filename.exists()) {
|
||||
Alert::error(_("Cannot view file"),
|
||||
bformat(_("File does not exist: %1$s"),
|
||||
from_utf8(filename.absFilename())));
|
||||
from_utf8(filename.absFileName())));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -281,12 +281,12 @@ bool Formats::view(Buffer const & buffer, FileName const & filename,
|
||||
}
|
||||
// viewer is 'auto'
|
||||
if (format->viewer() == "auto") {
|
||||
if (os::autoOpenFile(filename.absFilename(), os::VIEW))
|
||||
if (os::autoOpenFile(filename.absFileName(), os::VIEW))
|
||||
return true;
|
||||
else {
|
||||
Alert::error(_("Cannot view file"),
|
||||
bformat(_("Auto-view file %1$s failed"),
|
||||
from_utf8(filename.absFilename())));
|
||||
from_utf8(filename.absFileName())));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -334,15 +334,15 @@ bool Formats::edit(Buffer const & buffer, FileName const & filename,
|
||||
if (filename.empty() || !filename.exists()) {
|
||||
Alert::error(_("Cannot edit file"),
|
||||
bformat(_("File does not exist: %1$s"),
|
||||
from_utf8(filename.absFilename())));
|
||||
from_utf8(filename.absFileName())));
|
||||
return false;
|
||||
}
|
||||
|
||||
// LinkBack files look like PDF, but have the .linkback extension
|
||||
string const ext = getExtension(filename.absFilename());
|
||||
string const ext = getExtension(filename.absFileName());
|
||||
if (format_name == "pdf" && ext == "linkback") {
|
||||
#ifdef USE_MACOSX_PACKAGING
|
||||
return editLinkBackFile(filename.absFilename().c_str());
|
||||
return editLinkBackFile(filename.absFileName().c_str());
|
||||
#else
|
||||
Alert::error(_("Cannot edit file"),
|
||||
_("LinkBack files can only be edited on Apple Mac OSX."));
|
||||
@ -365,12 +365,12 @@ bool Formats::edit(Buffer const & buffer, FileName const & filename,
|
||||
|
||||
// editor is 'auto'
|
||||
if (format->editor() == "auto") {
|
||||
if (os::autoOpenFile(filename.absFilename(), os::EDIT))
|
||||
if (os::autoOpenFile(filename.absFileName(), os::EDIT))
|
||||
return true;
|
||||
else {
|
||||
Alert::error(_("Cannot edit file"),
|
||||
bformat(_("Auto-edit file %1$s failed"),
|
||||
from_utf8(filename.absFilename())));
|
||||
from_utf8(filename.absFileName())));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ Hunspell * HunspellChecker::Private::addSpeller(string const & lang)
|
||||
|
||||
FileName const affix(hunspell_path + ".aff");
|
||||
FileName const dict(hunspell_path + ".dic");
|
||||
Hunspell * h = new Hunspell(affix.absFilename().c_str(), dict.absFilename().c_str());
|
||||
Hunspell * h = new Hunspell(affix.absFileName().c_str(), dict.absFileName().c_str());
|
||||
spellers_[lang] = h;
|
||||
return h;
|
||||
}
|
||||
|
@ -262,11 +262,11 @@ bool KeyMap::read(FileName const & bind_file, KeyMap * unbind_map)
|
||||
|
||||
lexrc.setFile(bind_file);
|
||||
if (!lexrc.isOK()) {
|
||||
LYXERR0("KeyMap::read: cannot open bind file:" << bind_file.absFilename());
|
||||
LYXERR0("KeyMap::read: cannot open bind file:" << bind_file.absFileName());
|
||||
return false;
|
||||
}
|
||||
|
||||
LYXERR(Debug::KBMAP, "Reading bind file:" << bind_file.absFilename());
|
||||
LYXERR(Debug::KBMAP, "Reading bind file:" << bind_file.absFileName());
|
||||
|
||||
bool error = false;
|
||||
while (lexrc.isOK()) {
|
||||
@ -349,7 +349,7 @@ bool KeyMap::read(FileName const & bind_file, KeyMap * unbind_map)
|
||||
}
|
||||
|
||||
if (error)
|
||||
LYXERR0("KeyMap::read: error while reading bind file:" << bind_file.absFilename());
|
||||
LYXERR0("KeyMap::read: error while reading bind file:" << bind_file.absFileName());
|
||||
return !error;
|
||||
}
|
||||
|
||||
|
@ -98,13 +98,13 @@ LaTeX::LaTeX(string const & latex, OutputParams const & rp,
|
||||
{
|
||||
num_errors = 0;
|
||||
if (prefixIs(cmd, "pdf")) { // Do we use pdflatex ?
|
||||
depfile = FileName(file.absFilename() + ".dep-pdf");
|
||||
depfile = FileName(file.absFileName() + ".dep-pdf");
|
||||
output_file =
|
||||
FileName(changeExtension(file.absFilename(), ".pdf"));
|
||||
FileName(changeExtension(file.absFileName(), ".pdf"));
|
||||
} else {
|
||||
depfile = FileName(file.absFilename() + ".dep");
|
||||
depfile = FileName(file.absFileName() + ".dep");
|
||||
output_file =
|
||||
FileName(changeExtension(file.absFilename(), ".dvi"));
|
||||
FileName(changeExtension(file.absFileName(), ".dvi"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -121,23 +121,23 @@ void LaTeX::deleteFilesOnError() const
|
||||
// but the reason for the error might be in a generated file...
|
||||
|
||||
// bibtex file
|
||||
FileName const bbl(changeExtension(file.absFilename(), ".bbl"));
|
||||
FileName const bbl(changeExtension(file.absFileName(), ".bbl"));
|
||||
bbl.removeFile();
|
||||
|
||||
// makeindex file
|
||||
FileName const ind(changeExtension(file.absFilename(), ".ind"));
|
||||
FileName const ind(changeExtension(file.absFileName(), ".ind"));
|
||||
ind.removeFile();
|
||||
|
||||
// nomencl file
|
||||
FileName const nls(changeExtension(file.absFilename(), ".nls"));
|
||||
FileName const nls(changeExtension(file.absFileName(), ".nls"));
|
||||
nls.removeFile();
|
||||
|
||||
// nomencl file (old version of the package)
|
||||
FileName const gls(changeExtension(file.absFilename(), ".gls"));
|
||||
FileName const gls(changeExtension(file.absFileName(), ".gls"));
|
||||
gls.removeFile();
|
||||
|
||||
// Also remove the aux file
|
||||
FileName const aux(changeExtension(file.absFilename(), ".aux"));
|
||||
FileName const aux(changeExtension(file.absFileName(), ".aux"));
|
||||
aux.removeFile();
|
||||
}
|
||||
|
||||
@ -157,7 +157,7 @@ int LaTeX::run(TeXErrors & terr)
|
||||
bool rerun = false; // rerun requested
|
||||
|
||||
// The class LaTeX does not know the temp path.
|
||||
theBufferList().updateIncludedTeXfiles(FileName::getcwd().absFilename(),
|
||||
theBufferList().updateIncludedTeXfiles(FileName::getcwd().absFileName(),
|
||||
runparams);
|
||||
|
||||
// Never write the depfile if an error was encountered.
|
||||
@ -180,7 +180,7 @@ int LaTeX::run(TeXErrors & terr)
|
||||
|
||||
bool had_depfile = depfile.exists();
|
||||
bool run_bibtex = false;
|
||||
FileName const aux_file(changeExtension(file.absFilename(), "aux"));
|
||||
FileName const aux_file(changeExtension(file.absFileName(), "aux"));
|
||||
|
||||
if (had_depfile) {
|
||||
LYXERR(Debug::DEPEND, "Dependency file exists");
|
||||
@ -252,7 +252,7 @@ int LaTeX::run(TeXErrors & terr)
|
||||
|
||||
// memoir (at least) writes an empty *idx file in the first place.
|
||||
// A second latex run is needed.
|
||||
FileName const idxfile(changeExtension(file.absFilename(), ".idx"));
|
||||
FileName const idxfile(changeExtension(file.absFileName(), ".idx"));
|
||||
rerun = idxfile.exists() && idxfile.isFileEmpty();
|
||||
|
||||
// run makeindex
|
||||
@ -261,13 +261,13 @@ int LaTeX::run(TeXErrors & terr)
|
||||
LYXERR(Debug::LATEX, "Running MakeIndex.");
|
||||
message(_("Running Index Processor."));
|
||||
// onlyFilename() is needed for cygwin
|
||||
rerun |= runMakeIndex(onlyFilename(idxfile.absFilename()),
|
||||
rerun |= runMakeIndex(onlyFilename(idxfile.absFileName()),
|
||||
runparams);
|
||||
}
|
||||
FileName const nlofile(changeExtension(file.absFilename(), ".nlo"));
|
||||
FileName const nlofile(changeExtension(file.absFileName(), ".nlo"));
|
||||
if (head.haschanged(nlofile))
|
||||
rerun |= runMakeIndexNomencl(file, ".nlo", ".nls");
|
||||
FileName const glofile(changeExtension(file.absFilename(), ".glo"));
|
||||
FileName const glofile(changeExtension(file.absFileName(), ".glo"));
|
||||
if (head.haschanged(glofile))
|
||||
rerun |= runMakeIndexNomencl(file, ".glo", ".gls");
|
||||
|
||||
@ -351,7 +351,7 @@ int LaTeX::run(TeXErrors & terr)
|
||||
message(_("Running Index Processor."));
|
||||
// onlyFilename() is needed for cygwin
|
||||
rerun = runMakeIndex(onlyFilename(changeExtension(
|
||||
file.absFilename(), ".idx")), runparams);
|
||||
file.absFileName(), ".idx")), runparams);
|
||||
}
|
||||
|
||||
// I am not pretty sure if need this twice.
|
||||
@ -442,7 +442,7 @@ bool LaTeX::runMakeIndexNomencl(FileName const & file,
|
||||
message(_("Running MakeIndex for nomencl."));
|
||||
string tmp = lyxrc.nomencl_command + ' ';
|
||||
// onlyFilename() is needed for cygwin
|
||||
tmp += quoteName(onlyFilename(changeExtension(file.absFilename(), nlo)));
|
||||
tmp += quoteName(onlyFilename(changeExtension(file.absFileName(), nlo)));
|
||||
tmp += " -o "
|
||||
+ onlyFilename(changeExtension(file.toFilesystemEncoding(), nls));
|
||||
Systemcall one;
|
||||
@ -458,7 +458,7 @@ LaTeX::scanAuxFiles(FileName const & file)
|
||||
|
||||
result.push_back(scanAuxFile(file));
|
||||
|
||||
string const basename = removeExtension(file.absFilename());
|
||||
string const basename = removeExtension(file.absFileName());
|
||||
for (int i = 1; i < 1000; ++i) {
|
||||
FileName const file2(basename
|
||||
+ '.' + convert<string>(i)
|
||||
@ -577,7 +577,7 @@ bool LaTeX::runBibTeX(vector<AuxInfo> const & bibtex_info,
|
||||
tmp += " ";
|
||||
// onlyFilename() is needed for cygwin
|
||||
tmp += quoteName(onlyFilename(removeExtension(
|
||||
it->aux_file.absFilename())));
|
||||
it->aux_file.absFileName())));
|
||||
Systemcall one;
|
||||
one.startscript(Systemcall::Wait, tmp);
|
||||
}
|
||||
@ -592,7 +592,7 @@ int LaTeX::scanLogFile(TeXErrors & terr)
|
||||
int line_count = 1;
|
||||
int retval = NO_ERRORS;
|
||||
string tmp =
|
||||
onlyFilename(changeExtension(file.absFilename(), ".log"));
|
||||
onlyFilename(changeExtension(file.absFileName(), ".log"));
|
||||
LYXERR(Debug::LATEX, "Log file: " << tmp);
|
||||
FileName const fn = FileName(makeAbsPath(tmp));
|
||||
ifstream ifs(fn.toFilesystemEncoding().c_str());
|
||||
@ -924,7 +924,7 @@ void LaTeX::deplog(DepTable & head)
|
||||
// entered into the dependency file.
|
||||
|
||||
string const logfile =
|
||||
onlyFilename(changeExtension(file.absFilename(), ".log"));
|
||||
onlyFilename(changeExtension(file.absFileName(), ".log"));
|
||||
|
||||
static regex const reg1("File: (.+).*");
|
||||
static regex const reg2("No file (.+)(.).*");
|
||||
@ -1047,7 +1047,7 @@ void LaTeX::deplog(DepTable & head)
|
||||
// (7) "\tf@toc=\write<nr>" (for MikTeX)
|
||||
else if (regex_match(token, sub, miktexTocReg))
|
||||
found_file = handleFoundFile(onlyFilename(changeExtension(
|
||||
file.absFilename(), ".toc")), head);
|
||||
file.absFileName(), ".toc")), head);
|
||||
else
|
||||
// not found, but we won't check further
|
||||
// pretend we've been succesfully searching
|
||||
|
@ -106,7 +106,7 @@ bool LayoutFileList::read()
|
||||
|
||||
if (real_file.empty()) {
|
||||
LYXERR0("LayoutFileList::Read: unable to find textclass file `"
|
||||
<< makeDisplayPath(real_file.absFilename(), 1000)
|
||||
<< makeDisplayPath(real_file.absFileName(), 1000)
|
||||
<< "'.");
|
||||
success = false;
|
||||
} else if (!lex.setFile(real_file)) {
|
||||
@ -114,7 +114,7 @@ bool LayoutFileList::read()
|
||||
<< real_file << '.');
|
||||
} else if (!lex.isOK()) {
|
||||
LYXERR0("LayoutFileList::Read: unable to open textclass file `"
|
||||
<< makeDisplayPath(real_file.absFilename(), 1000)
|
||||
<< makeDisplayPath(real_file.absFileName(), 1000)
|
||||
<< "'\nCheck your installation.");
|
||||
} else {
|
||||
// we have a file we can read.
|
||||
@ -233,7 +233,7 @@ LayoutFileIndex LayoutFileList::addEmptyClass(string const & textclass)
|
||||
LayoutFile * tc = new LayoutFile(textclass, textclass,
|
||||
"Unknown text class " + textclass, textclass + ".cls", true);
|
||||
|
||||
if (!tc->load(tempLayout.absFilename())) {
|
||||
if (!tc->load(tempLayout.absFileName())) {
|
||||
// The only way this happens is because the hardcoded layout file
|
||||
// aboveis wrong or stdclass.inc cannot be found. So try again
|
||||
// without stdclass.inc.
|
||||
@ -244,7 +244,7 @@ LayoutFileIndex LayoutFileList::addEmptyClass(string const & textclass)
|
||||
"Input stdclass.inc\n\n"
|
||||
<< layoutpost;
|
||||
ofs2.close();
|
||||
if (!tc->load(tempLayout.absFilename())) {
|
||||
if (!tc->load(tempLayout.absFileName())) {
|
||||
// This can only happen if the hardcoded file above is wrong.
|
||||
LASSERT(false, /* */);
|
||||
}
|
||||
|
@ -250,7 +250,7 @@ bool Lexer::Pimpl::setFile(FileName const & filename)
|
||||
"file or stream already set.");
|
||||
gz_.open(filename.toFilesystemEncoding().c_str(), ios::in);
|
||||
is.rdbuf(&gz_);
|
||||
name = filename.absFilename();
|
||||
name = filename.absFileName();
|
||||
lineno = 0;
|
||||
if (!gz_.is_open() || !is.good())
|
||||
return false;
|
||||
@ -266,7 +266,7 @@ bool Lexer::Pimpl::setFile(FileName const & filename)
|
||||
}
|
||||
fb_.open(filename.toSafeFilesystemEncoding().c_str(), ios::in);
|
||||
is.rdbuf(&fb_);
|
||||
name = filename.absFilename();
|
||||
name = filename.absFileName();
|
||||
lineno = 0;
|
||||
if (!fb_.is_open() || !is.good())
|
||||
return false;
|
||||
|
34
src/LyX.cpp
34
src/LyX.cpp
@ -361,7 +361,7 @@ int LyX::exec(int & argc, char * argv[])
|
||||
// such that package().temp_dir() is properly initialized.
|
||||
pimpl_->lyx_server_.reset(new Server(lyxrc.lyxpipes));
|
||||
pimpl_->lyx_socket_.reset(new ServerSocket(
|
||||
FileName(package().temp_dir().absFilename() + "/lyxsocket")));
|
||||
FileName(package().temp_dir().absFileName() + "/lyxsocket")));
|
||||
|
||||
// Start the real execution loop.
|
||||
exit_status = pimpl_->application_->exec();
|
||||
@ -395,19 +395,19 @@ void LyX::prepareExit()
|
||||
|
||||
// do any other cleanup procedures now
|
||||
if (package().temp_dir() != package().system_temp_dir()) {
|
||||
string const abs_tmpdir = package().temp_dir().absFilename();
|
||||
if (!contains(package().temp_dir().absFilename(), "lyx_tmpdir")) {
|
||||
string const abs_tmpdir = package().temp_dir().absFileName();
|
||||
if (!contains(package().temp_dir().absFileName(), "lyx_tmpdir")) {
|
||||
docstring const msg =
|
||||
bformat(_("%1$s does not appear like a LyX created temporary directory."),
|
||||
from_utf8(abs_tmpdir));
|
||||
Alert::warning(_("Cannot remove temporary directory"), msg);
|
||||
} else {
|
||||
LYXERR(Debug::INFO, "Deleting tmp dir "
|
||||
<< package().temp_dir().absFilename());
|
||||
<< package().temp_dir().absFileName());
|
||||
if (!package().temp_dir().destroyDirectory()) {
|
||||
docstring const msg =
|
||||
bformat(_("Unable to remove the temporary directory %1$s"),
|
||||
from_utf8(package().temp_dir().absFilename()));
|
||||
from_utf8(package().temp_dir().absFileName()));
|
||||
Alert::warning(_("Unable to remove temporary directory"), msg);
|
||||
}
|
||||
}
|
||||
@ -456,7 +456,7 @@ int LyX::init(int & argc, char * argv[])
|
||||
|
||||
if (first_start) {
|
||||
pimpl_->files_to_load_.push_back(
|
||||
i18nLibFileSearch("examples", "splash.lyx").absFilename());
|
||||
i18nLibFileSearch("examples", "splash.lyx").absFileName());
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
@ -479,7 +479,7 @@ bool LyX::loadFiles()
|
||||
if (fname.empty())
|
||||
continue;
|
||||
|
||||
Buffer * buf = pimpl_->buffer_list_.newBuffer(fname.absFilename(), false);
|
||||
Buffer * buf = pimpl_->buffer_list_.newBuffer(fname.absFileName(), false);
|
||||
if (buf->loadLyXFile(fname)) {
|
||||
ErrorList const & el = buf->errorList("Parse");
|
||||
if (!el.empty())
|
||||
@ -695,15 +695,15 @@ bool LyX::init()
|
||||
signal(SIGTERM, error_handler);
|
||||
// SIGPIPE can be safely ignored.
|
||||
|
||||
lyxrc.tempdir_path = package().temp_dir().absFilename();
|
||||
lyxrc.document_path = package().document_dir().absFilename();
|
||||
lyxrc.tempdir_path = package().temp_dir().absFileName();
|
||||
lyxrc.document_path = package().document_dir().absFileName();
|
||||
|
||||
if (lyxrc.example_path.empty()) {
|
||||
lyxrc.example_path = addPath(package().system_support().absFilename(),
|
||||
lyxrc.example_path = addPath(package().system_support().absFileName(),
|
||||
"examples");
|
||||
}
|
||||
if (lyxrc.template_path.empty()) {
|
||||
lyxrc.template_path = addPath(package().system_support().absFilename(),
|
||||
lyxrc.template_path = addPath(package().system_support().absFileName(),
|
||||
"templates");
|
||||
}
|
||||
|
||||
@ -723,7 +723,7 @@ bool LyX::init()
|
||||
// Add the directory containing the LyX executable to the path
|
||||
// so that LyX can find things like tex2lyx.
|
||||
if (package().build_support().empty())
|
||||
prependEnvPath("PATH", package().binary_dir().absFilename());
|
||||
prependEnvPath("PATH", package().binary_dir().absFileName());
|
||||
#endif
|
||||
if (!lyxrc.path_prefix.empty())
|
||||
prependEnvPath("PATH", lyxrc.path_prefix);
|
||||
@ -814,7 +814,7 @@ bool LyX::init()
|
||||
}
|
||||
|
||||
LYXERR(Debug::INIT, "LyX tmp dir: `"
|
||||
<< package().temp_dir().absFilename() << '\'');
|
||||
<< package().temp_dir().absFileName() << '\'');
|
||||
|
||||
LYXERR(Debug::INIT, "Reading session information '.lyx/session'...");
|
||||
pimpl_->session_.reset(new Session(lyxrc.num_lastfiles));
|
||||
@ -853,13 +853,13 @@ static bool needsUpdate(string const & file)
|
||||
static bool firstrun = true;
|
||||
if (firstrun) {
|
||||
configure_script =
|
||||
FileName(addName(package().system_support().absFilename(),
|
||||
FileName(addName(package().system_support().absFileName(),
|
||||
"configure.py"));
|
||||
firstrun = false;
|
||||
}
|
||||
|
||||
FileName absfile =
|
||||
FileName(addName(package().user_support().absFilename(), file));
|
||||
FileName(addName(package().user_support().absFileName(), file));
|
||||
return !absfile.exists()
|
||||
|| configure_script.lastModified() > absfile.lastModified();
|
||||
}
|
||||
@ -888,7 +888,7 @@ bool LyX::queryUserLyXDir(bool explicit_userdir)
|
||||
bformat(_("You have specified a non-existent user "
|
||||
"LyX directory, %1$s.\n"
|
||||
"It is needed to keep your own configuration."),
|
||||
from_utf8(package().user_support().absFilename())),
|
||||
from_utf8(package().user_support().absFileName())),
|
||||
1, 0,
|
||||
_("&Create directory"),
|
||||
_("&Exit LyX"))) {
|
||||
@ -897,7 +897,7 @@ bool LyX::queryUserLyXDir(bool explicit_userdir)
|
||||
}
|
||||
|
||||
lyxerr << to_utf8(bformat(_("LyX: Creating directory %1$s"),
|
||||
from_utf8(sup.absFilename()))) << endl;
|
||||
from_utf8(sup.absFileName()))) << endl;
|
||||
|
||||
if (!sup.createDirectory(0755)) {
|
||||
// Failed, so let's exit.
|
||||
|
@ -433,7 +433,7 @@ int LyXRC::read(Lexer & lexrc)
|
||||
lexrc.getString());
|
||||
if (read(tmp)) {
|
||||
lexrc.printError("Error reading "
|
||||
"included file: " + tmp.absFilename());
|
||||
"included file: " + tmp.absFileName());
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -80,7 +80,7 @@ bool LyXVC::file_not_found_hook(FileName const & fn)
|
||||
// Seems there is no reasonable scenario for adding implementation
|
||||
// of retrieve for cvs or svn.
|
||||
if (!RCS::findFile(fn).empty()) {
|
||||
docstring const file = makeDisplayPath(fn.absFilename(), 20);
|
||||
docstring const file = makeDisplayPath(fn.absFileName(), 20);
|
||||
docstring const text =
|
||||
bformat(_("Do you want to retrieve the document"
|
||||
" %1$s from version control?"), file);
|
||||
@ -120,8 +120,8 @@ bool LyXVC::registrer()
|
||||
// it is very likely here that the vcs is not created yet...
|
||||
if (!vcs) {
|
||||
//check in the root directory of the document
|
||||
FileName const cvs_entries(onlyPath(filename.absFilename()) + "/CVS/Entries");
|
||||
FileName const svn_entries(onlyPath(filename.absFilename()) + "/.svn/entries");
|
||||
FileName const cvs_entries(onlyPath(filename.absFileName()) + "/CVS/Entries");
|
||||
FileName const svn_entries(onlyPath(filename.absFileName()) + "/.svn/entries");
|
||||
|
||||
if (svn_entries.isReadableFile()) {
|
||||
LYXERR(Debug::LYXVC, "LyXVC: registering "
|
||||
@ -278,7 +278,7 @@ string const LyXVC::getLogFile() const
|
||||
}
|
||||
LYXERR(Debug::LYXVC, "Generating logfile " << tmpf);
|
||||
vcs->getLog(tmpf);
|
||||
return tmpf.absFilename();
|
||||
return tmpf.absFileName();
|
||||
}
|
||||
|
||||
|
||||
|
@ -120,7 +120,7 @@ bool ModuleList::read()
|
||||
|
||||
if (real_file.empty()) {
|
||||
LYXERR0("unable to find modules file `"
|
||||
<< to_utf8(makeDisplayPath(real_file.absFilename(), 1000))
|
||||
<< to_utf8(makeDisplayPath(real_file.absFileName(), 1000))
|
||||
<< "'.\nNo modules will be available.");
|
||||
return false;
|
||||
}
|
||||
@ -134,7 +134,7 @@ bool ModuleList::read()
|
||||
|
||||
if (!lex.isOK()) {
|
||||
LYXERR0("unable to open modules file `"
|
||||
<< to_utf8(makeDisplayPath(real_file.absFilename(), 1000))
|
||||
<< to_utf8(makeDisplayPath(real_file.absFileName(), 1000))
|
||||
<< "'\nNo modules will be available.");
|
||||
return false;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ namespace lyx {
|
||||
|
||||
bool Mover::copy(FileName const & from, FileName const & to) const
|
||||
{
|
||||
return do_copy(from, to, to.absFilename());
|
||||
return do_copy(from, to, to.absFileName());
|
||||
}
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ bool Mover::do_copy(FileName const & from, FileName const & to,
|
||||
bool Mover::rename(FileName const & from,
|
||||
FileName const & to) const
|
||||
{
|
||||
return do_rename(from, to, to.absFilename());
|
||||
return do_rename(from, to, to.absFileName());
|
||||
}
|
||||
|
||||
|
||||
|
@ -60,7 +60,7 @@ ServerSocket::ServerSocket(FileName const & addr)
|
||||
// Needed by xdvi
|
||||
setEnv("XEDITOR", "lyxclient -g %f %l");
|
||||
// Needed by lyxclient
|
||||
setEnv("LYXSOCKET", address_.absFilename());
|
||||
setEnv("LYXSOCKET", address_.absFileName());
|
||||
|
||||
theApp()->registerSocketCallback(
|
||||
fd_,
|
||||
@ -68,7 +68,7 @@ ServerSocket::ServerSocket(FileName const & addr)
|
||||
);
|
||||
|
||||
LYXERR(Debug::LYXSERVER, "lyx: New server socket "
|
||||
<< fd_ << ' ' << address_.absFilename());
|
||||
<< fd_ << ' ' << address_.absFileName());
|
||||
}
|
||||
|
||||
|
||||
@ -90,7 +90,7 @@ ServerSocket::~ServerSocket()
|
||||
|
||||
string const ServerSocket::address() const
|
||||
{
|
||||
return address_.absFilename();
|
||||
return address_.absFileName();
|
||||
}
|
||||
|
||||
|
||||
@ -189,7 +189,7 @@ void ServerSocket::writeln(string const & line)
|
||||
// void ServerSocket::dump() const
|
||||
// {
|
||||
// lyxerr << "ServerSocket debug dump.\n"
|
||||
// << "fd = " << fd_ << ", address = " << address_.absFilename() << ".\n"
|
||||
// << "fd = " << fd_ << ", address = " << address_.absFileName() << ".\n"
|
||||
// << "Clients: " << clients.size() << ".\n";
|
||||
// map<int, shared_ptr<LyXDataSocket> >::const_iterator client = clients.begin();
|
||||
// map<int, shared_ptr<LyXDataSocket> >::const_iterator end = clients.end();
|
||||
|
@ -381,7 +381,7 @@ Session::Session(unsigned int num_last_files, unsigned int num_last_commands) :
|
||||
{
|
||||
// locate the session file
|
||||
// note that the session file name 'session' is hard-coded
|
||||
session_file = FileName(addName(package().user_support().absFilename(), "session"));
|
||||
session_file = FileName(addName(package().user_support().absFileName(), "session"));
|
||||
//
|
||||
readFile();
|
||||
}
|
||||
|
@ -265,7 +265,7 @@ TextClass::ReturnValues TextClass::readWithoutConv(FileName const & filename, Re
|
||||
}
|
||||
|
||||
LYXERR(Debug::TCLASS, "Reading " + translateRT(rt) + ": " +
|
||||
to_utf8(makeDisplayPath(filename.absFilename())));
|
||||
to_utf8(makeDisplayPath(filename.absFileName())));
|
||||
|
||||
// Define the plain layout used in table cells, ert, etc. Note that
|
||||
// we do this before loading any layout file, so that classes can
|
||||
@ -278,7 +278,7 @@ TextClass::ReturnValues TextClass::readWithoutConv(FileName const & filename, Re
|
||||
ReturnValues retval = read(lexrc, rt);
|
||||
|
||||
LYXERR(Debug::TCLASS, "Finished reading " + translateRT(rt) + ": " +
|
||||
to_utf8(makeDisplayPath(filename.absFilename())));
|
||||
to_utf8(makeDisplayPath(filename.absFileName())));
|
||||
|
||||
return retval;
|
||||
}
|
||||
@ -406,7 +406,7 @@ TextClass::ReturnValues TextClass::read(Lexer & lexrc, ReadType rt)
|
||||
lexrc.printError("Could not find input file: " + inc);
|
||||
error = true;
|
||||
} else if (!read(tmp, MERGE)) {
|
||||
lexrc.printError("Error reading input file: " + tmp.absFilename());
|
||||
lexrc.printError("Error reading input file: " + tmp.absFileName());
|
||||
error = true;
|
||||
}
|
||||
}
|
||||
@ -1147,7 +1147,7 @@ bool TextClass::load(string const & path) const
|
||||
|
||||
if (!loaded_) {
|
||||
lyxerr << "Error reading `"
|
||||
<< to_utf8(makeDisplayPath(layout_file.absFilename()))
|
||||
<< to_utf8(makeDisplayPath(layout_file.absFileName()))
|
||||
<< "'\n(Check `" << name_
|
||||
<< "')\nCheck your installation and "
|
||||
"try Options/Reconfigure..."
|
||||
|
@ -94,7 +94,7 @@ pair<string, string> Thesaurus::Private::getThesaurus(docstring const & lang)
|
||||
it != idx_files.end(); ++it) {
|
||||
LYXERR(Debug::FILES, "found thesaurus idx file: " << it->onlyFileName());
|
||||
if (contains(it->onlyFileName(), to_ascii(lang))) {
|
||||
idx = it->absFilename();
|
||||
idx = it->absFileName();
|
||||
LYXERR(Debug::FILES, "selected thesaurus idx file: " << idx);
|
||||
break;
|
||||
}
|
||||
@ -104,7 +104,7 @@ pair<string, string> Thesaurus::Private::getThesaurus(docstring const & lang)
|
||||
it != data_files.end(); ++it) {
|
||||
LYXERR(Debug::FILES, "found thesaurus data file: " << it->onlyFileName());
|
||||
if (contains(it->onlyFileName(), to_ascii(lang))) {
|
||||
data = it->absFilename();
|
||||
data = it->absFileName();
|
||||
LYXERR(Debug::FILES, "selected thesaurus data file: " << data);
|
||||
break;
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ RCS::RCS(FileName const & m)
|
||||
FileName const RCS::findFile(FileName const & file)
|
||||
{
|
||||
// Check if *,v exists.
|
||||
FileName tmp(file.absFilename() + ",v");
|
||||
FileName tmp(file.absFileName() + ",v");
|
||||
LYXERR(Debug::LYXVC, "LyXVC: Checking if file is under rcs: " << tmp);
|
||||
if (tmp.isReadableFile()) {
|
||||
LYXERR(Debug::LYXVC, "Yes, " << file << " is under rcs.");
|
||||
@ -92,7 +92,7 @@ FileName const RCS::findFile(FileName const & file)
|
||||
}
|
||||
|
||||
// Check if RCS/*,v exists.
|
||||
tmp = FileName(addName(addPath(onlyPath(file.absFilename()), "RCS"), file.absFilename()) + ",v");
|
||||
tmp = FileName(addName(addPath(onlyPath(file.absFileName()), "RCS"), file.absFileName()) + ",v");
|
||||
LYXERR(Debug::LYXVC, "LyXVC: Checking if file is under rcs: " << tmp);
|
||||
if (tmp.isReadableFile()) {
|
||||
LYXERR(Debug::LYXVC, "Yes, " << file << " is under rcs.");
|
||||
@ -328,7 +328,7 @@ bool RCS::prepareFileRevision(string const &revis, string & f)
|
||||
if (tmpf.isFileEmpty())
|
||||
return false;
|
||||
|
||||
f = tmpf.absFilename();
|
||||
f = tmpf.absFileName();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -357,8 +357,8 @@ FileName const CVS::findFile(FileName const & file)
|
||||
{
|
||||
// First we look for the CVS/Entries in the same dir
|
||||
// where we have file.
|
||||
FileName const entries(onlyPath(file.absFilename()) + "/CVS/Entries");
|
||||
string const tmpf = '/' + onlyFilename(file.absFilename()) + '/';
|
||||
FileName const entries(onlyPath(file.absFileName()) + "/CVS/Entries");
|
||||
string const tmpf = '/' + onlyFilename(file.absFileName()) + '/';
|
||||
LYXERR(Debug::LYXVC, "LyXVC: Checking if file is under cvs in `" << entries
|
||||
<< "' for `" << tmpf << '\'');
|
||||
if (entries.isReadableFile()) {
|
||||
@ -382,7 +382,7 @@ void CVS::scanMaster()
|
||||
LYXERR(Debug::LYXVC, "LyXVC::CVS: scanMaster. \n Checking: " << master_);
|
||||
// Ok now we do the real scan...
|
||||
ifstream ifs(master_.toFilesystemEncoding().c_str());
|
||||
string tmpf = '/' + onlyFilename(file_.absFilename()) + '/';
|
||||
string tmpf = '/' + onlyFilename(file_.absFileName()) + '/';
|
||||
LYXERR(Debug::LYXVC, "\tlooking for `" << tmpf << '\'');
|
||||
string line;
|
||||
static regex const reg("/(.*)/(.*)/(.*)/(.*)/(.*)");
|
||||
@ -574,8 +574,8 @@ FileName const SVN::findFile(FileName const & file)
|
||||
{
|
||||
// First we look for the .svn/entries in the same dir
|
||||
// where we have file.
|
||||
FileName const entries(onlyPath(file.absFilename()) + "/.svn/entries");
|
||||
string const tmpf = onlyFilename(file.absFilename());
|
||||
FileName const entries(onlyPath(file.absFileName()) + "/.svn/entries");
|
||||
string const tmpf = onlyFilename(file.absFileName());
|
||||
LYXERR(Debug::LYXVC, "LyXVC: Checking if file is under svn in `" << entries
|
||||
<< "' for `" << tmpf << '\'');
|
||||
if (entries.isReadableFile()) {
|
||||
@ -814,7 +814,7 @@ string SVN::repoUpdate()
|
||||
int ret = frontend::Alert::prompt(_("Changes detected"),
|
||||
text, 0, 1, _("&Yes"), _("&No"), _("View &Log ..."));
|
||||
if (ret == 2 ) {
|
||||
dispatch(FuncRequest(LFUN_DIALOG_SHOW, "file " + tmpf.absFilename()));
|
||||
dispatch(FuncRequest(LFUN_DIALOG_SHOW, "file " + tmpf.absFileName()));
|
||||
ret = frontend::Alert::prompt(_("Changes detected"),
|
||||
text, 0, 1, _("&Yes"), _("&No"));
|
||||
hideDialogs("file", 0);
|
||||
@ -1074,7 +1074,7 @@ bool SVN::prepareFileRevision(string const & revis, string & f)
|
||||
if (tmpf.isFileEmpty())
|
||||
return false;
|
||||
|
||||
f = tmpf.absFilename();
|
||||
f = tmpf.absFileName();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ Buffer * checkAndLoadLyXFile(FileName const & filename, bool const acceptDirty)
|
||||
// yet been saved to disk.
|
||||
if (checkBuffer->isClean() || acceptDirty || !filename.exists())
|
||||
return checkBuffer;
|
||||
docstring const file = makeDisplayPath(filename.absFilename(), 20);
|
||||
docstring const file = makeDisplayPath(filename.absFileName(), 20);
|
||||
docstring const text = bformat(_(
|
||||
"The document %1$s is already loaded and has unsaved changes.\n"
|
||||
"Do you want to abandon your changes and reload the version on disk?"), file);
|
||||
@ -85,11 +85,11 @@ Buffer * checkAndLoadLyXFile(FileName const & filename, bool const acceptDirty)
|
||||
if (!filename.isReadableFile()) {
|
||||
docstring text = bformat(_("The file %1$s exists but is not "
|
||||
"readable by the current user."),
|
||||
from_utf8(filename.absFilename()));
|
||||
from_utf8(filename.absFileName()));
|
||||
Alert::error(_("File not readable!"), text);
|
||||
return 0;
|
||||
}
|
||||
Buffer * b = theBufferList().newBuffer(filename.absFilename());
|
||||
Buffer * b = theBufferList().newBuffer(filename.absFileName());
|
||||
if (!b) {
|
||||
// Buffer creation is not possible.
|
||||
return 0;
|
||||
@ -105,10 +105,10 @@ Buffer * checkAndLoadLyXFile(FileName const & filename, bool const acceptDirty)
|
||||
|
||||
docstring text = bformat(_("The document %1$s does not yet "
|
||||
"exist.\n\nDo you want to create a new document?"),
|
||||
from_utf8(filename.absFilename()));
|
||||
from_utf8(filename.absFileName()));
|
||||
if (!Alert::prompt(_("Create new document?"),
|
||||
text, 0, 1, _("&Create"), _("Cancel")))
|
||||
return newFile(filename.absFilename(), string(), true);
|
||||
return newFile(filename.absFileName(), string(), true);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -133,7 +133,7 @@ Buffer * newFile(string const & filename, string const & templatename,
|
||||
|
||||
if (!tname.empty()) {
|
||||
if (!b->readFile(tname)) {
|
||||
docstring const file = makeDisplayPath(tname.absFilename(), 50);
|
||||
docstring const file = makeDisplayPath(tname.absFileName(), 50);
|
||||
docstring const text = bformat(
|
||||
_("The specified document template\n%1$s\ncould not be read."),
|
||||
file);
|
||||
@ -171,7 +171,7 @@ Buffer * newUnnamedFile(FileName const & path, string const & prefix,
|
||||
}
|
||||
while (theBufferList().exists(filename) || filename.isReadableFile());
|
||||
|
||||
return newFile(filename.absFilename(), templatename, false);
|
||||
return newFile(filename.absFileName(), templatename, false);
|
||||
}
|
||||
|
||||
|
||||
@ -263,7 +263,7 @@ Buffer * loadIfNeeded(FileName const & fname)
|
||||
if (!fname.exists())
|
||||
return 0;
|
||||
|
||||
buffer = theBufferList().newBuffer(fname.absFilename());
|
||||
buffer = theBufferList().newBuffer(fname.absFileName());
|
||||
if (!buffer)
|
||||
// Buffer creation is not possible.
|
||||
return 0;
|
||||
|
@ -115,7 +115,7 @@ public:
|
||||
LYXERR(Debug::DEBUG, "Messages::get()" << '\n'
|
||||
<< "Error code: " << errno << '\n'
|
||||
<< "Lang, mess: " << lang_ << " " << m << '\n'
|
||||
<< "Directory : " << package().locale_dir().absFilename() << '\n'
|
||||
<< "Directory : " << package().locale_dir().absFileName() << '\n'
|
||||
<< "Rtn value : " << c);
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ FileNameList lyxSockets(string const & dir, string const & pid)
|
||||
for (; it != end; ++it) {
|
||||
if (!it->isDirectory())
|
||||
continue;
|
||||
string const tmpdir = it->absFilename();
|
||||
string const tmpdir = it->absFileName();
|
||||
if (!contains(tmpdir, "lyx_tmpdir" + pid))
|
||||
continue;
|
||||
|
||||
@ -144,7 +144,7 @@ int connect(FileName const & name)
|
||||
if (::connect(fd,
|
||||
reinterpret_cast<struct sockaddr *>(&addr),
|
||||
sizeof(addr)) == -1) {
|
||||
cerr << "lyxclient: Could not connect to socket " << name.absFilename()
|
||||
cerr << "lyxclient: Could not connect to socket " << name.absFileName()
|
||||
<< ": " << strerror(errno) << endl;
|
||||
::close(fd);
|
||||
return -1;
|
||||
@ -573,14 +573,14 @@ int main(int argc, char * argv[])
|
||||
if (server->connected())
|
||||
break;
|
||||
lyxerr << "lyxclient: " << "Could not connect to "
|
||||
<< addr->absFilename() << endl;
|
||||
<< addr->absFileName() << endl;
|
||||
}
|
||||
if (addr == end) {
|
||||
lyxerr << "lyxclient: No suitable server found."
|
||||
<< endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
cerr << "lyxclient: " << "Connected to " << addr->absFilename() << endl;
|
||||
cerr << "lyxclient: " << "Connected to " << addr->absFileName() << endl;
|
||||
}
|
||||
|
||||
int const serverfd = server->fd();
|
||||
|
@ -170,7 +170,7 @@ FileDialog::Result FileDialog::opendir(QString const & path,
|
||||
|
||||
#ifdef USE_NATIVE_FILEDIALOG
|
||||
QString const startsWith = toqstr(makeAbsPath(fromqstr(suggested),
|
||||
fromqstr(path)).absFilename());
|
||||
fromqstr(path)).absFileName());
|
||||
QString const dir = QFileDialog::getExistingDirectory(qApp->focusWidget(),
|
||||
title_, startsWith);
|
||||
if (dir.isNull())
|
||||
|
@ -154,7 +154,7 @@ static vector<string> const & allManualsFiles() {
|
||||
FileName fname;
|
||||
for (size_t i = 0; i < sizeof(files) / sizeof(files[0]); ++i) {
|
||||
fname = i18nLibFileSearch("doc", files[i], "lyx");
|
||||
v.push_back(fname.absFilename());
|
||||
v.push_back(fname.absFileName());
|
||||
}
|
||||
}
|
||||
return v;
|
||||
|
@ -44,7 +44,7 @@ static QDate release_date()
|
||||
static QString credits()
|
||||
{
|
||||
QString res;
|
||||
QFile file(toqstr(package().system_support().absFilename()) + "/CREDITS");
|
||||
QFile file(toqstr(package().system_support().absFileName()) + "/CREDITS");
|
||||
QTextStream out(&res);
|
||||
|
||||
if (file.isReadable()) {
|
||||
@ -120,10 +120,10 @@ static QString version()
|
||||
QTextStream out(&res);
|
||||
out << toqstr(version_date);
|
||||
out << qt_("Library directory: ");
|
||||
out << toqstr(makeDisplayPath(package().system_support().absFilename()));
|
||||
out << toqstr(makeDisplayPath(package().system_support().absFileName()));
|
||||
out << "\n";
|
||||
out << qt_("User directory: ");
|
||||
out << toqstr(makeDisplayPath(package().user_support().absFilename()));
|
||||
out << toqstr(makeDisplayPath(package().user_support().absFileName()));
|
||||
#ifdef DEVEL_VERSION
|
||||
out << "\n";
|
||||
out << "Qt Version (run-time): " << toqstr(qVersion()) << "\n";
|
||||
|
@ -365,11 +365,11 @@ QString iconName(FuncRequest const & f, bool unknown)
|
||||
|
||||
FileName fname = libFileSearch("images/" + path, name1, "png");
|
||||
if (fname.exists())
|
||||
return toqstr(fname.absFilename());
|
||||
return toqstr(fname.absFileName());
|
||||
|
||||
fname = libFileSearch("images/" + path, name2, "png");
|
||||
if (fname.exists())
|
||||
return toqstr(fname.absFilename());
|
||||
return toqstr(fname.absFileName());
|
||||
|
||||
path = ":/images/" + path;
|
||||
QDir res(path);
|
||||
@ -396,7 +396,7 @@ QString iconName(FuncRequest const & f, bool unknown)
|
||||
if (unknown) {
|
||||
fname = libFileSearch(QString("images/"), "unknown", "png");
|
||||
if (fname.exists())
|
||||
return toqstr(fname.absFilename());
|
||||
return toqstr(fname.absFileName());
|
||||
return QString(":/images/unknown.png");
|
||||
}
|
||||
|
||||
@ -407,7 +407,7 @@ QPixmap getPixmap(QString const & path, QString const & name, QString const & ex
|
||||
{
|
||||
QPixmap pixmap;
|
||||
FileName fname = libFileSearch(path, name, ext);
|
||||
QString path1 = toqstr(fname.absFilename());
|
||||
QString path1 = toqstr(fname.absFileName());
|
||||
QString path2 = ":/" + path + name + "." + ext;
|
||||
|
||||
if (pixmap.load(path1)) {
|
||||
@ -1122,7 +1122,7 @@ void GuiApplication::gotoBookmark(unsigned int idx, bool openFile, bool switchTo
|
||||
return;
|
||||
BookmarksSection::Bookmark const & bm = theSession().bookmarks().bookmark(idx);
|
||||
LASSERT(!bm.filename.empty(), /**/);
|
||||
string const file = bm.filename.absFilename();
|
||||
string const file = bm.filename.absFileName();
|
||||
// if the file is not opened, open it.
|
||||
if (!theBufferList().exists(bm.filename)) {
|
||||
if (openFile)
|
||||
@ -1336,7 +1336,7 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
|
||||
break;
|
||||
}
|
||||
current_view_->message(bformat(_("Opening help file %1$s..."),
|
||||
makeDisplayPath(fname.absFilename())));
|
||||
makeDisplayPath(fname.absFileName())));
|
||||
Buffer * buf = current_view_->loadDocument(fname, false);
|
||||
if (buf) {
|
||||
current_view_->setBuffer(buf);
|
||||
@ -1524,11 +1524,11 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
|
||||
|
||||
case LFUN_PREFERENCES_SAVE:
|
||||
lyxrc.write(support::makeAbsPath("preferences",
|
||||
package().user_support().absFilename()), false);
|
||||
package().user_support().absFileName()), false);
|
||||
break;
|
||||
|
||||
case LFUN_BUFFER_SAVE_AS_DEFAULT: {
|
||||
string const fname = addName(addPath(package().user_support().absFilename(),
|
||||
string const fname = addName(addPath(package().user_support().absFileName(),
|
||||
"templates/"), "defaults.lyx");
|
||||
Buffer defaults(fname);
|
||||
|
||||
@ -2045,7 +2045,7 @@ void GuiApplication::restoreGuiSession()
|
||||
if (d->views_.empty() || (!lyxrc.open_buffers_in_tabs
|
||||
&& current_view_->documentBufferView() != 0)) {
|
||||
boost::crc_32_type crc;
|
||||
string const & fname = file_name.absFilename();
|
||||
string const & fname = file_name.absFileName();
|
||||
crc = for_each(fname.begin(), fname.end(), crc);
|
||||
createView(crc.checksum());
|
||||
}
|
||||
@ -2336,7 +2336,7 @@ bool GuiApplication::readUIFile(QString const & name, bool include)
|
||||
|
||||
// Ensure that a file is read only once (prevents include loops)
|
||||
static QStringList uifiles;
|
||||
QString const uifile = toqstr(ui_path.absFilename());
|
||||
QString const uifile = toqstr(ui_path.absFileName());
|
||||
if (uifiles.contains(uifile)) {
|
||||
if (!include) {
|
||||
// We are reading again the top uifile so reset the safeguard:
|
||||
|
@ -138,7 +138,7 @@ FileName GuiClipboard::getPastedGraphicsFileName(Cursor const & cur,
|
||||
typeNames[Clipboard::JpegGraphicsType] = _("JPEG");
|
||||
|
||||
// find unused filename with primary extension
|
||||
string document_path = cur.buffer()->fileName().onlyPath().absFilename();
|
||||
string document_path = cur.buffer()->fileName().onlyPath().absFileName();
|
||||
unsigned newfile_number = 0;
|
||||
FileName filename;
|
||||
do {
|
||||
@ -165,7 +165,7 @@ FileName GuiClipboard::getPastedGraphicsFileName(Cursor const & cur,
|
||||
// show save dialog for the graphic
|
||||
FileDialog dlg(qt_("Choose a filename to save the pasted graphic as"));
|
||||
FileDialog::Result result =
|
||||
dlg.save(toqstr(filename.onlyPath().absFilename()), filter,
|
||||
dlg.save(toqstr(filename.onlyPath().absFileName()), filter,
|
||||
toqstr(filename.onlyFileName()));
|
||||
|
||||
if (result.first == FileDialog::Later)
|
||||
@ -179,12 +179,12 @@ FileName GuiClipboard::getPastedGraphicsFileName(Cursor const & cur,
|
||||
filename.set(newFilename);
|
||||
|
||||
// check the extension (the user could have changed it)
|
||||
if (!suffixIs(ascii_lowercase(filename.absFilename()),
|
||||
if (!suffixIs(ascii_lowercase(filename.absFileName()),
|
||||
"." + extensions[type])) {
|
||||
// the user changed the extension. Check if the type is available
|
||||
size_t i;
|
||||
for (i = 1; i != types.size(); ++i) {
|
||||
if (suffixIs(ascii_lowercase(filename.absFilename()),
|
||||
if (suffixIs(ascii_lowercase(filename.absFileName()),
|
||||
"." + extensions[types[i]])) {
|
||||
type = types[i];
|
||||
break;
|
||||
@ -205,7 +205,7 @@ FileName GuiClipboard::getPastedGraphicsFileName(Cursor const & cur,
|
||||
int ret = frontend::Alert::prompt(
|
||||
_("Overwrite external file?"),
|
||||
bformat(_("File %1$s already exists, do you want to overwrite it?"),
|
||||
from_utf8(filename.absFilename())), 1, 1, _("&Overwrite"), _("&Cancel"));
|
||||
from_utf8(filename.absFileName())), 1, 1, _("&Overwrite"), _("&Cancel"));
|
||||
if (ret == 0)
|
||||
// overwrite, hence break the dialog loop
|
||||
break;
|
||||
@ -238,9 +238,9 @@ FileName GuiClipboard::getAsGraphics(Cursor const & cur, GraphicsType type) cons
|
||||
QBuffer buffer(&ar);
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
if (type == PngGraphicsType)
|
||||
image.save(toqstr(filename.absFilename()), "PNG");
|
||||
image.save(toqstr(filename.absFileName()), "PNG");
|
||||
else if (type == JpegGraphicsType)
|
||||
image.save(toqstr(filename.absFilename()), "JPEG");
|
||||
image.save(toqstr(filename.absFileName()), "JPEG");
|
||||
else
|
||||
LASSERT(false, /**/);
|
||||
|
||||
@ -273,10 +273,10 @@ FileName GuiClipboard::getAsGraphics(Cursor const & cur, GraphicsType type) cons
|
||||
LYXERR(Debug::ACTION, "Getting from clipboard: mime = " << mime.data()
|
||||
<< "length = " << ar.count());
|
||||
|
||||
QFile f(toqstr(filename.absFilename()));
|
||||
QFile f(toqstr(filename.absFileName()));
|
||||
if (!f.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
|
||||
LYXERR(Debug::ACTION, "Error opening file "
|
||||
<< filename.absFilename() << " for writing");
|
||||
<< filename.absFileName() << " for writing");
|
||||
return FileName();
|
||||
}
|
||||
|
||||
|
@ -1664,7 +1664,7 @@ void GuiDocument::browseLayout()
|
||||
// this will update an existing layout if that layout has been loaded before.
|
||||
LayoutFileIndex name = bcl.addLocalLayout(
|
||||
classname.substr(0, classname.size() - 7),
|
||||
layoutFile.onlyPath().absFilename());
|
||||
layoutFile.onlyPath().absFileName());
|
||||
|
||||
if (name.empty()) {
|
||||
Alert::error(_("Error"),
|
||||
@ -2907,7 +2907,7 @@ void GuiDocument::updateIncludeonlys()
|
||||
item = new QTreeWidgetItem(masterChildModule->childrenTW);
|
||||
// FIXME Unicode
|
||||
string const name =
|
||||
to_utf8(makeRelPath(from_utf8((*it)->fileName().absFilename()),
|
||||
to_utf8(makeRelPath(from_utf8((*it)->fileName().absFileName()),
|
||||
from_utf8(buffer().filePath())));
|
||||
item->setText(0, toqstr(name));
|
||||
item->setText(1, isChildIncluded(name) ? yes : no);
|
||||
@ -3093,7 +3093,7 @@ void GuiDocument::dispatchParams()
|
||||
if (!params().master.empty()) {
|
||||
FileName const master_file = support::makeAbsPath(params().master,
|
||||
support::onlyPath(buffer().absFileName()));
|
||||
if (isLyXFilename(master_file.absFilename())) {
|
||||
if (isLyXFilename(master_file.absFileName())) {
|
||||
Buffer * master = checkAndLoadLyXFile(master_file);
|
||||
if (master) {
|
||||
if (master->isChild(const_cast<Buffer *>(&buffer())))
|
||||
|
@ -199,7 +199,7 @@ QFont symbolFont(QString const & family, bool * ok)
|
||||
FontLoader::FontLoader()
|
||||
{
|
||||
QString const fonts_dir =
|
||||
toqstr(addPath(package().system_support().absFilename(), "fonts"));
|
||||
toqstr(addPath(package().system_support().absFileName(), "fonts"));
|
||||
|
||||
for (int i = 0 ; i < num_math_fonts; ++i) {
|
||||
QString const font_file = fonts_dir + '/' + math_fonts[i] + ".ttf";
|
||||
|
@ -502,7 +502,7 @@ void GuiGraphics::paramsToDialog(InsetGraphicsParams const & igp)
|
||||
|
||||
// set the bounding box values
|
||||
if (igp.bb.empty()) {
|
||||
string const bb = readBoundingBox(igp.filename.absFilename());
|
||||
string const bb = readBoundingBox(igp.filename.absFileName());
|
||||
// the values from the file always have the bigpoint-unit bp
|
||||
doubleToWidget(lbX, token(bb, ' ', 0));
|
||||
doubleToWidget(lbY, token(bb, ' ', 1));
|
||||
@ -787,12 +787,12 @@ QString GuiGraphics::browse(QString const & in_name) const
|
||||
QString const title = qt_("Select graphics file");
|
||||
|
||||
// Does user clipart directory exist?
|
||||
string clipdir = addName(package().user_support().absFilename(), "clipart");
|
||||
string clipdir = addName(package().user_support().absFileName(), "clipart");
|
||||
FileName clip(clipdir);
|
||||
|
||||
// bail out to system clipart directory
|
||||
if (!clip.isDirectory())
|
||||
clipdir = addName(package().system_support().absFilename(), "clipart");
|
||||
clipdir = addName(package().system_support().absFileName(), "clipart");
|
||||
|
||||
return browseRelFile(in_name, bufferFilepath(),
|
||||
title, fileFilters(QString()), false,
|
||||
|
@ -79,7 +79,7 @@ bool GuiImage::load(FileName const & filename)
|
||||
LYXERR(Debug::GRAPHICS, "Image is loaded already!");
|
||||
return false;
|
||||
}
|
||||
fname_ = toqstr(filename.absFilename());
|
||||
fname_ = toqstr(filename.absFileName());
|
||||
return load();
|
||||
}
|
||||
|
||||
|
@ -137,14 +137,14 @@ QString browseLibFile(QString const & dir,
|
||||
// FIXME UNICODE
|
||||
QString const label1 = qt_("System files|#S#s");
|
||||
QString const dir1 =
|
||||
toqstr(addName(package().system_support().absFilename(), fromqstr(dir)));
|
||||
toqstr(addName(package().system_support().absFileName(), fromqstr(dir)));
|
||||
|
||||
QString const label2 = qt_("User files|#U#u");
|
||||
QString const dir2 =
|
||||
toqstr(addName(package().user_support().absFilename(), fromqstr(dir)));
|
||||
toqstr(addName(package().user_support().absFileName(), fromqstr(dir)));
|
||||
|
||||
QString const result = browseFile(toqstr(
|
||||
libFileSearch(dir, name, ext).absFilename()),
|
||||
libFileSearch(dir, name, ext).absFileName()),
|
||||
title, filters, false, dir1, dir2, QString(), QString(), dir1);
|
||||
|
||||
// remove the extension if it is the default one
|
||||
@ -156,7 +156,7 @@ QString browseLibFile(QString const & dir,
|
||||
|
||||
// remove the directory, if it is the default one
|
||||
QString const file = onlyFilename(noextresult);
|
||||
if (toqstr(libFileSearch(dir, file, ext).absFilename()) == result)
|
||||
if (toqstr(libFileSearch(dir, file, ext).absFileName()) == result)
|
||||
return file;
|
||||
else
|
||||
return noextresult;
|
||||
@ -2468,7 +2468,7 @@ void PrefShortcuts::apply(LyXRC & rc) const
|
||||
{
|
||||
rc.bind_file = internal_path(fromqstr(bindFileED->text()));
|
||||
// write user_bind and user_unbind to .lyx/bind/user.bind
|
||||
FileName bind_dir(addPath(package().user_support().absFilename(), "bind"));
|
||||
FileName bind_dir(addPath(package().user_support().absFileName(), "bind"));
|
||||
if (!bind_dir.exists() && !bind_dir.createDirectory(0777)) {
|
||||
lyxerr << "LyX could not create the user bind directory '"
|
||||
<< bind_dir << "'. All user-defined key bindings will be lost." << endl;
|
||||
@ -2479,7 +2479,7 @@ void PrefShortcuts::apply(LyXRC & rc) const
|
||||
<< bind_dir << "'. All user-defined key bindings will be lost." << endl;
|
||||
return;
|
||||
}
|
||||
FileName user_bind_file(bind_dir.absFilename() + "/user.bind");
|
||||
FileName user_bind_file(bind_dir.absFileName() + "/user.bind");
|
||||
user_unbind_.write(user_bind_file.toFilesystemEncoding(), false, true);
|
||||
user_bind_.write(user_bind_file.toFilesystemEncoding(), true, false);
|
||||
// immediately apply the keybindings. Why this is not done before?
|
||||
|
@ -255,7 +255,7 @@ void GuiRef::updateContents()
|
||||
FileNameList const & buffers = theBufferList().fileNames();
|
||||
for (FileNameList::const_iterator it = buffers.begin();
|
||||
it != buffers.end(); ++it) {
|
||||
bufferCO->addItem(toqstr(makeDisplayPath(it->absFilename())));
|
||||
bufferCO->addItem(toqstr(makeDisplayPath(it->absFileName())));
|
||||
}
|
||||
|
||||
int const thebuffer = theBufferList().bufferNum(buffer().fileName());
|
||||
|
@ -40,7 +40,7 @@ GuiShowFile::GuiShowFile(GuiView & lv)
|
||||
|
||||
void GuiShowFile::updateContents()
|
||||
{
|
||||
setWindowTitle(onlyFilename(toqstr(filename_.absFilename())));
|
||||
setWindowTitle(onlyFilename(toqstr(filename_.absFileName())));
|
||||
|
||||
QString contents = toqstr(filename_.fileContents("UTF-8"));
|
||||
if (contents.isEmpty())
|
||||
|
@ -1733,7 +1733,7 @@ void GuiView::openDocument(string const & fname)
|
||||
FileDialog dlg(qt_("Select document to open"), LFUN_FILE_OPEN);
|
||||
dlg.setButton1(qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
|
||||
dlg.setButton2(qt_("Examples|#E#e"),
|
||||
toqstr(addPath(package().system_support().absFilename(), "examples")));
|
||||
toqstr(addPath(package().system_support().absFileName(), "examples")));
|
||||
|
||||
QStringList filter(qt_("LyX Documents (*.lyx)"));
|
||||
filter << qt_("LyX-1.3.x Documents (*.lyx13)")
|
||||
@ -1761,12 +1761,12 @@ void GuiView::openDocument(string const & fname)
|
||||
FileName const fullname =
|
||||
fileSearch(string(), filename, "lyx", support::may_not_exist);
|
||||
if (!fullname.empty())
|
||||
filename = fullname.absFilename();
|
||||
filename = fullname.absFileName();
|
||||
|
||||
if (!fullname.onlyPath().isDirectory()) {
|
||||
Alert::warning(_("Invalid filename"),
|
||||
bformat(_("The directory in the given path\n%1$s\ndoes not exist."),
|
||||
from_utf8(fullname.absFilename())));
|
||||
from_utf8(fullname.absFileName())));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1803,7 +1803,7 @@ void GuiView::openDocument(string const & fname)
|
||||
static bool import(GuiView * lv, FileName const & filename,
|
||||
string const & format, ErrorList & errorList)
|
||||
{
|
||||
FileName const lyxfile(support::changeExtension(filename.absFilename(), ".lyx"));
|
||||
FileName const lyxfile(support::changeExtension(filename.absFileName(), ".lyx"));
|
||||
|
||||
string loader_format;
|
||||
vector<string> loaders = theConverters().loaders();
|
||||
@ -1814,7 +1814,7 @@ static bool import(GuiView * lv, FileName const & filename,
|
||||
continue;
|
||||
|
||||
string const tofile =
|
||||
support::changeExtension(filename.absFilename(),
|
||||
support::changeExtension(filename.absFileName(),
|
||||
formats.extension(*it));
|
||||
if (!theConverters().convert(0, filename, FileName(tofile),
|
||||
filename, format, *it, errorList))
|
||||
@ -1839,13 +1839,13 @@ static bool import(GuiView * lv, FileName const & filename,
|
||||
lv->setBuffer(buf);
|
||||
buf->errors("Parse");
|
||||
} else {
|
||||
Buffer * const b = newFile(lyxfile.absFilename(), string(), true);
|
||||
Buffer * const b = newFile(lyxfile.absFileName(), string(), true);
|
||||
if (!b)
|
||||
return false;
|
||||
lv->setBuffer(b);
|
||||
bool as_paragraphs = loader_format == "textparagraph";
|
||||
string filename2 = (loader_format == format) ? filename.absFilename()
|
||||
: support::changeExtension(filename.absFilename(),
|
||||
string filename2 = (loader_format == format) ? filename.absFileName()
|
||||
: support::changeExtension(filename.absFileName(),
|
||||
formats.extension(loader_format));
|
||||
lv->currentBufferView()->insertPlaintextFile(FileName(filename2),
|
||||
as_paragraphs);
|
||||
@ -1880,7 +1880,7 @@ void GuiView::importDocument(string const & argument)
|
||||
FileDialog dlg(toqstr(text), LFUN_BUFFER_IMPORT);
|
||||
dlg.setButton1(qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
|
||||
dlg.setButton2(qt_("Examples|#E#e"),
|
||||
toqstr(addPath(package().system_support().absFilename(), "examples")));
|
||||
toqstr(addPath(package().system_support().absFileName(), "examples")));
|
||||
|
||||
docstring filter = formats.prettyName(format);
|
||||
filter += " (*.";
|
||||
@ -1907,7 +1907,7 @@ void GuiView::importDocument(string const & argument)
|
||||
// get absolute path of file
|
||||
FileName const fullname(support::makeAbsPath(filename));
|
||||
|
||||
FileName const lyxfile(support::changeExtension(fullname.absFilename(), ".lyx"));
|
||||
FileName const lyxfile(support::changeExtension(fullname.absFileName(), ".lyx"));
|
||||
|
||||
// Check if the document already is open
|
||||
Buffer * buf = theBufferList().getBuffer(lyxfile);
|
||||
@ -1919,7 +1919,7 @@ void GuiView::importDocument(string const & argument)
|
||||
}
|
||||
}
|
||||
|
||||
docstring const displaypath = makeDisplayPath(lyxfile.absFilename(), 30);
|
||||
docstring const displaypath = makeDisplayPath(lyxfile.absFileName(), 30);
|
||||
|
||||
// if the file exists already, and we didn't do
|
||||
// -i lyx thefile.lyx, warn
|
||||
@ -1959,7 +1959,7 @@ void GuiView::newDocument(string const & filename, bool from_template)
|
||||
|
||||
string templatefile;
|
||||
if (from_template) {
|
||||
templatefile = selectTemplateFile().absFilename();
|
||||
templatefile = selectTemplateFile().absFileName();
|
||||
if (templatefile.empty())
|
||||
return;
|
||||
}
|
||||
@ -2007,7 +2007,7 @@ void GuiView::insertLyXFile(docstring const & fname)
|
||||
FileDialog dlg(qt_("Select LyX document to insert"), LFUN_FILE_INSERT);
|
||||
dlg.setButton1(qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
|
||||
dlg.setButton2(qt_("Examples|#E#e"),
|
||||
toqstr(addPath(package().system_support().absFilename(),
|
||||
toqstr(addPath(package().system_support().absFileName(),
|
||||
"examples")));
|
||||
|
||||
FileDialog::Result result = dlg.open(toqstr(initpath),
|
||||
@ -2080,7 +2080,7 @@ bool GuiView::renameBuffer(Buffer & b, docstring const & newname)
|
||||
|
||||
if (!newname.empty()) {
|
||||
// FIXME UNICODE
|
||||
fname = support::makeAbsPath(to_utf8(newname), oldname.onlyPath().absFilename());
|
||||
fname = support::makeAbsPath(to_utf8(newname), oldname.onlyPath().absFileName());
|
||||
} else {
|
||||
// Switch to this Buffer.
|
||||
setBuffer(&b);
|
||||
@ -2092,11 +2092,11 @@ bool GuiView::renameBuffer(Buffer & b, docstring const & newname)
|
||||
dlg.setButton1(qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
|
||||
dlg.setButton2(qt_("Templates|#T#t"), toqstr(lyxrc.template_path));
|
||||
|
||||
if (!isLyXFilename(fname.absFilename()))
|
||||
if (!isLyXFilename(fname.absFileName()))
|
||||
fname.changeExtension(".lyx");
|
||||
|
||||
FileDialog::Result result =
|
||||
dlg.save(toqstr(fname.onlyPath().absFilename()),
|
||||
dlg.save(toqstr(fname.onlyPath().absFileName()),
|
||||
QStringList(qt_("LyX Documents (*.lyx)")),
|
||||
toqstr(fname.onlyFileName()));
|
||||
|
||||
@ -2108,13 +2108,13 @@ bool GuiView::renameBuffer(Buffer & b, docstring const & newname)
|
||||
if (fname.empty())
|
||||
return false;
|
||||
|
||||
if (!isLyXFilename(fname.absFilename()))
|
||||
if (!isLyXFilename(fname.absFileName()))
|
||||
fname.changeExtension(".lyx");
|
||||
}
|
||||
|
||||
// fname is now the new Buffer location.
|
||||
if (FileName(fname).exists()) {
|
||||
docstring const file = makeDisplayPath(fname.absFilename(), 30);
|
||||
docstring const file = makeDisplayPath(fname.absFileName(), 30);
|
||||
docstring text = bformat(_("The document %1$s already "
|
||||
"exists.\n\nDo you want to "
|
||||
"overwrite that document?"),
|
||||
@ -2131,7 +2131,7 @@ bool GuiView::renameBuffer(Buffer & b, docstring const & newname)
|
||||
FileName oldauto = b.getAutosaveFilename();
|
||||
|
||||
// Ok, change the name of the buffer
|
||||
b.setFileName(fname.absFilename());
|
||||
b.setFileName(fname.absFileName());
|
||||
b.markDirty();
|
||||
bool unnamed = b.isUnnamed();
|
||||
b.setUnnamed(false);
|
||||
@ -2142,7 +2142,7 @@ bool GuiView::renameBuffer(Buffer & b, docstring const & newname)
|
||||
|
||||
if (!saveBuffer(b)) {
|
||||
oldauto = b.getAutosaveFilename();
|
||||
b.setFileName(oldname.absFilename());
|
||||
b.setFileName(oldname.absFileName());
|
||||
b.setUnnamed(unnamed);
|
||||
b.saveCheckSum(oldname);
|
||||
b.moveAutosaveFile(oldauto);
|
||||
@ -2700,7 +2700,7 @@ void GuiView::openChildDocument(string const & fname)
|
||||
child = theBufferList().getBuffer(filename);
|
||||
} else {
|
||||
message(bformat(_("Opening child document %1$s..."),
|
||||
makeDisplayPath(filename.absFilename())));
|
||||
makeDisplayPath(filename.absFileName())));
|
||||
child = loadDocument(filename, false);
|
||||
parsed = true;
|
||||
}
|
||||
@ -2735,7 +2735,7 @@ bool GuiView::goToFileRow(string const & argument)
|
||||
return false;
|
||||
}
|
||||
Buffer * buf = 0;
|
||||
string const abstmp = package().temp_dir().absFilename();
|
||||
string const abstmp = package().temp_dir().absFileName();
|
||||
string const realtmp = package().temp_dir().realPath();
|
||||
// We have to use os::path_prefix_is() here, instead of
|
||||
// simply prefixIs(), because the file name comes from
|
||||
@ -3225,9 +3225,9 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
|
||||
case LFUN_FORWARD_SEARCH: {
|
||||
FileName const path(doc_buffer->temppath());
|
||||
string const texname = doc_buffer->latexName();
|
||||
FileName const dviname(addName(path.absFilename(),
|
||||
FileName const dviname(addName(path.absFileName(),
|
||||
support::changeExtension(texname, "dvi")));
|
||||
FileName const pdfname(addName(path.absFilename(),
|
||||
FileName const pdfname(addName(path.absFileName(),
|
||||
support::changeExtension(texname, "pdf")));
|
||||
if (!dviname.exists() && !pdfname.exists()) {
|
||||
dr.setMessage(_("Please, preview the document first."));
|
||||
|
@ -1251,7 +1251,7 @@ bool GuiWorkArea::isFullScreen()
|
||||
EmbeddedWorkArea::EmbeddedWorkArea(QWidget * w): GuiWorkArea(w)
|
||||
{
|
||||
buffer_ = theBufferList().newBuffer(
|
||||
support::FileName::tempName().absFilename() + "_embedded.internal");
|
||||
support::FileName::tempName().absFileName() + "_embedded.internal");
|
||||
buffer_->setUnnamed(true);
|
||||
buffer_->setFullyLoaded(true);
|
||||
setBuffer(*buffer_);
|
||||
|
@ -847,7 +847,7 @@ void MenuDefinition::expandLastfiles()
|
||||
unsigned int ii = 1;
|
||||
|
||||
for (; lfit != lf.end() && ii <= lyxrc.num_lastfiles; ++lfit, ++ii) {
|
||||
string const file = lfit->absFilename();
|
||||
string const file = lfit->absFileName();
|
||||
QString label;
|
||||
if (ii < 10)
|
||||
label = QString("%1. %2|%3").arg(ii)
|
||||
@ -906,7 +906,7 @@ void MenuDefinition::expandBookmarks()
|
||||
bool empty = true;
|
||||
for (size_t i = 1; i <= bm.size(); ++i) {
|
||||
if (bm.isValid(i)) {
|
||||
string const file = bm.bookmark(i).filename.absFilename();
|
||||
string const file = bm.bookmark(i).filename.absFileName();
|
||||
QString const label = QString("%1. %2|%3").arg(i)
|
||||
.arg(toqstr(makeDisplayPath(file, 20))).arg(i);
|
||||
add(MenuItem(MenuItem::Command, label,
|
||||
|
@ -213,7 +213,7 @@ void rescanTexStyles()
|
||||
return;
|
||||
// FIXME UNICODE
|
||||
frontend::Alert::error(_("Could not update TeX information"),
|
||||
bformat(_("The script `%1$s' failed."), from_utf8(command.absFilename())));
|
||||
bformat(_("The script `%1$s' failed."), from_utf8(command.absFileName())));
|
||||
}
|
||||
|
||||
|
||||
@ -318,7 +318,7 @@ QString getExtension(QString const & name)
|
||||
QString makeAbsPath(QString const & relpath, QString const & base)
|
||||
{
|
||||
return toqstr(support::makeAbsPath(fromqstr(relpath),
|
||||
fromqstr(base)).absFilename());
|
||||
fromqstr(base)).absFileName());
|
||||
}
|
||||
|
||||
|
||||
|
@ -372,7 +372,7 @@ bool CacheItem::Impl::tryDisplayFormat(FileName & filename, string & from)
|
||||
filename = filename_;
|
||||
}
|
||||
|
||||
docstring const displayed_filename = makeDisplayPath(filename_.absFilename());
|
||||
docstring const displayed_filename = makeDisplayPath(filename_.absFileName());
|
||||
LYXERR(Debug::GRAPHICS, "[CacheItem::Impl::convertToDisplayFormat]\n"
|
||||
<< "\tAttempting to convert image file: " << filename
|
||||
<< "\n\twith displayed filename: " << to_utf8(displayed_filename));
|
||||
@ -427,7 +427,7 @@ void CacheItem::Impl::convertToDisplayFormat()
|
||||
// Connect a signal to this->imageConverted and pass this signal to
|
||||
// the graphics converter so that we can load the modified file
|
||||
// on completion of the conversion process.
|
||||
converter_.reset(new Converter(filename, to_file_base.absFilename(), from, to_));
|
||||
converter_.reset(new Converter(filename, to_file_base.absFileName(), from, to_));
|
||||
converter_->connect(boost::bind(&Impl::imageConverted, this, _1));
|
||||
converter_->startConversion();
|
||||
}
|
||||
|
@ -297,9 +297,9 @@ static void build_script(FileName const & from_file,
|
||||
// problematic characters like ' or ". We can work around that problem
|
||||
// in python, but the converters might be shell scripts and have more
|
||||
// troubles with it.
|
||||
string outfile = addExtension(to_base.absFilename(), getExtension(from_file.absFilename()));
|
||||
string outfile = addExtension(to_base.absFileName(), getExtension(from_file.absFileName()));
|
||||
script << "infile = toUnicode("
|
||||
<< quoteName(from_file.absFilename(), quote_python)
|
||||
<< quoteName(from_file.absFileName(), quote_python)
|
||||
<< ")\n"
|
||||
"outfile = toUnicode("
|
||||
<< quoteName(outfile, quote_python) << ")\n"
|
||||
@ -357,7 +357,7 @@ static void build_script(FileName const & from_file,
|
||||
// Build the conversion command
|
||||
string const infile = outfile;
|
||||
string const infile_base = changeExtension(infile, string());
|
||||
outfile = addExtension(to_base.absFilename(), conv.To->extension());
|
||||
outfile = addExtension(to_base.absFileName(), conv.To->extension());
|
||||
|
||||
// Store these names in the python script
|
||||
script << "infile = toUnicode("
|
||||
|
@ -92,7 +92,7 @@ string const doSubstitution(InsetExternalParams const & params,
|
||||
params.filename.outputFilename(parentpath);
|
||||
string const basename = changeExtension(
|
||||
onlyFilename(filename), string());
|
||||
string const absname = makeAbsPath(filename, parentpath).absFilename();
|
||||
string const absname = makeAbsPath(filename, parentpath).absFileName();
|
||||
|
||||
string result = s;
|
||||
if (what != ALL_BUT_PATHS) {
|
||||
@ -160,9 +160,9 @@ string const doSubstitution(InsetExternalParams const & params,
|
||||
PROTECT_EXTENSION, ESCAPE_DOTS);
|
||||
result = subst_path(result, "$$Extension",
|
||||
'.' + getExtension(filename), use_latex_path);
|
||||
result = subst_path(result, "$$Tempname", params.tempname().absFilename(), use_latex_path);
|
||||
result = subst_path(result, "$$Tempname", params.tempname().absFileName(), use_latex_path);
|
||||
result = subst_path(result, "$$Sysdir",
|
||||
package().system_support().absFilename(), use_latex_path);
|
||||
package().system_support().absFileName(), use_latex_path);
|
||||
|
||||
// Handle the $$Contents(filename) syntax
|
||||
if (contains(result, "$$Contents(\"")) {
|
||||
@ -297,7 +297,7 @@ void updateExternal(InsetExternalParams const & params,
|
||||
// if file is a relative name, it is interpreted
|
||||
// relative to the master document.
|
||||
if (makeAbsPath(file, masterBuffer->filePath()) !=
|
||||
params.filename.absFilename())
|
||||
params.filename.absFileName())
|
||||
exportdata.addExternalFile(rit->first, source, file);
|
||||
}
|
||||
}
|
||||
@ -361,7 +361,7 @@ int writeExternal(InsetExternalParams const & params,
|
||||
use_latex_path, external_in_tmpdir);
|
||||
|
||||
string const absname = makeAbsPath(
|
||||
params.filename.outputFilename(buffer.filePath()), buffer.filePath()).absFilename();
|
||||
params.filename.outputFilename(buffer.filePath()), buffer.filePath()).absFileName();
|
||||
|
||||
if (!external_in_tmpdir && !isValidLaTeXFilename(absname)) {
|
||||
lyx::frontend::Alert::warning(_("Invalid filename"),
|
||||
|
@ -217,7 +217,7 @@ docstring InsetBibtex::toolTip(BufferView const & /*bv*/, int /*x*/, int /*y*/)
|
||||
static string normalizeName(Buffer const & buffer,
|
||||
OutputParams const & runparams, string const & name, string const & ext)
|
||||
{
|
||||
string const fname = makeAbsPath(name, buffer.filePath()).absFilename();
|
||||
string const fname = makeAbsPath(name, buffer.filePath()).absFileName();
|
||||
if (FileName::isAbsolute(name) || !FileName(fname + ext).isReadableFile())
|
||||
return name;
|
||||
if (!runparams.nice)
|
||||
|
@ -71,7 +71,7 @@ TempName::TempName()
|
||||
{
|
||||
FileName const tempname = FileName::tempName("lyxext");
|
||||
// must have an extension for the converter code to work correctly.
|
||||
tempname_ = FileName(tempname.absFilename() + ".tmp");
|
||||
tempname_ = FileName(tempname.absFileName() + ".tmp");
|
||||
}
|
||||
|
||||
|
||||
|
@ -471,7 +471,7 @@ copyFileIfNeeded(FileName const & file_in, FileName const & file_out)
|
||||
LYXERR(Debug::GRAPHICS,
|
||||
to_utf8(bformat(_("Could not copy the file\n%1$s\n"
|
||||
"into the temporary directory."),
|
||||
from_utf8(file_in.absFilename()))));
|
||||
from_utf8(file_in.absFileName()))));
|
||||
}
|
||||
|
||||
GraphicsCopyStatus status = success ? SUCCESS : FAILURE;
|
||||
@ -482,7 +482,7 @@ copyFileIfNeeded(FileName const & file_in, FileName const & file_out)
|
||||
pair<GraphicsCopyStatus, FileName> const
|
||||
copyToDirIfNeeded(DocFileName const & file, string const & dir)
|
||||
{
|
||||
string const file_in = file.absFilename();
|
||||
string const file_in = file.absFileName();
|
||||
string const only_path = onlyPath(file_in);
|
||||
if (rtrim(onlyPath(file_in) , "/") == rtrim(dir, "/"))
|
||||
return make_pair(IDENTICAL_PATHS, file_in);
|
||||
@ -548,7 +548,7 @@ string InsetGraphics::prepareFile(OutputParams const & runparams) const
|
||||
if (params().filename.empty())
|
||||
return string();
|
||||
|
||||
string const orig_file = params().filename.absFilename();
|
||||
string const orig_file = params().filename.absFileName();
|
||||
// this is for dryrun and display purposes, do not use latexFilename
|
||||
string const rel_file = params().filename.relFilename(buffer().filePath());
|
||||
|
||||
@ -587,7 +587,7 @@ string InsetGraphics::prepareFile(OutputParams const & runparams) const
|
||||
// run through the LaTeX compiler.
|
||||
string output_file = runparams.nice ?
|
||||
params().filename.outputFilename(masterBuffer->filePath()) :
|
||||
onlyFilename(temp_file.absFilename());
|
||||
onlyFilename(temp_file.absFileName());
|
||||
|
||||
if (runparams.nice && !isValidLaTeXFilename(output_file)) {
|
||||
frontend::Alert::warning(_("Invalid filename"),
|
||||
@ -621,7 +621,7 @@ string InsetGraphics::prepareFile(OutputParams const & runparams) const
|
||||
// LaTeX needs the bounding box file in the
|
||||
// tmp dir
|
||||
FileName bb_file =
|
||||
FileName(changeExtension(temp_file.absFilename(), "bb"));
|
||||
FileName(changeExtension(temp_file.absFileName(), "bb"));
|
||||
boost::tie(status, bb_file) =
|
||||
copyFileIfNeeded(bb_orig_file, bb_file);
|
||||
if (status == FAILURE)
|
||||
@ -639,9 +639,9 @@ string InsetGraphics::prepareFile(OutputParams const & runparams) const
|
||||
}
|
||||
|
||||
FileName const unzipped_temp_file =
|
||||
FileName(unzippedFileName(temp_file.absFilename()));
|
||||
FileName(unzippedFileName(temp_file.absFileName()));
|
||||
output_file = unzippedFileName(output_file);
|
||||
source_file = FileName(unzippedFileName(source_file.absFilename()));
|
||||
source_file = FileName(unzippedFileName(source_file.absFileName()));
|
||||
if (compare_timestamps(unzipped_temp_file, temp_file) > 0) {
|
||||
// temp_file has been unzipped already and
|
||||
// orig_file has not changed in the meantime.
|
||||
@ -675,12 +675,12 @@ string InsetGraphics::prepareFile(OutputParams const & runparams) const
|
||||
// the file format from the extension, so we must
|
||||
// change it.
|
||||
FileName const new_file =
|
||||
FileName(changeExtension(temp_file.absFilename(), ext));
|
||||
FileName(changeExtension(temp_file.absFileName(), ext));
|
||||
if (temp_file.moveTo(new_file)) {
|
||||
temp_file = new_file;
|
||||
output_file = changeExtension(output_file, ext);
|
||||
source_file =
|
||||
FileName(changeExtension(source_file.absFilename(), ext));
|
||||
FileName(changeExtension(source_file.absFileName(), ext));
|
||||
} else {
|
||||
LYXERR(Debug::GRAPHICS, "Could not rename file `"
|
||||
<< temp_file << "' to `" << new_file << "'.");
|
||||
@ -695,7 +695,7 @@ string InsetGraphics::prepareFile(OutputParams const & runparams) const
|
||||
}
|
||||
|
||||
// so the source and destination formats are different
|
||||
FileName const to_file = FileName(changeExtension(temp_file.absFilename(), ext));
|
||||
FileName const to_file = FileName(changeExtension(temp_file.absFileName(), ext));
|
||||
string const output_to_file = changeExtension(output_file, ext);
|
||||
|
||||
// Do we need to perform the conversion?
|
||||
@ -738,7 +738,7 @@ int InsetGraphics::latex(odocstream & os,
|
||||
// If there is no file specified or not existing,
|
||||
// just output a message about it in the latex output.
|
||||
LYXERR(Debug::GRAPHICS, "insetgraphics::latex: Filename = "
|
||||
<< params().filename.absFilename());
|
||||
<< params().filename.absFileName());
|
||||
|
||||
bool const file_exists = !params().filename.empty()
|
||||
&& params().filename.isReadableFile();
|
||||
@ -798,7 +798,7 @@ int InsetGraphics::plaintext(odocstream & os, OutputParams const &) const
|
||||
// FIXME: We have no idea what the encoding of the filename is
|
||||
|
||||
docstring const str = bformat(buffer().B_("Graphics file: %1$s"),
|
||||
from_utf8(params().filename.absFilename()));
|
||||
from_utf8(params().filename.absFileName()));
|
||||
os << '<' << str << '>';
|
||||
|
||||
return 2 + str.size();
|
||||
@ -870,7 +870,7 @@ string InsetGraphics::prepareHTMLFile(OutputParams const & runparams) const
|
||||
if (params().filename.empty())
|
||||
return string();
|
||||
|
||||
string const orig_file = params().filename.absFilename();
|
||||
string const orig_file = params().filename.absFileName();
|
||||
|
||||
// The master buffer. This is useful when there are multiple levels
|
||||
// of include files
|
||||
@ -894,7 +894,7 @@ string InsetGraphics::prepareHTMLFile(OutputParams const & runparams) const
|
||||
if (status == FAILURE)
|
||||
return string();
|
||||
|
||||
string output_file = onlyFilename(temp_file.absFilename());
|
||||
string output_file = onlyFilename(temp_file.absFileName());
|
||||
|
||||
string const from = formats.getFormatFromFile(temp_file);
|
||||
if (from.empty())
|
||||
@ -912,7 +912,7 @@ string InsetGraphics::prepareHTMLFile(OutputParams const & runparams) const
|
||||
}
|
||||
|
||||
// so the source and destination formats are different
|
||||
FileName const to_file = FileName(changeExtension(temp_file.absFilename(), ext));
|
||||
FileName const to_file = FileName(changeExtension(temp_file.absFileName(), ext));
|
||||
string const output_to_file = changeExtension(output_file, ext);
|
||||
|
||||
// Do we need to perform the conversion?
|
||||
@ -949,7 +949,7 @@ docstring InsetGraphics::xhtml(XHTMLStream & xs, OutputParams const & op) const
|
||||
if (output_file.empty()) {
|
||||
LYXERR0("InsetGraphics::xhtml: Unable to prepare file `"
|
||||
<< params().filename << "' for output. File missing?");
|
||||
string const attr = "src='" + params().filename.absFilename()
|
||||
string const attr = "src='" + params().filename.absFileName()
|
||||
+ "' alt='image: " + output_file + "'";
|
||||
xs << html::CompTag("img", attr);
|
||||
return docstring();
|
||||
@ -973,7 +973,7 @@ void InsetGraphics::validate(LaTeXFeatures & features) const
|
||||
return;
|
||||
|
||||
features.includeFile(graphic_label,
|
||||
removeExtension(params().filename.absFilename()));
|
||||
removeExtension(params().filename.absFileName()));
|
||||
|
||||
features.require("graphicx");
|
||||
|
||||
|
@ -423,7 +423,7 @@ Buffer * InsetInclude::loadIfNeeded() const
|
||||
child_buffer_ = 0;
|
||||
}
|
||||
|
||||
if (!isLyXFilename(included_file.absFilename()))
|
||||
if (!isLyXFilename(included_file.absFileName()))
|
||||
return 0;
|
||||
|
||||
Buffer * child = theBufferList().getBuffer(included_file);
|
||||
@ -432,7 +432,7 @@ Buffer * InsetInclude::loadIfNeeded() const
|
||||
if (!included_file.exists())
|
||||
return 0;
|
||||
|
||||
child = theBufferList().newBuffer(included_file.absFilename());
|
||||
child = theBufferList().newBuffer(included_file.absFileName());
|
||||
if (!child)
|
||||
// Buffer creation is not possible.
|
||||
return 0;
|
||||
@ -470,7 +470,7 @@ int InsetInclude::latex(odocstream & os, OutputParams const & runparams) const
|
||||
// This isn't sufficient, as the inclusion could be downstream.
|
||||
// But it'll have to do for now.
|
||||
if (isInputOrInclude(params()) &&
|
||||
buffer().absFileName() == included_file.absFilename())
|
||||
buffer().absFileName() == included_file.absFileName())
|
||||
{
|
||||
Alert::error(_("Recursive input"),
|
||||
bformat(_("Attempted to include file %1$s in itself! "
|
||||
@ -484,7 +484,7 @@ int InsetInclude::latex(odocstream & os, OutputParams const & runparams) const
|
||||
// buffer directory.
|
||||
if (!FileName::isAbsolute(incfile)) {
|
||||
// FIXME UNICODE
|
||||
incfile = to_utf8(makeRelPath(from_utf8(included_file.absFilename()),
|
||||
incfile = to_utf8(makeRelPath(from_utf8(included_file.absFileName()),
|
||||
from_utf8(masterBuffer->filePath())));
|
||||
}
|
||||
|
||||
@ -497,7 +497,7 @@ int InsetInclude::latex(odocstream & os, OutputParams const & runparams) const
|
||||
mangled = DocFileName(included_file).mangledFilename();
|
||||
} else {
|
||||
exportfile = changeExtension(incfile, ".tex");
|
||||
mangled = DocFileName(changeExtension(included_file.absFilename(), ".tex")).
|
||||
mangled = DocFileName(changeExtension(included_file.absFileName(), ".tex")).
|
||||
mangledFilename();
|
||||
}
|
||||
|
||||
@ -519,7 +519,7 @@ int InsetInclude::latex(odocstream & os, OutputParams const & runparams) const
|
||||
//Don't try to load or copy the file if we're
|
||||
//in a comment or doing a dryrun
|
||||
} else if (isInputOrInclude(params()) &&
|
||||
isLyXFilename(included_file.absFilename())) {
|
||||
isLyXFilename(included_file.absFileName())) {
|
||||
//if it's a LyX file and we're inputting or including,
|
||||
//try to load it so we can write the associated latex
|
||||
if (!loadIfNeeded())
|
||||
@ -572,7 +572,7 @@ int InsetInclude::latex(odocstream & os, OutputParams const & runparams) const
|
||||
runparams.encoding = &tmp->params().encoding();
|
||||
runparams.master_language = buffer().params().language;
|
||||
tmp->makeLaTeXFile(writefile,
|
||||
masterFileName(buffer()).onlyPath().absFilename(),
|
||||
masterFileName(buffer()).onlyPath().absFileName(),
|
||||
runparams, false);
|
||||
runparams.encoding = oldEnc;
|
||||
runparams.master_language = oldLang;
|
||||
@ -590,7 +590,7 @@ int InsetInclude::latex(odocstream & os, OutputParams const & runparams) const
|
||||
LYXERR(Debug::LATEX,
|
||||
to_utf8(bformat(_("Could not copy the file\n%1$s\n"
|
||||
"into the temporary directory."),
|
||||
from_utf8(included_file.absFilename()))));
|
||||
from_utf8(included_file.absFileName()))));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -612,7 +612,7 @@ int InsetInclude::latex(odocstream & os, OutputParams const & runparams) const
|
||||
exportfile);
|
||||
|
||||
// \input wants file with extension (default is .tex)
|
||||
if (!isLyXFilename(included_file.absFilename())) {
|
||||
if (!isLyXFilename(included_file.absFileName())) {
|
||||
incfile = latex_path(incfile);
|
||||
// FIXME UNICODE
|
||||
os << '\\' << from_ascii(params().getCmdName())
|
||||
@ -679,7 +679,7 @@ docstring InsetInclude::xhtml(XHTMLStream & xs, OutputParams const &rp) const
|
||||
// (If we wanted to get really arcane, we could run some tex2html
|
||||
// converter on the included file. But that's just masochistic.)
|
||||
FileName const included_file = includedFilename(buffer(), params());
|
||||
if (!isLyXFilename(included_file.absFilename())) {
|
||||
if (!isLyXFilename(included_file.absFileName())) {
|
||||
frontend::Alert::warning(_("Unsupported Inclusion"),
|
||||
bformat(_("LyX does not know how to include non-LyX files when "
|
||||
"generating HTML output. Offending file:\n%1$s"),
|
||||
@ -691,7 +691,7 @@ docstring InsetInclude::xhtml(XHTMLStream & xs, OutputParams const &rp) const
|
||||
|
||||
// Check we're not trying to include ourselves.
|
||||
// FIXME RECURSIVE INCLUDE
|
||||
if (buffer().absFileName() == included_file.absFilename()) {
|
||||
if (buffer().absFileName() == included_file.absFileName()) {
|
||||
Alert::error(_("Recursive input"),
|
||||
bformat(_("Attempted to include file %1$s in itself! "
|
||||
"Ignoring inclusion."), params()["filename"]));
|
||||
@ -730,7 +730,7 @@ int InsetInclude::docbook(odocstream & os, OutputParams const & runparams) const
|
||||
if (incfile.empty())
|
||||
return 0;
|
||||
|
||||
string const included_file = includedFilename(buffer(), params()).absFilename();
|
||||
string const included_file = includedFilename(buffer(), params()).absFileName();
|
||||
|
||||
// Check we're not trying to include ourselves.
|
||||
// FIXME RECURSIVE INCLUDE
|
||||
@ -787,7 +787,7 @@ void InsetInclude::validate(LaTeXFeatures & features) const
|
||||
LASSERT(&buffer() == &features.buffer(), /**/);
|
||||
|
||||
string const included_file =
|
||||
includedFilename(buffer(), params()).absFilename();
|
||||
includedFilename(buffer(), params()).absFileName();
|
||||
|
||||
if (isLyXFilename(included_file))
|
||||
writefile = changeExtension(included_file, ".sgml");
|
||||
@ -797,7 +797,7 @@ void InsetInclude::validate(LaTeXFeatures & features) const
|
||||
if (!features.runparams().nice && !isVerbatim(params()) && !isListings(params())) {
|
||||
incfile = DocFileName(writefile).mangledFilename();
|
||||
writefile = makeAbsPath(incfile,
|
||||
buffer().masterBuffer()->temppath()).absFilename();
|
||||
buffer().masterBuffer()->temppath()).absFileName();
|
||||
}
|
||||
|
||||
features.includeFile(include_label, writefile);
|
||||
@ -833,7 +833,7 @@ void InsetInclude::fillWithBibKeys(BiblioInfo & keys,
|
||||
InsetIterator const & /*di*/) const
|
||||
{
|
||||
if (loadIfNeeded()) {
|
||||
string const included_file = includedFilename(buffer(), params()).absFilename();
|
||||
string const included_file = includedFilename(buffer(), params()).absFileName();
|
||||
Buffer * tmp = theBufferList().getBuffer(FileName(included_file));
|
||||
BiblioInfo const & newkeys = tmp->localBibInfo();
|
||||
keys.mergeBiblioInfo(newkeys);
|
||||
|
@ -1499,7 +1499,7 @@ MathData pipeThroughExtern(string const & lang, docstring const & extra,
|
||||
}
|
||||
|
||||
// run external sript
|
||||
string out = captureOutput(file.absFilename(), data);
|
||||
string out = captureOutput(file.absFileName(), data);
|
||||
MathData res;
|
||||
mathed_parse_cell(res, from_utf8(out));
|
||||
return res;
|
||||
|
@ -183,7 +183,7 @@ bool FileName::isAbsolute(string const & name)
|
||||
}
|
||||
|
||||
|
||||
string FileName::absFilename() const
|
||||
string FileName::absFileName() const
|
||||
{
|
||||
return d->name;
|
||||
}
|
||||
@ -191,7 +191,7 @@ string FileName::absFilename() const
|
||||
|
||||
string FileName::realPath() const
|
||||
{
|
||||
return os::real_path(absFilename());
|
||||
return os::real_path(absFileName());
|
||||
}
|
||||
|
||||
|
||||
@ -281,7 +281,7 @@ string FileName::toSafeFilesystemEncoding(os::file_access how) const
|
||||
{
|
||||
// This will work on Windows for non ascii file names.
|
||||
QString const safe_path =
|
||||
toqstr(os::safe_internal_path(absFilename(), how));
|
||||
toqstr(os::safe_internal_path(absFileName(), how));
|
||||
QByteArray const encoded = QFile::encodeName(safe_path);
|
||||
return string(encoded.begin(), encoded.end());
|
||||
}
|
||||
@ -497,12 +497,12 @@ unsigned long FileName::checksum() const
|
||||
unsigned long result = 0;
|
||||
|
||||
if (!exists()) {
|
||||
//LYXERR0("File \"" << absFilename() << "\" does not exist!");
|
||||
//LYXERR0("File \"" << absFileName() << "\" does not exist!");
|
||||
return result;
|
||||
}
|
||||
// a directory may be passed here so we need to test it. (bug 3622)
|
||||
if (isDirectory()) {
|
||||
LYXERR0('"' << absFilename() << "\" is a directory!");
|
||||
LYXERR0('"' << absFileName() << "\" is a directory!");
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -579,7 +579,7 @@ unsigned long FileName::checksum() const
|
||||
#endif // SUM_WITH_MMAP
|
||||
#endif // QT_VERSION
|
||||
|
||||
LYXERR(Debug::FILES, "Checksumming \"" << absFilename() << "\" "
|
||||
LYXERR(Debug::FILES, "Checksumming \"" << absFileName() << "\" "
|
||||
<< result << " lasted " << t.elapsed() << " ms.");
|
||||
return result;
|
||||
}
|
||||
@ -700,7 +700,7 @@ docstring const FileName::absoluteFilePath() const
|
||||
|
||||
docstring FileName::displayName(int threshold) const
|
||||
{
|
||||
return makeDisplayPath(absFilename(), threshold);
|
||||
return makeDisplayPath(absFileName(), threshold);
|
||||
}
|
||||
|
||||
|
||||
@ -743,7 +743,7 @@ docstring FileName::fileContents(string const & encoding) const
|
||||
void FileName::changeExtension(string const & extension)
|
||||
{
|
||||
// FIXME: use Qt native methods...
|
||||
string const oldname = absFilename();
|
||||
string const oldname = absFileName();
|
||||
string::size_type const last_slash = oldname.rfind('/');
|
||||
string::size_type last_dot = oldname.rfind('.');
|
||||
if (last_dot < last_slash && last_slash != string::npos)
|
||||
@ -966,8 +966,8 @@ bool equivalent(FileName const & l, FileName const & r)
|
||||
// * Long and short file names that refer to the same file on Windows are
|
||||
// treated as if they referred to different files.
|
||||
// This is supposed to be fixed for Qt5.
|
||||
FileName const lhs(os::internal_path(l.absFilename()));
|
||||
FileName const rhs(os::internal_path(r.absFilename()));
|
||||
FileName const lhs(os::internal_path(l.absFileName()));
|
||||
FileName const rhs(os::internal_path(r.absFileName()));
|
||||
|
||||
if (lhs.empty())
|
||||
// QFileInfo::operator==() returns false if the two QFileInfo are empty.
|
||||
@ -1002,9 +1002,9 @@ bool equivalent(FileName const & l, FileName const & r)
|
||||
bool operator==(FileName const & lhs, FileName const & rhs)
|
||||
{
|
||||
return os::isFilesystemCaseSensitive()
|
||||
? lhs.absFilename() == rhs.absFilename()
|
||||
: !QString::compare(toqstr(lhs.absFilename()),
|
||||
toqstr(rhs.absFilename()), Qt::CaseInsensitive);
|
||||
? lhs.absFileName() == rhs.absFileName()
|
||||
: !QString::compare(toqstr(lhs.absFileName()),
|
||||
toqstr(rhs.absFileName()), Qt::CaseInsensitive);
|
||||
}
|
||||
|
||||
|
||||
@ -1016,19 +1016,19 @@ bool operator!=(FileName const & lhs, FileName const & rhs)
|
||||
|
||||
bool operator<(FileName const & lhs, FileName const & rhs)
|
||||
{
|
||||
return lhs.absFilename() < rhs.absFilename();
|
||||
return lhs.absFileName() < rhs.absFileName();
|
||||
}
|
||||
|
||||
|
||||
bool operator>(FileName const & lhs, FileName const & rhs)
|
||||
{
|
||||
return lhs.absFilename() > rhs.absFilename();
|
||||
return lhs.absFileName() > rhs.absFileName();
|
||||
}
|
||||
|
||||
|
||||
ostream & operator<<(ostream & os, FileName const & filename)
|
||||
{
|
||||
return os << filename.absFilename();
|
||||
return os << filename.absFileName();
|
||||
}
|
||||
|
||||
|
||||
@ -1060,7 +1060,7 @@ void DocFileName::set(string const & name, string const & buffer_path)
|
||||
if (save_abs_path_)
|
||||
FileName::set(name);
|
||||
else
|
||||
FileName::set(makeAbsPath(name, buffer_path).absFilename());
|
||||
FileName::set(makeAbsPath(name, buffer_path).absFileName());
|
||||
zipped_valid_ = false;
|
||||
}
|
||||
|
||||
@ -1081,7 +1081,7 @@ string DocFileName::relFilename(string const & path) const
|
||||
|
||||
string DocFileName::outputFilename(string const & path) const
|
||||
{
|
||||
return save_abs_path_ ? absFilename() : relFilename(path);
|
||||
return save_abs_path_ ? absFileName() : relFilename(path);
|
||||
}
|
||||
|
||||
|
||||
@ -1091,11 +1091,11 @@ string DocFileName::mangledFilename(string const & dir) const
|
||||
// filename returns the same mangled name.
|
||||
typedef map<string, string> MangledMap;
|
||||
static MangledMap mangledNames;
|
||||
MangledMap::const_iterator const it = mangledNames.find(absFilename());
|
||||
MangledMap::const_iterator const it = mangledNames.find(absFileName());
|
||||
if (it != mangledNames.end())
|
||||
return (*it).second;
|
||||
|
||||
string const name = absFilename();
|
||||
string const name = absFileName();
|
||||
// Now the real work
|
||||
string mname = os::internal_path(name);
|
||||
// Remove the extension.
|
||||
@ -1142,7 +1142,7 @@ string DocFileName::mangledFilename(string const & dir) const
|
||||
}
|
||||
}
|
||||
|
||||
mangledNames[absFilename()] = mname;
|
||||
mangledNames[absFileName()] = mname;
|
||||
return mname;
|
||||
}
|
||||
|
||||
@ -1159,7 +1159,7 @@ bool DocFileName::isZipped() const
|
||||
|
||||
string DocFileName::unzippedFilename() const
|
||||
{
|
||||
return unzippedFileName(absFilename());
|
||||
return unzippedFileName(absFileName());
|
||||
}
|
||||
|
||||
|
||||
|
@ -64,7 +64,7 @@ public:
|
||||
static bool isAbsolute(std::string const & name);
|
||||
|
||||
/// get the absolute file name in UTF-8 encoding
|
||||
std::string absFilename() const;
|
||||
std::string absFileName() const;
|
||||
|
||||
/** returns an absolute pathname (whose resolution does not involve
|
||||
* '.', '..', or symbolic links) in UTF-8 encoding
|
||||
|
@ -105,7 +105,7 @@ void Messages::init()
|
||||
int e = errno;
|
||||
if (e) {
|
||||
LYXERR(Debug::LOCALE, "Error code: " << errno << '\n'
|
||||
<< "Directory : " << package().locale_dir().absFilename() << '\n'
|
||||
<< "Directory : " << package().locale_dir().absFileName() << '\n'
|
||||
<< "Rtn value : " << c);
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,7 @@ Package::Package(string const & command_line_arg0,
|
||||
document_dir_ = get_document_dir(home_dir_);
|
||||
|
||||
FileName const abs_binary = abs_path_from_binary_name(command_line_arg0);
|
||||
binary_dir_ = FileName(onlyPath(abs_binary.absFilename()));
|
||||
binary_dir_ = FileName(onlyPath(abs_binary.absFileName()));
|
||||
|
||||
// Is LyX being run in-place from the build tree?
|
||||
buildDirs(abs_binary, top_build_dir_location,
|
||||
@ -139,20 +139,20 @@ Package::Package(string const & command_line_arg0,
|
||||
explicit_user_support_dir_ = userSupportDir(default_user_support_dir,
|
||||
command_line_user_support_dir, user_support_dir_);
|
||||
|
||||
FileName const configure_script(addName(system_support().absFilename(), "configure.py"));
|
||||
FileName const configure_script(addName(system_support().absFileName(), "configure.py"));
|
||||
configure_command_ = os::python() + ' ' +
|
||||
quoteName(configure_script.toFilesystemEncoding(), quote_python) +
|
||||
with_version_suffix();
|
||||
|
||||
LYXERR(Debug::INIT, "<package>\n"
|
||||
<< "\tbinary_dir " << binary_dir().absFilename() << '\n'
|
||||
<< "\tsystem_support " << system_support().absFilename() << '\n'
|
||||
<< "\tbuild_support " << build_support().absFilename() << '\n'
|
||||
<< "\tuser_support " << user_support().absFilename() << '\n'
|
||||
<< "\tlocale_dir " << locale_dir().absFilename() << '\n'
|
||||
<< "\tdocument_dir " << document_dir().absFilename() << '\n'
|
||||
<< "\ttemp_dir " << temp_dir().absFilename() << '\n'
|
||||
<< "\thome_dir " << home_dir().absFilename() << '\n'
|
||||
<< "\tbinary_dir " << binary_dir().absFileName() << '\n'
|
||||
<< "\tsystem_support " << system_support().absFileName() << '\n'
|
||||
<< "\tbuild_support " << build_support().absFileName() << '\n'
|
||||
<< "\tuser_support " << user_support().absFileName() << '\n'
|
||||
<< "\tlocale_dir " << locale_dir().absFileName() << '\n'
|
||||
<< "\tdocument_dir " << document_dir().absFileName() << '\n'
|
||||
<< "\ttemp_dir " << temp_dir().absFileName() << '\n'
|
||||
<< "\thome_dir " << home_dir().absFileName() << '\n'
|
||||
<< "</package>\n");
|
||||
}
|
||||
|
||||
@ -270,14 +270,14 @@ void buildDirs(FileName const & abs_binary,
|
||||
FileName binary = abs_binary;
|
||||
while (true) {
|
||||
// Try and find "lyxrc.defaults".
|
||||
string binary_dir = onlyPath(binary.absFilename());
|
||||
string binary_dir = onlyPath(binary.absFileName());
|
||||
build_support_dir = buildSupportDir(binary_dir, top_build_dir_location);
|
||||
if (!fileSearch(build_support_dir.absFilename(), "Makefile").empty()) {
|
||||
if (!fileSearch(build_support_dir.absFileName(), "Makefile").empty()) {
|
||||
// Try and find "chkconfig.ltx".
|
||||
system_support_dir =
|
||||
FileName(addPath(Package::top_srcdir().absFilename(), "lib"));
|
||||
FileName(addPath(Package::top_srcdir().absFileName(), "lib"));
|
||||
|
||||
if (!fileSearch(system_support_dir.absFilename(), "chkconfig.ltx").empty()) {
|
||||
if (!fileSearch(system_support_dir.absFileName(), "chkconfig.ltx").empty()) {
|
||||
LYXERR(Debug::INIT, check_text << " yes");
|
||||
return;
|
||||
}
|
||||
@ -344,7 +344,7 @@ FileName const get_locale_dir(FileName const & system_support_dir)
|
||||
// 2. Search for system_support_dir / <relative locale dir>
|
||||
// The <relative locale dir> is OS-dependent. (On Unix, it will
|
||||
// be "../locale/".)
|
||||
FileName path(addPath(system_support_dir.absFilename(),
|
||||
FileName path(addPath(system_support_dir.absFileName(),
|
||||
relative_locale_dir()));
|
||||
|
||||
if (path.exists() && path.isDirectory())
|
||||
@ -403,7 +403,7 @@ FileName const get_binary_path(string const & exe)
|
||||
vector<string>::const_iterator const end = path.end();
|
||||
for (; it != end; ++it) {
|
||||
// This will do nothing if *it is already absolute.
|
||||
string const exe_dir = makeAbsPath(*it).absFilename();
|
||||
string const exe_dir = makeAbsPath(*it).absFileName();
|
||||
|
||||
FileName const exe_path(addName(exe_dir, exe_name));
|
||||
if (exe_path.exists())
|
||||
@ -447,7 +447,7 @@ get_system_support_dir(FileName const & abs_binary,
|
||||
FileName path = abs_path_from_command_line(command_line_system_support_dir);
|
||||
if (!path.empty()) {
|
||||
searched_dirs.push_back(path);
|
||||
if (check_command_line_dir(path.absFilename(), chkconfig_ltx, "-sysdir"))
|
||||
if (check_command_line_dir(path.absFileName(), chkconfig_ltx, "-sysdir"))
|
||||
return path;
|
||||
}
|
||||
|
||||
@ -471,12 +471,12 @@ get_system_support_dir(FileName const & abs_binary,
|
||||
FileName binary = abs_binary;
|
||||
while (true) {
|
||||
// Try and find "chkconfig.ltx".
|
||||
string const binary_dir = onlyPath(binary.absFilename());
|
||||
string const binary_dir = onlyPath(binary.absFileName());
|
||||
|
||||
FileName const lyxdir(addPath(binary_dir, relative_lyxdir));
|
||||
searched_dirs.push_back(lyxdir);
|
||||
|
||||
if (!fileSearch(lyxdir.absFilename(), chkconfig_ltx).empty()) {
|
||||
if (!fileSearch(lyxdir.absFileName(), chkconfig_ltx).empty()) {
|
||||
// Success! "chkconfig.ltx" has been found.
|
||||
return lyxdir;
|
||||
}
|
||||
@ -496,7 +496,7 @@ get_system_support_dir(FileName const & abs_binary,
|
||||
}
|
||||
|
||||
// 4. Repeat the exercise on the directory itself.
|
||||
FileName binary_dir(onlyPath(abs_binary.absFilename()));
|
||||
FileName binary_dir(onlyPath(abs_binary.absFileName()));
|
||||
while (true) {
|
||||
// This time test whether the directory is a symbolic link
|
||||
// *before* looking for "chkconfig.ltx".
|
||||
@ -513,11 +513,11 @@ get_system_support_dir(FileName const & abs_binary,
|
||||
}
|
||||
|
||||
// Try and find "chkconfig.ltx".
|
||||
FileName const lyxdir(addPath(binary_dir.absFilename(),
|
||||
FileName const lyxdir(addPath(binary_dir.absFileName(),
|
||||
relative_lyxdir));
|
||||
searched_dirs.push_back(lyxdir);
|
||||
|
||||
if (!fileSearch(lyxdir.absFilename(), chkconfig_ltx).empty()) {
|
||||
if (!fileSearch(lyxdir.absFileName(), chkconfig_ltx).empty()) {
|
||||
// Success! "chkconfig.ltx" has been found.
|
||||
return lyxdir;
|
||||
}
|
||||
@ -525,7 +525,7 @@ get_system_support_dir(FileName const & abs_binary,
|
||||
|
||||
// 5. In desparation, try the hard-coded system support dir.
|
||||
path = hardcoded_system_support_dir();
|
||||
if (!fileSearch(path.absFilename(), chkconfig_ltx).empty())
|
||||
if (!fileSearch(path.absFileName(), chkconfig_ltx).empty())
|
||||
return path;
|
||||
|
||||
// Everything has failed :-(
|
||||
@ -537,7 +537,7 @@ get_system_support_dir(FileName const & abs_binary,
|
||||
for (iterator it = begin; it != end; ++it) {
|
||||
if (it != begin)
|
||||
searched_dirs_str += "\n\t";
|
||||
searched_dirs_str += it->absFilename();
|
||||
searched_dirs_str += it->absFileName();
|
||||
}
|
||||
|
||||
// FIXME UNICODE
|
||||
@ -609,7 +609,7 @@ FileName const get_default_user_support_dir(FileName const & home_dir)
|
||||
return FileName(addPath(reinterpret_cast<char const *>(store), PACKAGE));
|
||||
|
||||
#else // USE_POSIX_PACKAGING
|
||||
return FileName(addPath(home_dir.absFilename(), string(".") + PACKAGE));
|
||||
return FileName(addPath(home_dir.absFileName(), string(".") + PACKAGE));
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -647,13 +647,13 @@ bool check_env_var_dir(FileName const & dir,
|
||||
string const & file,
|
||||
string const & env_var)
|
||||
{
|
||||
FileName const abs_path = fileSearch(dir.absFilename(), file);
|
||||
FileName const abs_path = fileSearch(dir.absFileName(), file);
|
||||
if (abs_path.empty()) {
|
||||
// FIXME UNICODE
|
||||
throw ExceptionMessage(WarningException, _("File not found"), bformat(
|
||||
_("Invalid %1$s environment variable.\n"
|
||||
"Directory %2$s does not contain %3$s."),
|
||||
from_utf8(env_var), from_utf8(dir.absFilename()),
|
||||
from_utf8(env_var), from_utf8(dir.absFileName()),
|
||||
from_utf8(file)));
|
||||
}
|
||||
|
||||
@ -678,7 +678,7 @@ bool check_env_var_dir(FileName const & dir,
|
||||
_("Invalid %1$s environment variable.\n%2$s is not a directory.");
|
||||
|
||||
throw ExceptionMessage(WarningException, _("Directory not found"), bformat(
|
||||
fmt, from_utf8(env_var), from_utf8(dir.absFilename())));
|
||||
fmt, from_utf8(env_var), from_utf8(dir.absFileName())));
|
||||
}
|
||||
|
||||
return success;
|
||||
|
@ -107,7 +107,7 @@ string const latex_path(string const & original_path,
|
||||
FileName const makeLatexName(FileName const & file)
|
||||
{
|
||||
string name = file.onlyFileName();
|
||||
string const path = file.onlyPath().absFilename() + "/";
|
||||
string const path = file.onlyPath().absFileName() + "/";
|
||||
|
||||
// ok so we scan through the string twice, but who cares.
|
||||
// FIXME: in Unicode time this will break for sure! There is
|
||||
@ -179,9 +179,9 @@ FileName const fileOpenSearch(string const & path, string const & name,
|
||||
if (!suffixIs(path_element, '/'))
|
||||
path_element += '/';
|
||||
path_element = subst(path_element, "$$LyX",
|
||||
package().system_support().absFilename());
|
||||
package().system_support().absFileName());
|
||||
path_element = subst(path_element, "$$User",
|
||||
package().user_support().absFilename());
|
||||
package().user_support().absFileName());
|
||||
|
||||
real_file = fileSearch(path_element, name, ext);
|
||||
|
||||
@ -215,8 +215,8 @@ FileName const fileSearch(string const & path, string const & name,
|
||||
return mode == may_not_exist ? fullname : FileName();
|
||||
// Only add the extension if it is not already the extension of
|
||||
// fullname.
|
||||
if (getExtension(fullname.absFilename()) != ext)
|
||||
fullname = FileName(addExtension(fullname.absFilename(), ext));
|
||||
if (getExtension(fullname.absFileName()) != ext)
|
||||
fullname = FileName(addExtension(fullname.absFileName(), ext));
|
||||
if (fullname.isReadableFile() || mode == may_not_exist)
|
||||
return fullname;
|
||||
return FileName();
|
||||
@ -230,18 +230,18 @@ FileName const fileSearch(string const & path, string const & name,
|
||||
FileName const libFileSearch(string const & dir, string const & name,
|
||||
string const & ext)
|
||||
{
|
||||
FileName fullname = fileSearch(addPath(package().user_support().absFilename(), dir),
|
||||
FileName fullname = fileSearch(addPath(package().user_support().absFileName(), dir),
|
||||
name, ext);
|
||||
if (!fullname.empty())
|
||||
return fullname;
|
||||
|
||||
if (!package().build_support().empty())
|
||||
fullname = fileSearch(addPath(package().build_support().absFilename(), dir),
|
||||
fullname = fileSearch(addPath(package().build_support().absFileName(), dir),
|
||||
name, ext);
|
||||
if (!fullname.empty())
|
||||
return fullname;
|
||||
|
||||
return fileSearch(addPath(package().system_support().absFilename(), dir), name, ext);
|
||||
return fileSearch(addPath(package().system_support().absFileName(), dir), name, ext);
|
||||
}
|
||||
|
||||
|
||||
@ -313,7 +313,7 @@ string const libScriptSearch(string const & command_in, quote_style style)
|
||||
|
||||
// Does this script file exist?
|
||||
string const script =
|
||||
libFileSearch(".", command.substr(start_script, size_script)).absFilename();
|
||||
libFileSearch(".", command.substr(start_script, size_script)).absFileName();
|
||||
|
||||
if (script.empty()) {
|
||||
// Replace "$$s/" with ""
|
||||
@ -401,7 +401,7 @@ FileName const makeAbsPath(string const & relPath, string const & basePath)
|
||||
if (FileName::isAbsolute(basePath))
|
||||
tempBase = basePath;
|
||||
else
|
||||
tempBase = addPath(FileName::getcwd().absFilename(), basePath);
|
||||
tempBase = addPath(FileName::getcwd().absFileName(), basePath);
|
||||
|
||||
// Handle /./ at the end of the path
|
||||
while (suffixIs(tempBase, "/./"))
|
||||
@ -415,7 +415,7 @@ FileName const makeAbsPath(string const & relPath, string const & basePath)
|
||||
// Split by first /
|
||||
rTemp = split(rTemp, temp, '/');
|
||||
if (temp == "~") {
|
||||
tempBase = package().home_dir().absFilename();
|
||||
tempBase = package().home_dir().absFileName();
|
||||
tempRel = rTemp;
|
||||
}
|
||||
|
||||
@ -508,13 +508,13 @@ string const expandPath(string const & path)
|
||||
rTemp = split(rTemp, temp, '/');
|
||||
|
||||
if (temp == ".")
|
||||
return FileName::getcwd().absFilename() + '/' + rTemp;
|
||||
return FileName::getcwd().absFileName() + '/' + rTemp;
|
||||
|
||||
if (temp == "~")
|
||||
return package().home_dir().absFilename() + '/' + rTemp;
|
||||
return package().home_dir().absFileName() + '/' + rTemp;
|
||||
|
||||
if (temp == "..")
|
||||
return makeAbsPath(copy).absFilename();
|
||||
return makeAbsPath(copy).absFileName();
|
||||
|
||||
// Don't know how to handle this
|
||||
return copy;
|
||||
@ -701,12 +701,12 @@ docstring const makeDisplayPath(string const & path, unsigned int threshold)
|
||||
string str = path;
|
||||
|
||||
// If file is from LyXDir, display it as if it were relative.
|
||||
string const system = package().system_support().absFilename();
|
||||
string const system = package().system_support().absFileName();
|
||||
if (prefixIs(str, system) && str != system)
|
||||
return from_utf8("[" + str.erase(0, system.length()) + "]");
|
||||
|
||||
// replace /home/blah with ~/
|
||||
string const home = package().home_dir().absFilename();
|
||||
string const home = package().home_dir().absFileName();
|
||||
if (!home.empty() && prefixIs(str, home))
|
||||
str = subst(str, home, "~");
|
||||
|
||||
@ -746,7 +746,7 @@ bool readLink(FileName const & file, FileName & link)
|
||||
if (nRead <= 0)
|
||||
return false;
|
||||
linkbuffer[nRead] = '\0'; // terminator
|
||||
link = makeAbsPath(linkbuffer, onlyPath(file.absFilename()));
|
||||
link = makeAbsPath(linkbuffer, onlyPath(file.absFileName()));
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
|
@ -429,7 +429,7 @@ string real_path(string const & path)
|
||||
{
|
||||
char rpath[PATH_MAX + 1];
|
||||
char * result = realpath(path.c_str(), rpath);
|
||||
return FileName::fromFilesystemEncoding(result ? rpath : path).absFilename();
|
||||
return FileName::fromFilesystemEncoding(result ? rpath : path).absFileName();
|
||||
}
|
||||
|
||||
} // namespace os
|
||||
|
@ -305,7 +305,7 @@ string real_path(string const & path)
|
||||
{
|
||||
char rpath[PATH_MAX + 1];
|
||||
char * result = realpath(path.c_str(), rpath);
|
||||
return FileName::fromFilesystemEncoding(result ? rpath : path).absFilename();
|
||||
return FileName::fromFilesystemEncoding(result ? rpath : path).absFileName();
|
||||
}
|
||||
|
||||
} // namespace os
|
||||
|
@ -618,7 +618,7 @@ string real_path(string const & path)
|
||||
CloseHandle(hmap);
|
||||
CloseHandle(hpath);
|
||||
string const retpath = subst(string(realpath), '\\', '/');
|
||||
return FileName::fromFilesystemEncoding(retpath).absFilename();
|
||||
return FileName::fromFilesystemEncoding(retpath).absFileName();
|
||||
}
|
||||
|
||||
} // namespace os
|
||||
|
@ -81,7 +81,7 @@ int listen(FileName const & name, int queue)
|
||||
string::size_type len = localname.size();
|
||||
// the field sun_path in sockaddr_un is a char[108]
|
||||
if (len > 107) {
|
||||
LYXERR0("lyx: Socket address '" << name.absFilename() << "' too long.");
|
||||
LYXERR0("lyx: Socket address '" << name.absFileName() << "' too long.");
|
||||
return -1;
|
||||
}
|
||||
// Synonims for AF_UNIX are AF_LOCAL and AF_FILE
|
||||
@ -111,7 +111,7 @@ int listen(FileName const & name, int queue)
|
||||
// the socket special file in the filesystem. bind() returns -1
|
||||
// in case of error
|
||||
if ((::bind (fd, reinterpret_cast<sockaddr *>(&addr), SUN_LEN(&addr))) == -1) {
|
||||
LYXERR0("lyx: Could not bind address '" << name.absFilename()
|
||||
LYXERR0("lyx: Could not bind address '" << name.absFileName()
|
||||
<< "' to socket descriptor: " << strerror(errno));
|
||||
::close(fd);
|
||||
name.removeFile();
|
||||
|
@ -484,7 +484,7 @@ bool tex2lyx(FileName const & infilename, ostream & os, string const & encoding)
|
||||
return false;
|
||||
}
|
||||
string const oldParentFilePath = parentFilePath;
|
||||
parentFilePath = onlyPath(infilename.absFilename());
|
||||
parentFilePath = onlyPath(infilename.absFileName());
|
||||
tex2lyx(is, os, encoding);
|
||||
parentFilePath = oldParentFilePath;
|
||||
return true;
|
||||
@ -553,13 +553,13 @@ int main(int argc, char * argv[])
|
||||
// Now every known option is parsed. Look for input and output
|
||||
// file name (the latter is optional).
|
||||
string infilename = internal_path(os::utf8_argv(1));
|
||||
infilename = makeAbsPath(infilename).absFilename();
|
||||
infilename = makeAbsPath(infilename).absFileName();
|
||||
|
||||
string outfilename;
|
||||
if (argc > 2) {
|
||||
outfilename = internal_path(os::utf8_argv(2));
|
||||
if (outfilename != "-")
|
||||
outfilename = makeAbsPath(outfilename).absFilename();
|
||||
outfilename = makeAbsPath(outfilename).absFileName();
|
||||
} else
|
||||
outfilename = changeExtension(infilename, ".lyx");
|
||||
|
||||
|
@ -1041,7 +1041,7 @@ void fix_relative_filename(string & name)
|
||||
if (FileName::isAbsolute(name))
|
||||
return;
|
||||
|
||||
name = to_utf8(makeRelPath(from_utf8(makeAbsPath(name, getMasterFilePath()).absFilename()),
|
||||
name = to_utf8(makeRelPath(from_utf8(makeAbsPath(name, getMasterFilePath()).absFileName()),
|
||||
from_utf8(getParentFilePath())));
|
||||
}
|
||||
|
||||
@ -2407,7 +2407,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
|
||||
}
|
||||
if (makeAbsPath(filename, path).exists()) {
|
||||
string const abstexname =
|
||||
makeAbsPath(filename, path).absFilename();
|
||||
makeAbsPath(filename, path).absFileName();
|
||||
string const abslyxname =
|
||||
changeExtension(abstexname, ".lyx");
|
||||
fix_relative_filename(filename);
|
||||
|
Loading…
Reference in New Issue
Block a user