[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [okteta] kasten/controllers/view/structures: structures: output a better error message when a parse
From:       Alex Richardson <arichardson.kde () googlemail ! com>
Date:       2013-06-30 20:57:53
Message-ID: E1UtOgz-0004kc-8Y () scm ! kde ! org
[Download RAW message or body]

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/kasten/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 <QDomDocument>
 #include <QScriptEngine>
 
+#include <KDebug>
+
 using namespace ParserStrings;
 
 OsdParser::OsdParser(const QString& pluginName, const QString& absolutePath)
@@ -180,8 +182,12 @@ QVector<TopLevelDataInformation*> OsdParser::parseStructures() \
const  
         if (!data)
         {
-            data = new DummyDataInformation(0,
-                    fileInfo.absoluteFilePath() + QLatin1String("_element") + \
QString::number(count)); +            QString name = readProperty(elem, \
PROPERTY_NAME); +            if (name.isEmpty())
+                name = fileInfo.absoluteFilePath() + QLatin1String("_element") + \
QString::number(count); +            kDebug() << "Failed to parse element" << \
elem.tagName() << name; +            kDebug() << "Parsing messages were:" << \
logger->messages(); +            data = new DummyDataInformation(0, name);
         }
         TopLevelDataInformation* topData = new TopLevelDataInformation(data, logger, \
                eng, fileInfo);
         QString lockOffsetStr = readProperty(elem, PROPERTY_DEFAULT_LOCK_OFFSET);
diff --git a/kasten/controllers/view/structures/structtool.cpp \
b/kasten/controllers/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 = def->structure(name);
                 if (data)
                     addChildItem(data);
+                else
+                    kDebug() << "Could not find structure with name" << name << "in" \
<< pluginName;  }
         }
     }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic