diff options
Diffstat (limited to 'tests/hawd/datasetdefinition.cpp')
-rw-r--r-- | tests/hawd/datasetdefinition.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/hawd/datasetdefinition.cpp b/tests/hawd/datasetdefinition.cpp index 2fa96cf..4d1028b 100644 --- a/tests/hawd/datasetdefinition.cpp +++ b/tests/hawd/datasetdefinition.cpp | |||
@@ -108,7 +108,8 @@ DatasetDefinition::DatasetDefinition(const QString &path) | |||
108 | QJsonDocument jsonDoc = QJsonDocument::fromJson(file.readAll(), &error); | 108 | QJsonDocument jsonDoc = QJsonDocument::fromJson(file.readAll(), &error); |
109 | 109 | ||
110 | if (jsonDoc.isNull()) { | 110 | if (jsonDoc.isNull()) { |
111 | std::cerr << QObject::tr("Dataset definition file malformed at character %1: %2").arg(error.offset).arg(error.errorString()).toStdString() << std::endl; | 111 | m_lastError = QObject::tr("Dataset definition file malformed at character %1: %2").arg(error.offset).arg(error.errorString()); |
112 | std::cerr << m_lastError.toStdString() << std::endl; | ||
112 | } else { | 113 | } else { |
113 | m_valid = true; | 114 | m_valid = true; |
114 | QJsonObject json = jsonDoc.object(); | 115 | QJsonObject json = jsonDoc.object(); |
@@ -126,15 +127,25 @@ DatasetDefinition::DatasetDefinition(const QString &path) | |||
126 | } | 127 | } |
127 | } | 128 | } |
128 | } | 129 | } |
130 | } else { | ||
131 | m_lastError = QObject::tr("Could not open file for parsing: ").arg(path); | ||
129 | } | 132 | } |
130 | } | ||
131 | 133 | ||
134 | if (!m_lastError.isEmpty()) { | ||
135 | std::cerr << m_lastError.toStdString() << std::endl; | ||
136 | } | ||
137 | } | ||
132 | 138 | ||
133 | bool DatasetDefinition::isValid() const | 139 | bool DatasetDefinition::isValid() const |
134 | { | 140 | { |
135 | return m_valid; | 141 | return m_valid; |
136 | } | 142 | } |
137 | 143 | ||
144 | QString DatasetDefinition::lastError() const | ||
145 | { | ||
146 | return m_lastError; | ||
147 | } | ||
148 | |||
138 | QString DatasetDefinition::name() const | 149 | QString DatasetDefinition::name() const |
139 | { | 150 | { |
140 | return m_name; | 151 | return m_name; |