mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
revert erroneous previous commit.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26958 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
6a8219c190
commit
da640391fc
@ -14,7 +14,6 @@
|
||||
#include "Session.h"
|
||||
|
||||
#include "support/debug.h"
|
||||
#include "support/FileNameList.h"
|
||||
#include "support/filetools.h"
|
||||
#include "support/Package.h"
|
||||
|
||||
@ -103,23 +102,31 @@ void LastFilesSection::setNumberOfLastFiles(unsigned int no)
|
||||
}
|
||||
|
||||
|
||||
void LastOpenedSection::read(istream & /*is*/)
|
||||
void LastOpenedSection::read(istream & is)
|
||||
{
|
||||
lastopened.clear();
|
||||
FileNameList list;// = theApp()->fileNameListFromSession("last_opened");
|
||||
for (size_t i = 0; i != list.size(); ++i) {
|
||||
FileName const & file = list[i];
|
||||
if (!file.isAbsolute() || !file.exists() || file.isDirectory())
|
||||
LYXERR(Debug::INIT, "Warning: invalid last opened file: " << file);
|
||||
else
|
||||
string tmp;
|
||||
do {
|
||||
char c = is.peek();
|
||||
if (c == '[')
|
||||
break;
|
||||
getline(is, tmp);
|
||||
FileName const file(tmp);
|
||||
if (tmp == "" || tmp[0] == '#' || tmp[0] == ' ' || !file.isAbsolute())
|
||||
continue;
|
||||
|
||||
if (file.exists() && !file.isDirectory())
|
||||
lastopened.push_back(file);
|
||||
}
|
||||
else
|
||||
LYXERR(Debug::INIT, "LyX: Warning: Ignore last opened file: " << tmp);
|
||||
} while (is.good());
|
||||
}
|
||||
|
||||
|
||||
void LastOpenedSection::write(ostream & /*os*/) const
|
||||
void LastOpenedSection::write(ostream & os) const
|
||||
{
|
||||
//theApp()->toSession(lastopened);
|
||||
os << '\n' << sec_lastopened << '\n';
|
||||
copy(lastopened.begin(), lastopened.end(),
|
||||
ostream_iterator<FileName>(os, "\n"));
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user