mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-27 11:52:25 +00:00
add FileName::renameTo() method.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22117 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
6b8cd3a7cd
commit
15fe6b3c53
@ -139,6 +139,15 @@ bool FileName::copyTo(FileName const & name, bool overwrite) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool FileName::renameTo(FileName const & name) const
|
||||||
|
{
|
||||||
|
bool success = QFile::rename(d->fi.absoluteFilePath(), name.d->fi.absoluteFilePath());
|
||||||
|
if (!success)
|
||||||
|
LYXERR0("Could not copy file " << *this << " to " << name);
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
string FileName::toFilesystemEncoding() const
|
string FileName::toFilesystemEncoding() const
|
||||||
{
|
{
|
||||||
QByteArray const encoded = QFile::encodeName(d->fi.absoluteFilePath());
|
QByteArray const encoded = QFile::encodeName(d->fi.absoluteFilePath());
|
||||||
|
@ -98,6 +98,11 @@ public:
|
|||||||
/// \retrun true on success.
|
/// \retrun true on success.
|
||||||
bool removeFile() const;
|
bool removeFile() const;
|
||||||
|
|
||||||
|
/// rename pointed file.
|
||||||
|
/// \retrun true on success.
|
||||||
|
bool renameTo(FileName const & target) const;
|
||||||
|
|
||||||
|
|
||||||
/// remove directory and all contents, returns true on success
|
/// remove directory and all contents, returns true on success
|
||||||
bool destroyDirectory() const;
|
bool destroyDirectory() const;
|
||||||
/// Creates directory. Returns true on success
|
/// Creates directory. Returns true on success
|
||||||
|
Loading…
Reference in New Issue
Block a user