From 34bd172f9a8dc7b8c3b945e4ed8b9cf3d8313f5a Mon Sep 17 00:00:00 2001 From: dismine Date: Wed, 21 May 2014 19:59:53 +0300 Subject: [PATCH] Clear error message from parser. --HG-- branch : feature --- src/app/dialogs/tools/dialogtool.cpp | 12 ++--- src/app/xml/vpattern.cpp | 70 ++++++++-------------------- 2 files changed, 25 insertions(+), 57 deletions(-) diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index b6534f4f1..130a6ae4e 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -346,13 +346,11 @@ void DialogTool::Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label) flag = false; palette.setColor(labelEditFormula->foregroundRole(), Qt::red); emit ToolTip(e.GetMsg()); - qDebug() << "\nError:\n" - << "--------\n" - << "Message: " << e.GetMsg() << "\n" - << "Expression: \"" << e.GetExpr() << "\"\n" - << "Token: \"" << e.GetToken() << "\"\n" - << "Position: " << e.GetPos() << "\n" - << "Errc: " << QString::number(e.GetCode(), 16); + qDebug() << "\nMath parser error:\n" + << "--------------------------------------\n" + << "Message: " << e.GetMsg() << "\n" + << "Expression: " << e.GetExpr() << "\n" + << "--------------------------------------"; } } CheckState(); diff --git a/src/app/xml/vpattern.cpp b/src/app/xml/vpattern.cpp index c7806ca8e..7cb98f175 100644 --- a/src/app/xml/vpattern.cpp +++ b/src/app/xml/vpattern.cpp @@ -854,11 +854,8 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d catch(qmu::QmuParserError &e) { VExceptionObjectError excep(tr("Error creating or updating point of end line"), domElement); - QString message( "Message: " + e.GetMsg() + "\n"+ - + "Expression: \"" + e.GetExpr() + "\"\n"+ - + "Token: \"" + e.GetToken() + "\"\n"+ - + "Position: " + QString::number(e.GetPos()) + "\n"+ - + "Errc: " + QString::number(e.GetCode(), 16)); + QString message("Message: " + e.GetMsg() + "\n"+ + "Expression: " + e.GetExpr()); excep.AddMoreInformation(message); throw excep; } @@ -888,11 +885,8 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d catch(qmu::QmuParserError &e) { VExceptionObjectError excep(tr("Error creating or updating point along line"), domElement); - QString message( "Message: " + e.GetMsg() + "\n"+ - + "Expression: \"" + e.GetExpr() + "\"\n"+ - + "Token: \"" + e.GetToken() + "\"\n"+ - + "Position: " + QString::number(e.GetPos()) + "\n"+ - + "Errc: " + QString::number(e.GetCode(), 16)); + QString message("Message: " + e.GetMsg() + "\n"+ + "Expression: " + e.GetExpr()); excep.AddMoreInformation(message); throw excep; } @@ -923,11 +917,8 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d catch(qmu::QmuParserError &e) { VExceptionObjectError excep(tr("Error creating or updating point of shoulder"), domElement); - QString message( "Message: " + e.GetMsg() + "\n"+ - + "Expression: \"" + e.GetExpr() + "\"\n"+ - + "Token: \"" + e.GetToken() + "\"\n"+ - + "Position: " + QString::number(e.GetPos()) + "\n"+ - + "Errc: " + QString::number(e.GetCode(), 16)); + QString message("Message: " + e.GetMsg() + "\n"+ + "Expression: " + e.GetExpr()); excep.AddMoreInformation(message); throw excep; } @@ -958,11 +949,8 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d catch(qmu::QmuParserError &e) { VExceptionObjectError excep(tr("Error creating or updating point of normal"), domElement); - QString message( "Message: " + e.GetMsg() + "\n"+ - + "Expression: \"" + e.GetExpr() + "\"\n"+ - + "Token: \"" + e.GetToken() + "\"\n"+ - + "Position: " + QString::number(e.GetPos()) + "\n"+ - + "Errc: " + QString::number(e.GetCode(), 16)); + QString message("Message: " + e.GetMsg() + "\n"+ + "Expression: " + e.GetExpr()); excep.AddMoreInformation(message); throw excep; } @@ -993,11 +981,8 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d catch(qmu::QmuParserError &e) { VExceptionObjectError excep(tr("Error creating or updating point of bisector"), domElement); - QString message( "Message: " + e.GetMsg() + "\n"+ - + "Expression: \"" + e.GetExpr() + "\"\n"+ - + "Token: \"" + e.GetToken() + "\"\n"+ - + "Position: " + QString::number(e.GetPos()) + "\n"+ - + "Errc: " + QString::number(e.GetCode(), 16)); + QString message("Message: " + e.GetMsg() + "\n"+ + "Expression: " + e.GetExpr()); excep.AddMoreInformation(message); throw excep; } @@ -1048,11 +1033,8 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d catch(qmu::QmuParserError &e) { VExceptionObjectError excep(tr("Error creating or updating point of contact"), domElement); - QString message( "Message: " + e.GetMsg() + "\n"+ - + "Expression: \"" + e.GetExpr() + "\"\n"+ - + "Token: \"" + e.GetToken() + "\"\n"+ - + "Position: " + QString::number(e.GetPos()) + "\n"+ - + "Errc: " + QString::number(e.GetCode(), 16)); + QString message("Message: " + e.GetMsg() + "\n"+ + "Expression: " + e.GetExpr()); excep.AddMoreInformation(message); throw excep; } @@ -1164,11 +1146,8 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d catch(qmu::QmuParserError &e) { VExceptionObjectError excep(tr("Error creating or updating cut spline point"), domElement); - QString message( "Message: " + e.GetMsg() + "\n"+ - + "Expression: \"" + e.GetExpr() + "\"\n"+ - + "Token: \"" + e.GetToken() + "\"\n"+ - + "Position: " + QString::number(e.GetPos()) + "\n"+ - + "Errc: " + QString::number(e.GetCode(), 16)); + QString message("Message: " + e.GetMsg() + "\n"+ + "Expression: " + e.GetExpr()); excep.AddMoreInformation(message); throw excep; } @@ -1195,11 +1174,8 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d catch(qmu::QmuParserError &e) { VExceptionObjectError excep(tr("Error creating or updating cut spline path point"), domElement); - QString message( "Message: " + e.GetMsg() + "\n"+ - + "Expression: \"" + e.GetExpr() + "\"\n"+ - + "Token: \"" + e.GetToken() + "\"\n"+ - + "Position: " + QString::number(e.GetPos()) + "\n"+ - + "Errc: " + QString::number(e.GetCode(), 16)); + QString message("Message: " + e.GetMsg() + "\n"+ + "Expression: " + e.GetExpr()); excep.AddMoreInformation(message); throw excep; } @@ -1225,11 +1201,8 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d catch(qmu::QmuParserError &e) { VExceptionObjectError excep(tr("Error creating or updating cut arc point"), domElement); - QString message( "Message: " + e.GetMsg() + "\n"+ - + "Expression: \"" + e.GetExpr() + "\"\n"+ - + "Token: \"" + e.GetToken() + "\"\n"+ - + "Position: " + QString::number(e.GetPos()) + "\n"+ - + "Errc: " + QString::number(e.GetCode(), 16)); + QString message("Message: " + e.GetMsg() + "\n"+ + "Expression: " + e.GetExpr()); excep.AddMoreInformation(message); throw excep; } @@ -1419,11 +1392,8 @@ void VPattern::ParseArcElement(VMainGraphicsScene *scene, const QDomElement &dom catch(qmu::QmuParserError &e) { VExceptionObjectError excep(tr("Error creating or updating simple arc"), domElement); - QString message( "Message: " + e.GetMsg() + "\n"+ - + "Expression: \"" + e.GetExpr() + "\"\n"+ - + "Token: \"" + e.GetToken() + "\"\n"+ - + "Position: " + QString::number(e.GetPos()) + "\n"+ - + "Errc: " + QString::number(e.GetCode(), 16)); + QString message("Message: " + e.GetMsg() + "\n"+ + "Expression: " + e.GetExpr()); excep.AddMoreInformation(message); throw excep; }