Enrico Forestieri wrote:
On Thu, Dec 13, 2007 at 07:36:49AM -0000, [EMAIL PROTECTED] wrote:
Author: younes
Date: Thu Dec 13 08:36:47 2007
New Revision: 22117
URL: http://www.lyx.org/trac/changeset/22117
Log:
add FileName::renameTo() method.
Modified:
lyx-devel/trunk/src/support/FileName.cpp
lyx-devel/trunk/src/support/FileName.h
Modified: lyx-devel/trunk/src/support/FileName.cpp
URL:
http://www.lyx.org/trac/file/lyx-devel/trunk/src/support/FileName.cpp?rev=22117
==============================================================================
--- lyx-devel/trunk/src/support/FileName.cpp (original)
+++ lyx-devel/trunk/src/support/FileName.cpp Thu Dec 13 08:36:47 2007
@@ -135,6 +135,15 @@
if (!success)
lyxerr << "FileName::copyTo(): Could not copy file "
<< *this << " to " << name << endl;
+ return success;
+}
+
+
+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);
LYXERR0("Could not rename file " << *this << " as " << name);
maybe?
Yes :-)