From: Vincent van Ravesteijn Date: Fri, 3 Apr 2009 20:07:43 +0000 (+0000) Subject: Store the autosave file in the default document path as long as the document is ... X-Git-Tag: 2.0.0~6955 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=4ec167330f19e7385e57209dd2d33a850774fddb;p=features.git Store the autosave file in the default document path as long as the document is 'unnamed'. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29065 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 888f820728..48474c5f34 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -2436,12 +2436,11 @@ void Buffer::autoSave() const message(_("Autosaving current document...")); // create autosave filename - string fname = filePath(); - fname += '#'; - fname += d->filename.onlyFileName(); - fname += '#'; + string fpath = isUnnamed() ? lyxrc.document_path : filePath(); + string fname = "#" + d->filename.onlyFileName() + "#"; + FileName file_name = makeAbsPath(fname, fpath); - AutoSaveBuffer autosave(*this, FileName(fname)); + AutoSaveBuffer autosave(*this, file_name); autosave.start(); markBakClean();