backupName = FileName(addName(lyxrc.backupdir_path,
mangledName));
}
- if (fileName().copyTo(backupName, true)) {
+ if (fileName().copyTo(backupName)) {
madeBackup = true;
} else {
Alert::error(_("Backup failure"),
return false;
}
- if (emb.copyTo(ext, true))
+ if (emb.copyTo(ext))
return true;
Alert::error(_("Copy file failure"),
FileName path = emb.onlyPath();
if (!path.isDirectory())
path.createPath();
- if (ext.copyTo(emb, true))
+ if (ext.copyTo(emb))
return true;
Alert::error(_("Copy file failure"),
bformat(_("Cannot copy file %1$s to %2$s.\n"
::zipFiles(zipfile.toFilesystemEncoding(), filenames);
// copy file back
- if (!zipfile.copyTo(filename, true)) {
+ if (!zipfile.copyTo(filename)) {
Alert::error(_("Save failure"),
bformat(_("Cannot create file %1$s.\n"
"Please check whether the directory exists and is writeable."),
bool Mover::do_copy(FileName const & from, FileName const & to,
string const &) const
{
- return from.copyTo(to, true);
+ return from.copyTo(to);
}
FileName const out_file = makeAbsPath(database + ".bib",
buffer.masterBuffer()->temppath());
- bool const success = in_file.copyTo(out_file, true);
+ bool const success = in_file.copyTo(out_file);
if (!success) {
lyxerr << "Failed to copy '" << in_file
<< "' to '" << out_file << "'"
base = removeExtension(in_file.mangledFilename());
FileName const out_file(makeAbsPath(base + ".bst",
buffer.masterBuffer()->temppath()));
- bool const success = in_file.copyTo(out_file, true);
+ bool const success = in_file.copyTo(out_file);
if (!success) {
lyxerr << "Failed to copy '" << in_file
<< "' to '" << out_file << "'"
unsigned long const checksum_out = writefile.checksum();
if (checksum_in != checksum_out) {
- if (!included_file.copyTo(writefile, true)) {
+ if (!included_file.copyTo(writefile)) {
// FIXME UNICODE
LYXERR(Debug::LATEX,
to_utf8(bformat(_("Could not copy the file\n%1$s\n"
}
-bool FileName::copyTo(FileName const & name, bool overwrite) const
+bool FileName::copyTo(FileName const & name) const
{
- if (overwrite)
- QFile::remove(name.d->fi.absoluteFilePath());
+ QFile::remove(name.d->fi.absoluteFilePath());
bool success = QFile::copy(d->fi.absoluteFilePath(), name.d->fi.absoluteFilePath());
if (!success)
lyxerr << "FileName::copyTo(): Could not copy file "
/// copy a file
/// \return true when file/directory is writable (write test file)
- /// \param overwrite: set to true if we should erase the \c target
- /// file if it exists,
- bool copyTo(FileName const & target, bool overwrite = false) const;
+ /// \warning This methods has different semantics when system level
+ /// copy command, it will overwrite the \c target file if it exists,
+ bool copyTo(FileName const & target) const;
/// remove pointed file.
/// \return true on success.