Revert r29505. We forgot that we cannot retrieve the new autosavefile yet, because the buffer might still be marked as unnamed. So, we should first finish this administration, before we can get the location of the new autosave filename.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29506 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2009-05-03 10:16:49 +00:00
parent dce037ed5a
commit 11ecc24c0c

View File

@ -491,17 +491,9 @@ void Buffer::setReadonly(bool const flag)
void Buffer::setFileName(string const & newfile)
{
// bring the autosave file with us, just in case.
FileName const oldauto = getAutosaveFilename();
d->filename = makeAbsPath(newfile);
setReadonly(d->filename.isReadOnly());
updateTitles();
FileName const newauto = getAutosaveFilename();
if (oldauto == newauto)
return;
if (oldauto.moveTo(newauto))
return;
LYXERR0("Unable to remove autosave file `" << oldauto << "'!");
}