]> git.lyx.org Git - lyx.git/commitdiff
Fix bug #6525: Autosave error when renaming a new file.
authorVincent van Ravesteijn <vfr@lyx.org>
Fri, 12 Feb 2010 23:01:36 +0000 (23:01 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Fri, 12 Feb 2010 23:01:36 +0000 (23:01 +0000)
Don't try to move the autosave file if it does not exist.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33454 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp

index 55e0f72560b1e0ffb1a916bfcbea5a2e25429999..fb9fbcdb3e432a3556fd5d93f006eed54bd7adfc 100644 (file)
@@ -3122,8 +3122,10 @@ void Buffer::removeAutosaveFile() const
 void Buffer::moveAutosaveFile(support::FileName const & oldauto) const
 {
        FileName const newauto = getAutosaveFilename();
-       if (!(oldauto == newauto || oldauto.moveTo(newauto)))
-               LYXERR0("Unable to remove autosave file `" << oldauto << "'!");
+       oldauto.refresh();
+       if (newauto != oldauto && oldauto.exists())
+               if (!oldauto.moveTo(newauto)))
+                       LYXERR0("Unable to move autosave file `" << oldauto << "'!");
 }