71
* Tries to load \a doc from config file, or if that fails, from a back up.
73
bool AtomicXmlFile::loadDocument(QDomDocument* doc) const
71
QStringList AtomicXmlFile::loadCandidateList() const {
77
72
QStringList fileNames;
78
73
fileNames << fileName_
80
75
<< backupFileName();
82
foreach(QString fileName, fileNames)
83
if (loadDocument(doc, fileName))
80
* Tries to load \a doc from config file, or if that fails, from a back up.
82
bool AtomicXmlFile::loadDocument(QDomDocument* doc) const
87
foreach(QString fileName, loadCandidateList()) {
88
if (loadDocument(doc, fileName)) {
155
* Check if an AtomicXmlFile exists.
156
* returns true if any of the files loadDocument tries to read exists,
157
* it *doesn't* check that there is at least one uncorupted file.
159
bool AtomicXmlFile::exists(QString fileName) {
160
AtomicXmlFile tmp(fileName);
162
foreach(QString fileName, tmp.loadCandidateList()) {
163
if (QFile::exists(fileName)) {