diff options
author | Sebastian Schmelzer | 2011-07-13 11:18:13 +0200 |
---|---|---|
committer | Sebastian Schmelzer | 2011-07-13 11:18:13 +0200 |
commit | 0451c3677dbd6cdac99521e59f90dca16f8739b2 (patch) | |
tree | 0bbf7466b9d03d23d483780690addb193785667d /src/vsession.cpp | |
parent | update win7 logo (diff) | |
download | vmchooser-0451c3677dbd6cdac99521e59f90dca16f8739b2.tar.gz vmchooser-0451c3677dbd6cdac99521e59f90dca16f8739b2.tar.xz vmchooser-0451c3677dbd6cdac99521e59f90dca16f8739b2.zip |
fix problems with unreadable files
cleaned up debug messages
changed pools parameter to env
Diffstat (limited to 'src/vsession.cpp')
-rw-r--r-- | src/vsession.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/vsession.cpp b/src/vsession.cpp index 4d48326..e9059f2 100644 --- a/src/vsession.cpp +++ b/src/vsession.cpp @@ -110,13 +110,13 @@ bool VSession::isActive() const { if (fromDate.isValid() && fromDate > today) { // fromDate is in the future - if (debugMode) qDebug() << "ERR: fromDate is in the future"; + if (debugMode) qDebug() << "Not active. Reason: fromDate is in the future"; return false; } if (tillDate.isValid() && tillDate < today) { // tillDate is in the past - if (debugMode) qDebug() << "ERR: tillDate is in the past"; + if (debugMode) qDebug() << "Not active. Reason: tillDate is in the past"; return false; } } @@ -125,7 +125,7 @@ bool VSession::isActive() const { QStringList pools = getAttribute("pools").split("\\s*,\\s*"); if (!pools.isEmpty() && !pools.contains(pool)) { // pools does not contain pool - if (debugMode) qDebug() << "ERR: pools does not contain pool"; + if (debugMode) qDebug() << "Not active. Reason: vsession is not part of active env"; return false; } } @@ -362,8 +362,19 @@ QList<Session*> VSession::readXmlDir(const QString& path) { QDirIterator::FollowSymlinks); while (di.hasNext()) { if (!di.next().endsWith(".xml")) continue; + + if (!di.fileInfo().isReadable()) { + if (debugMode) qDebug() << "skip" << di.fileInfo().absoluteFilePath() << ": xml not readable, incorrect file permissions"; + continue; + } + QList<Session*> vsessionTmp = readXmlFile(di.fileInfo().absoluteFilePath()); + if (vsessionTmp.isEmpty()) { + if (debugMode) qDebug() << "skip" << di.fileInfo().absoluteFilePath() << ": reading xml failed for some reason"; + continue; + } + if (!vsessionTmp.first()->isValid()) { if (debugMode) qDebug() << "skip" << vsessionTmp.first()->shortDescription() << ": vdi/vmdk missing"; continue; |