mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
support:
frontends: onlyFilename -> onlyFileName git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34240 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
266ad9501d
commit
72a6c77a51
@ -579,12 +579,12 @@ string Buffer::logName(LogType * type) const
|
||||
string const path = temppath();
|
||||
|
||||
FileName const fname(addName(temppath(),
|
||||
onlyFilename(changeExtension(filename,
|
||||
onlyFileName(changeExtension(filename,
|
||||
".log"))));
|
||||
|
||||
// FIXME: how do we know this is the name of the build log?
|
||||
FileName const bname(
|
||||
addName(path, onlyFilename(
|
||||
addName(path, onlyFileName(
|
||||
changeExtension(filename,
|
||||
formats.extension(bufferFormat()) + ".out"))));
|
||||
|
||||
@ -1071,7 +1071,7 @@ docstring Buffer::emergencyWrite()
|
||||
if (isClean())
|
||||
return docstring();
|
||||
|
||||
string const doc = isUnnamed() ? onlyFilename(absFileName()) : absFileName();
|
||||
string const doc = isUnnamed() ? onlyFileName(absFileName()) : absFileName();
|
||||
|
||||
docstring user_message = bformat(
|
||||
_("LyX: Attempting to save document %1$s\n"), from_utf8(doc));
|
||||
@ -1629,7 +1629,7 @@ int Buffer::runChktex()
|
||||
makeLaTeXFile(FileName(name), org_path, runparams);
|
||||
|
||||
TeXErrors terr;
|
||||
Chktex chktex(lyxrc.chktex_command, onlyFilename(name), filePath());
|
||||
Chktex chktex(lyxrc.chktex_command, onlyFileName(name), filePath());
|
||||
int const res = chktex.run(terr); // run chktex
|
||||
|
||||
if (res == -1) {
|
||||
@ -3538,7 +3538,7 @@ 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);
|
||||
|
@ -272,7 +272,7 @@ Buffer * BufferList::getBufferFromTmp(string const & s)
|
||||
for (; it < end; ++it) {
|
||||
if (prefixIs(s, (*it)->temppath())) {
|
||||
// check whether the filename matches the master
|
||||
string const master_name = changeExtension(onlyFilename(
|
||||
string const master_name = changeExtension(onlyFileName(
|
||||
(*it)->absFileName()), ".tex");
|
||||
if (suffixIs(s, master_name))
|
||||
return *it;
|
||||
|
@ -38,7 +38,7 @@ Chktex::Chktex(string const & chktex, string const & f, string const & p)
|
||||
int Chktex::run(TeXErrors &terr)
|
||||
{
|
||||
// run bibtex
|
||||
string log = onlyFilename(changeExtension(file, ".log"));
|
||||
string log = onlyFileName(changeExtension(file, ".log"));
|
||||
string tmp = cmd + " -q -v0 -b0 -x " + file + " -o " + log;
|
||||
Systemcall one;
|
||||
int result = one.startscript(Systemcall::Wait, tmp);
|
||||
@ -55,9 +55,9 @@ int Chktex::scanLogFile(TeXErrors & terr)
|
||||
{
|
||||
int retval = 0;
|
||||
|
||||
// FIXME: Find out whether onlyFilename() is really needed,
|
||||
// or whether makeAbsPath(onlyFilename()) is a noop here
|
||||
FileName const tmp(makeAbsPath(onlyFilename(changeExtension(file, ".log"))));
|
||||
// FIXME: Find out whether onlyFileName() is really needed,
|
||||
// or whether makeAbsPath(onlyFileName()) is a noop here
|
||||
FileName const tmp(makeAbsPath(onlyFileName(changeExtension(file, ".log"))));
|
||||
|
||||
#if USE_BOOST_FORMAT
|
||||
boost::basic_format<char_type> msg(_("ChkTeX warning id # %1$d"));
|
||||
|
@ -367,7 +367,7 @@ bool Converters::convert(Buffer const * buffer,
|
||||
: addName(subst(conv.result_dir,
|
||||
token_base, from_base),
|
||||
subst(conv.result_file,
|
||||
token_base, onlyFilename(from_base))));
|
||||
token_base, onlyFileName(from_base))));
|
||||
|
||||
// if input and output files are equal, we use a
|
||||
// temporary file as intermediary (JMarc)
|
||||
@ -513,7 +513,7 @@ bool Converters::move(string const & fmt,
|
||||
|
||||
bool no_errors = true;
|
||||
string const path = onlyPath(from.absFileName());
|
||||
string const base = onlyFilename(removeExtension(from.absFileName()));
|
||||
string const base = onlyFileName(removeExtension(from.absFileName()));
|
||||
string const to_base = removeExtension(to.absFileName());
|
||||
string const to_extension = getExtension(to.absFileName());
|
||||
|
||||
@ -521,7 +521,7 @@ bool Converters::move(string const & fmt,
|
||||
for (support::FileNameList::const_iterator it = files.begin();
|
||||
it != files.end(); ++it) {
|
||||
string const from2 = it->absFileName();
|
||||
string const file2 = onlyFilename(from2);
|
||||
string const file2 = onlyFileName(from2);
|
||||
if (prefixIs(file2, base)) {
|
||||
string const to2 = changeExtension(
|
||||
to_base + file2.substr(base.length()),
|
||||
|
@ -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);
|
||||
@ -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
|
||||
|
@ -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()));
|
||||
}
|
||||
|
||||
|
||||
|
@ -260,8 +260,8 @@ int LaTeX::run(TeXErrors & terr)
|
||||
// no checks for now
|
||||
LYXERR(Debug::LATEX, "Running MakeIndex.");
|
||||
message(_("Running Index Processor."));
|
||||
// onlyFilename() is needed for cygwin
|
||||
rerun |= runMakeIndex(onlyFilename(idxfile.absFileName()),
|
||||
// onlyFileName() is needed for cygwin
|
||||
rerun |= runMakeIndex(onlyFileName(idxfile.absFileName()),
|
||||
runparams);
|
||||
}
|
||||
FileName const nlofile(changeExtension(file.absFileName(), ".nlo"));
|
||||
@ -349,8 +349,8 @@ int LaTeX::run(TeXErrors & terr)
|
||||
// no checks for now
|
||||
LYXERR(Debug::LATEX, "Running MakeIndex.");
|
||||
message(_("Running Index Processor."));
|
||||
// onlyFilename() is needed for cygwin
|
||||
rerun = runMakeIndex(onlyFilename(changeExtension(
|
||||
// onlyFileName() is needed for cygwin
|
||||
rerun = runMakeIndex(onlyFileName(changeExtension(
|
||||
file.absFileName(), ".idx")), runparams);
|
||||
}
|
||||
|
||||
@ -398,9 +398,9 @@ int LaTeX::run(TeXErrors & terr)
|
||||
|
||||
int LaTeX::startscript()
|
||||
{
|
||||
// onlyFilename() is needed for cygwin
|
||||
// onlyFileName() is needed for cygwin
|
||||
string tmp = cmd + ' '
|
||||
+ quoteName(onlyFilename(file.toFilesystemEncoding()))
|
||||
+ quoteName(onlyFileName(file.toFilesystemEncoding()))
|
||||
+ " > " + os::nulldev();
|
||||
Systemcall one;
|
||||
return one.startscript(Systemcall::Wait, tmp);
|
||||
@ -441,10 +441,10 @@ bool LaTeX::runMakeIndexNomencl(FileName const & file,
|
||||
LYXERR(Debug::LATEX, "Running MakeIndex for nomencl.");
|
||||
message(_("Running MakeIndex for nomencl."));
|
||||
string tmp = lyxrc.nomencl_command + ' ';
|
||||
// onlyFilename() is needed for cygwin
|
||||
tmp += quoteName(onlyFilename(changeExtension(file.absFileName(), nlo)));
|
||||
// onlyFileName() is needed for cygwin
|
||||
tmp += quoteName(onlyFileName(changeExtension(file.absFileName(), nlo)));
|
||||
tmp += " -o "
|
||||
+ onlyFilename(changeExtension(file.toFilesystemEncoding(), nls));
|
||||
+ onlyFileName(changeExtension(file.toFilesystemEncoding(), nls));
|
||||
Systemcall one;
|
||||
one.startscript(Systemcall::Wait, tmp);
|
||||
return true;
|
||||
@ -575,8 +575,8 @@ bool LaTeX::runBibTeX(vector<AuxInfo> const & bibtex_info,
|
||||
if (!runparams.bibtex_command.empty())
|
||||
tmp = runparams.bibtex_command;
|
||||
tmp += " ";
|
||||
// onlyFilename() is needed for cygwin
|
||||
tmp += quoteName(onlyFilename(removeExtension(
|
||||
// onlyFileName() is needed for cygwin
|
||||
tmp += quoteName(onlyFileName(removeExtension(
|
||||
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());
|
||||
@ -853,7 +853,7 @@ bool handleFoundFile(string const & ff, DepTable & head)
|
||||
}
|
||||
}
|
||||
|
||||
string onlyfile = onlyFilename(foundfile);
|
||||
string onlyfile = onlyFileName(foundfile);
|
||||
absname = makeAbsPath(onlyfile);
|
||||
|
||||
// check for spaces
|
||||
@ -873,7 +873,7 @@ bool handleFoundFile(string const & ff, DepTable & head)
|
||||
string const stripoff =
|
||||
rsplit(foundfile, strippedfile, ' ');
|
||||
foundfile = strippedfile;
|
||||
onlyfile = onlyFilename(strippedfile);
|
||||
onlyfile = onlyFileName(strippedfile);
|
||||
absname = makeAbsPath(onlyfile);
|
||||
}
|
||||
}
|
||||
@ -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 (.+)(.).*");
|
||||
@ -1046,7 +1046,7 @@ void LaTeX::deplog(DepTable & head)
|
||||
found_file = checkLineBreak(sub.str(1), head);
|
||||
// (7) "\tf@toc=\write<nr>" (for MikTeX)
|
||||
else if (regex_match(token, sub, miktexTocReg))
|
||||
found_file = handleFoundFile(onlyFilename(changeExtension(
|
||||
found_file = handleFoundFile(onlyFileName(changeExtension(
|
||||
file.absFileName(), ".toc")), head);
|
||||
else
|
||||
// not found, but we won't check further
|
||||
|
@ -179,7 +179,7 @@ void RCS::registrer(string const & msg)
|
||||
string cmd = "ci -q -u -i -t-\"";
|
||||
cmd += msg;
|
||||
cmd += "\" ";
|
||||
cmd += quoteName(onlyFilename(owner_->absFileName()));
|
||||
cmd += quoteName(onlyFileName(owner_->absFileName()));
|
||||
doVCCommand(cmd, FileName(owner_->filePath()));
|
||||
}
|
||||
|
||||
@ -187,7 +187,7 @@ void RCS::registrer(string const & msg)
|
||||
string RCS::checkIn(string const & msg)
|
||||
{
|
||||
int ret = doVCCommand("ci -q -u -m\"" + msg + "\" "
|
||||
+ quoteName(onlyFilename(owner_->absFileName())),
|
||||
+ quoteName(onlyFileName(owner_->absFileName())),
|
||||
FileName(owner_->filePath()));
|
||||
return ret ? string() : "RCS: Proceeded";
|
||||
}
|
||||
@ -202,7 +202,7 @@ bool RCS::checkInEnabled()
|
||||
string RCS::checkOut()
|
||||
{
|
||||
owner_->markClean();
|
||||
int ret = doVCCommand("co -q -l " + quoteName(onlyFilename(owner_->absFileName())),
|
||||
int ret = doVCCommand("co -q -l " + quoteName(onlyFileName(owner_->absFileName())),
|
||||
FileName(owner_->filePath()));
|
||||
return ret ? string() : "RCS: Proceeded";
|
||||
}
|
||||
@ -243,7 +243,7 @@ bool RCS::lockingToggleEnabled()
|
||||
void RCS::revert()
|
||||
{
|
||||
doVCCommand("co -f -u" + version_ + " "
|
||||
+ quoteName(onlyFilename(owner_->absFileName())),
|
||||
+ quoteName(onlyFileName(owner_->absFileName())),
|
||||
FileName(owner_->filePath()));
|
||||
// We ignore changes and just reload!
|
||||
owner_->markClean();
|
||||
@ -254,7 +254,7 @@ void RCS::undoLast()
|
||||
{
|
||||
LYXERR(Debug::LYXVC, "LyXVC: undoLast");
|
||||
doVCCommand("rcs -o" + version_ + " "
|
||||
+ quoteName(onlyFilename(owner_->absFileName())),
|
||||
+ quoteName(onlyFileName(owner_->absFileName())),
|
||||
FileName(owner_->filePath()));
|
||||
}
|
||||
|
||||
@ -267,7 +267,7 @@ bool RCS::undoLastEnabled()
|
||||
|
||||
void RCS::getLog(FileName const & tmpf)
|
||||
{
|
||||
doVCCommand("rlog " + quoteName(onlyFilename(owner_->absFileName()))
|
||||
doVCCommand("rlog " + quoteName(onlyFileName(owner_->absFileName()))
|
||||
+ " > " + quoteName(tmpf.toFilesystemEncoding()),
|
||||
FileName(owner_->filePath()));
|
||||
}
|
||||
@ -322,7 +322,7 @@ bool RCS::prepareFileRevision(string const &revis, string & f)
|
||||
}
|
||||
|
||||
doVCCommand("co -p" + rev + " "
|
||||
+ quoteName(onlyFilename(owner_->absFileName()))
|
||||
+ quoteName(onlyFileName(owner_->absFileName()))
|
||||
+ " > " + quoteName(tmpf.toFilesystemEncoding()),
|
||||
FileName(owner_->filePath()));
|
||||
if (tmpf.isFileEmpty())
|
||||
@ -358,7 +358,7 @@ 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()) + '/';
|
||||
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("/(.*)/(.*)/(.*)/(.*)/(.*)");
|
||||
@ -426,7 +426,7 @@ void CVS::scanMaster()
|
||||
void CVS::registrer(string const & msg)
|
||||
{
|
||||
doVCCommand("cvs -q add -m \"" + msg + "\" "
|
||||
+ quoteName(onlyFilename(owner_->absFileName())),
|
||||
+ quoteName(onlyFileName(owner_->absFileName())),
|
||||
FileName(owner_->filePath()));
|
||||
}
|
||||
|
||||
@ -434,7 +434,7 @@ void CVS::registrer(string const & msg)
|
||||
string CVS::checkIn(string const & msg)
|
||||
{
|
||||
int ret = doVCCommand("cvs -q commit -m \"" + msg + "\" "
|
||||
+ quoteName(onlyFilename(owner_->absFileName())),
|
||||
+ quoteName(onlyFileName(owner_->absFileName())),
|
||||
FileName(owner_->filePath()));
|
||||
return ret ? string() : "CVS: Proceeded";
|
||||
}
|
||||
@ -492,7 +492,7 @@ void CVS::revert()
|
||||
{
|
||||
// Reverts to the version in CVS repository and
|
||||
// gets the updated version from the repository.
|
||||
string const fil = quoteName(onlyFilename(owner_->absFileName()));
|
||||
string const fil = quoteName(onlyFileName(owner_->absFileName()));
|
||||
// This is sensitive operation, so at lest some check about
|
||||
// existence of cvs program and its file
|
||||
if (doVCCommand("cvs log "+ fil, FileName(owner_->filePath())))
|
||||
@ -522,7 +522,7 @@ bool CVS::undoLastEnabled()
|
||||
|
||||
void CVS::getLog(FileName const & tmpf)
|
||||
{
|
||||
doVCCommand("cvs log " + quoteName(onlyFilename(owner_->absFileName()))
|
||||
doVCCommand("cvs log " + quoteName(onlyFileName(owner_->absFileName()))
|
||||
+ " > " + quoteName(tmpf.toFilesystemEncoding()),
|
||||
FileName(owner_->filePath()));
|
||||
}
|
||||
@ -575,7 +575,7 @@ 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());
|
||||
string const tmpf = onlyFileName(file.absFileName());
|
||||
LYXERR(Debug::LYXVC, "LyXVC: Checking if file is under svn in `" << entries
|
||||
<< "' for `" << tmpf << '\'');
|
||||
if (entries.isReadableFile()) {
|
||||
@ -652,7 +652,7 @@ bool SVN::isLocked() const
|
||||
|
||||
void SVN::registrer(string const & /*msg*/)
|
||||
{
|
||||
doVCCommand("svn add -q " + quoteName(onlyFilename(owner_->absFileName())),
|
||||
doVCCommand("svn add -q " + quoteName(onlyFileName(owner_->absFileName())),
|
||||
FileName(owner_->filePath()));
|
||||
}
|
||||
|
||||
@ -666,7 +666,7 @@ string SVN::checkIn(string const & msg)
|
||||
}
|
||||
|
||||
doVCCommand("svn commit -m \"" + msg + "\" "
|
||||
+ quoteName(onlyFilename(owner_->absFileName()))
|
||||
+ quoteName(onlyFileName(owner_->absFileName()))
|
||||
+ " > " + quoteName(tmpf.toFilesystemEncoding()),
|
||||
FileName(owner_->filePath()));
|
||||
|
||||
@ -728,7 +728,7 @@ void SVN::fileLock(bool lock, FileName const & tmpf, string &status)
|
||||
return;
|
||||
|
||||
string const arg = lock ? "lock " : "unlock ";
|
||||
doVCCommand("svn "+ arg + quoteName(onlyFilename(owner_->absFileName()))
|
||||
doVCCommand("svn "+ arg + quoteName(onlyFileName(owner_->absFileName()))
|
||||
+ " > " + quoteName(tmpf.toFilesystemEncoding()),
|
||||
FileName(owner_->filePath()));
|
||||
|
||||
@ -762,7 +762,7 @@ string SVN::checkOut()
|
||||
return N_("Error: Could not generate logfile.");
|
||||
}
|
||||
|
||||
doVCCommand("svn update --non-interactive " + quoteName(onlyFilename(owner_->absFileName()))
|
||||
doVCCommand("svn update --non-interactive " + quoteName(onlyFileName(owner_->absFileName()))
|
||||
+ " > " + quoteName(tmpf.toFilesystemEncoding()),
|
||||
FileName(owner_->filePath()));
|
||||
|
||||
@ -855,7 +855,7 @@ string SVN::lockingToggle()
|
||||
return N_("Error: Could not generate logfile.");
|
||||
}
|
||||
|
||||
int ret = doVCCommand("svn proplist " + quoteName(onlyFilename(owner_->absFileName()))
|
||||
int ret = doVCCommand("svn proplist " + quoteName(onlyFileName(owner_->absFileName()))
|
||||
+ " > " + quoteName(tmpf.toFilesystemEncoding()),
|
||||
FileName(owner_->filePath()));
|
||||
if (ret)
|
||||
@ -866,12 +866,12 @@ string SVN::lockingToggle()
|
||||
bool locking = contains(res, "svn:needs-lock");
|
||||
if (!locking)
|
||||
ret = doVCCommand("svn propset svn:needs-lock ON "
|
||||
+ quoteName(onlyFilename(owner_->absFileName()))
|
||||
+ quoteName(onlyFileName(owner_->absFileName()))
|
||||
+ " > " + quoteName(tmpf.toFilesystemEncoding()),
|
||||
FileName(owner_->filePath()));
|
||||
else
|
||||
ret = doVCCommand("svn propdel svn:needs-lock "
|
||||
+ quoteName(onlyFilename(owner_->absFileName()))
|
||||
+ quoteName(onlyFileName(owner_->absFileName()))
|
||||
+ " > " + quoteName(tmpf.toFilesystemEncoding()),
|
||||
FileName(owner_->filePath()));
|
||||
if (ret)
|
||||
@ -897,7 +897,7 @@ void SVN::revert()
|
||||
{
|
||||
// Reverts to the version in CVS repository and
|
||||
// gets the updated version from the repository.
|
||||
string const fil = quoteName(onlyFilename(owner_->absFileName()));
|
||||
string const fil = quoteName(onlyFileName(owner_->absFileName()));
|
||||
|
||||
doVCCommand("svn revert -q " + fil,
|
||||
FileName(owner_->filePath()));
|
||||
@ -964,7 +964,7 @@ bool SVN::getFileRevisionInfo()
|
||||
return N_("Error: Could not generate logfile.");
|
||||
}
|
||||
|
||||
doVCCommand("svn info --xml " + quoteName(onlyFilename(owner_->absFileName()))
|
||||
doVCCommand("svn info --xml " + quoteName(onlyFileName(owner_->absFileName()))
|
||||
+ " > " + quoteName(tmpf.toFilesystemEncoding()),
|
||||
FileName(owner_->filePath()));
|
||||
|
||||
@ -1037,7 +1037,7 @@ bool SVN::getTreeRevisionInfo()
|
||||
|
||||
void SVN::getLog(FileName const & tmpf)
|
||||
{
|
||||
doVCCommand("svn log " + quoteName(onlyFilename(owner_->absFileName()))
|
||||
doVCCommand("svn log " + quoteName(onlyFileName(owner_->absFileName()))
|
||||
+ " > " + quoteName(tmpf.toFilesystemEncoding()),
|
||||
FileName(owner_->filePath()));
|
||||
}
|
||||
@ -1068,7 +1068,7 @@ bool SVN::prepareFileRevision(string const & revis, string & f)
|
||||
}
|
||||
|
||||
doVCCommand("svn cat -r " + convert<string>(rev) + " "
|
||||
+ quoteName(onlyFilename(owner_->absFileName()))
|
||||
+ quoteName(onlyFileName(owner_->absFileName()))
|
||||
+ " > " + quoteName(tmpf.toFilesystemEncoding()),
|
||||
FileName(owner_->filePath()));
|
||||
if (tmpf.isFileEmpty())
|
||||
|
@ -459,7 +459,7 @@ QStringList GuiBibtex::bibStyles() const
|
||||
data = texFileList("bstFiles.lst");
|
||||
}
|
||||
for (int i = 0; i != data.size(); ++i)
|
||||
data[i] = onlyFilename(data[i]);
|
||||
data[i] = onlyFileName(data[i]);
|
||||
// sort on filename only (no path)
|
||||
data.sort();
|
||||
return data;
|
||||
@ -475,7 +475,7 @@ QStringList GuiBibtex::bibFiles() const
|
||||
data = texFileList("bibFiles.lst");
|
||||
}
|
||||
for (int i = 0; i != data.size(); ++i)
|
||||
data[i] = onlyFilename(data[i]);
|
||||
data[i] = onlyFileName(data[i]);
|
||||
// sort on filename only (no path)
|
||||
data.sort();
|
||||
return data;
|
||||
|
@ -115,9 +115,9 @@ QString browseFile(QString const & filename,
|
||||
FileDialog::Result result;
|
||||
|
||||
if (save)
|
||||
result = dlg.save(lastPath, filters, onlyFilename(filename));
|
||||
result = dlg.save(lastPath, filters, onlyFileName(filename));
|
||||
else
|
||||
result = dlg.open(lastPath, filters, onlyFilename(filename));
|
||||
result = dlg.open(lastPath, filters, onlyFileName(filename));
|
||||
|
||||
return result.second;
|
||||
}
|
||||
@ -155,7 +155,7 @@ QString browseLibFile(QString const & dir,
|
||||
noextresult = result;
|
||||
|
||||
// remove the directory, if it is the default one
|
||||
QString const file = onlyFilename(noextresult);
|
||||
QString const file = onlyFileName(noextresult);
|
||||
if (toqstr(libFileSearch(dir, file, ext).absFileName()) == result)
|
||||
return file;
|
||||
else
|
||||
@ -184,7 +184,7 @@ QString browseDir(QString const & pathname,
|
||||
dlg.setButton2(label2, dir2);
|
||||
|
||||
FileDialog::Result const result =
|
||||
dlg.opendir(lastPath, onlyFilename(pathname));
|
||||
dlg.opendir(lastPath, onlyFileName(pathname));
|
||||
|
||||
return result.second;
|
||||
}
|
||||
|
@ -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())
|
||||
|
@ -135,7 +135,7 @@ void GuiTexInfo::updateStyles(TexFileType type)
|
||||
|
||||
if (!pathCB->isChecked()) {
|
||||
for (int i = 0; i != data.size(); ++i)
|
||||
data[i] = onlyFilename(data[i]);
|
||||
data[i] = onlyFileName(data[i]);
|
||||
}
|
||||
// sort on filename only (no path)
|
||||
data.sort();
|
||||
|
@ -271,9 +271,9 @@ QString internalPath(const QString & str)
|
||||
}
|
||||
|
||||
|
||||
QString onlyFilename(const QString & str)
|
||||
QString onlyFileName(const QString & str)
|
||||
{
|
||||
return toqstr(support::onlyFilename(fromqstr(str)));
|
||||
return toqstr(support::onlyFileName(fromqstr(str)));
|
||||
}
|
||||
|
||||
|
||||
|
@ -115,7 +115,7 @@ docstring const internalLineEnding(QString const & str);
|
||||
|
||||
// wrapper around the docstring versions
|
||||
QString internalPath(QString const &);
|
||||
QString onlyFilename(QString const & str);
|
||||
QString onlyFileName(QString const & str);
|
||||
QString onlyPath(QString const & str);
|
||||
QStringList fileFilters(QString const & description);
|
||||
|
||||
|
@ -162,7 +162,7 @@ Converter::Impl::Impl(FileName const & from_file, string const & to_file_base,
|
||||
// Note: 'python ' is absolutely essential, or execvp will fail.
|
||||
script_command_ = os::python() + ' ' +
|
||||
quoteName(script_file_.toFilesystemEncoding()) + ' ' +
|
||||
quoteName(onlyFilename(from_file.toFilesystemEncoding())) + ' ' +
|
||||
quoteName(onlyFileName(from_file.toFilesystemEncoding())) + ' ' +
|
||||
quoteName(to_format);
|
||||
// All is ready to go
|
||||
valid_process_ = true;
|
||||
|
@ -91,7 +91,7 @@ string const doSubstitution(InsetExternalParams const & params,
|
||||
params.filename.mangledFileName() :
|
||||
params.filename.outputFileName(parentpath);
|
||||
string const basename = changeExtension(
|
||||
onlyFilename(filename), string());
|
||||
onlyFileName(filename), string());
|
||||
string const absname = makeAbsPath(filename, parentpath).absFileName();
|
||||
|
||||
string result = s;
|
||||
|
@ -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"),
|
||||
@ -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())
|
||||
|
@ -385,7 +385,7 @@ docstring InsetInclude::screenLabel() const
|
||||
if (params()["filename"].empty())
|
||||
temp += "???";
|
||||
else
|
||||
temp += from_utf8(onlyFilename(to_utf8(params()["filename"])));
|
||||
temp += from_utf8(onlyFileName(to_utf8(params()["filename"])));
|
||||
|
||||
return temp;
|
||||
}
|
||||
|
@ -394,7 +394,7 @@ FileName const get_binary_path(string const & exe)
|
||||
|
||||
// 2. exe must be the name of the binary only and it
|
||||
// can be found on the PATH.
|
||||
string const exe_name = onlyFilename(exe_path);
|
||||
string const exe_name = onlyFileName(exe_path);
|
||||
if (exe_name != exe_path)
|
||||
return FileName();
|
||||
|
||||
|
@ -464,7 +464,7 @@ FileName const makeAbsPath(string const & relPath, string const & basePath)
|
||||
// Chops any path of filename.
|
||||
string const addName(string const & path, string const & fname)
|
||||
{
|
||||
string const basename = onlyFilename(fname);
|
||||
string const basename = onlyFileName(fname);
|
||||
string buf;
|
||||
|
||||
if (path != "." && path != "./" && !path.empty()) {
|
||||
@ -478,7 +478,7 @@ string const addName(string const & path, string const & fname)
|
||||
|
||||
|
||||
// Strips path from filename
|
||||
string const onlyFilename(string const & fname)
|
||||
string const onlyFileName(string const & fname)
|
||||
{
|
||||
if (fname.empty())
|
||||
return fname;
|
||||
@ -675,7 +675,7 @@ string const unzippedFileName(string const & zipped_file)
|
||||
string const ext = getExtension(zipped_file);
|
||||
if (ext == "gz" || ext == "z" || ext == "Z")
|
||||
return changeExtension(zipped_file, string());
|
||||
return onlyPath(zipped_file) + "unzipped_" + onlyFilename(zipped_file);
|
||||
return onlyPath(zipped_file) + "unzipped_" + onlyFileName(zipped_file);
|
||||
}
|
||||
|
||||
|
||||
@ -723,7 +723,7 @@ docstring const makeDisplayPath(string const & path, unsigned int threshold)
|
||||
if (str.empty()) {
|
||||
// Yes, filename itself is too long.
|
||||
// Pick the start and the end of the filename.
|
||||
str = onlyFilename(path);
|
||||
str = onlyFileName(path);
|
||||
string const head = str.substr(0, threshold / 2 - 3);
|
||||
|
||||
string::size_type len = str.length();
|
||||
|
@ -225,7 +225,7 @@ makeRelPath(docstring const & abspath, docstring const & basepath);
|
||||
std::string const onlyPath(std::string const & fname);
|
||||
|
||||
/// Strips path from filename
|
||||
std::string const onlyFilename(std::string const & fname);
|
||||
std::string const onlyFileName(std::string const & fname);
|
||||
|
||||
/** Check and Replace Environmentvariables ${NAME} in Path.
|
||||
Replaces all occurences of these, if they are found in the
|
||||
|
Loading…
Reference in New Issue
Block a user