From kde-commits Sun Jun 30 20:57:53 2013 From: Alex Richardson Date: Sun, 30 Jun 2013 20:57:53 +0000 To: kde-commits Subject: [okteta] kasten/controllers/view/structures: structures: output a better error message when a parse Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=137262588231361 Git commit 4363cbc18a54fbdf3a5f3cd5866eddc51135a73d by Alex Richardson. Committed on 30/06/2013 at 20:56. Pushed by arichardson into branch 'master'. structures: output a better error message when a parse error occurrs M +8 -2 kasten/controllers/view/structures/parsers/osdparser.cpp M +2 -0 kasten/controllers/view/structures/structtool.cpp http://commits.kde.org/okteta/4363cbc18a54fbdf3a5f3cd5866eddc51135a73d diff --git a/kasten/controllers/view/structures/parsers/osdparser.cpp b/kas= ten/controllers/view/structures/parsers/osdparser.cpp index 91af656..5b0fc11 100644 --- a/kasten/controllers/view/structures/parsers/osdparser.cpp +++ b/kasten/controllers/view/structures/parsers/osdparser.cpp @@ -41,6 +41,8 @@ #include #include = +#include + using namespace ParserStrings; = OsdParser::OsdParser(const QString& pluginName, const QString& absolutePat= h) @@ -180,8 +182,12 @@ QVector OsdParser::parseStru= ctures() const = if (!data) { - data =3D new DummyDataInformation(0, - fileInfo.absoluteFilePath() + QLatin1String("_element"= ) + QString::number(count)); + QString name =3D readProperty(elem, PROPERTY_NAME); + if (name.isEmpty()) + name =3D fileInfo.absoluteFilePath() + QLatin1String("_ele= ment") + QString::number(count); + kDebug() << "Failed to parse element" << elem.tagName() << nam= e; + kDebug() << "Parsing messages were:" << logger->messages(); + data =3D new DummyDataInformation(0, name); } TopLevelDataInformation* topData =3D new TopLevelDataInformation(d= ata, logger, eng, fileInfo); QString lockOffsetStr =3D readProperty(elem, PROPERTY_DEFAULT_LOCK= _OFFSET); diff --git a/kasten/controllers/view/structures/structtool.cpp b/kasten/con= trollers/view/structures/structtool.cpp index 10ba7dd..4a60444 100644 --- a/kasten/controllers/view/structures/structtool.cpp +++ b/kasten/controllers/view/structures/structtool.cpp @@ -307,6 +307,8 @@ void StructTool::setSelectedStructuresInView() TopLevelDataInformation* data =3D def->structure(name); if (data) addChildItem(data); + else + kDebug() << "Could not find structure with name" << na= me << "in" << pluginName; } } }