From 9ef9df1b59b72a1d96b878bce467c4f8a6e199cd Mon Sep 17 00:00:00 2001 From: dismine Date: Mon, 24 Nov 2014 15:03:34 +0200 Subject: [PATCH] Continue creation logging system. --HG-- branch : develop --- src/app/tools/drawTools/vdrawtool.cpp | 3 ++- src/app/tools/vabstracttool.cpp | 3 ++- src/app/tools/vdatatool.cpp | 2 ++ src/app/tools/vdatatool.h | 3 +++ src/app/undocommands/adddet.cpp | 15 +++++------- src/app/undocommands/adddetnode.cpp | 15 +++++------- src/app/undocommands/addpatternpiece.cpp | 7 ++---- src/app/undocommands/addtocalc.cpp | 17 ++++++-------- src/app/undocommands/adduniondetails.cpp | 15 +++++------- src/app/undocommands/deletedetail.cpp | 11 ++++----- src/app/undocommands/deletepatternpiece.cpp | 7 ++---- src/app/undocommands/deltool.cpp | 7 ++---- src/app/undocommands/movedetail.cpp | 13 ++++------- src/app/undocommands/movespline.cpp | 9 +++---- src/app/undocommands/movesplinepath.cpp | 9 +++---- src/app/undocommands/movespoint.cpp | 24 +++++++++++++------ src/app/undocommands/renamepp.cpp | 9 +++---- src/app/undocommands/savedetailoptions.cpp | 12 ++++------ src/app/undocommands/savetooloptions.cpp | 11 ++++----- src/app/undocommands/vundocommand.cpp | 2 ++ src/app/undocommands/vundocommand.h | 3 +++ src/app/visualization/visualization.cpp | 2 ++ src/app/visualization/visualization.h | 3 +++ src/app/xml/vdomdocument.cpp | 5 ++-- src/app/xml/vdomdocument.h | 3 +++ src/app/xml/vpattern.cpp | 26 ++++++++++++++++----- 26 files changed, 119 insertions(+), 117 deletions(-) diff --git a/src/app/tools/drawTools/vdrawtool.cpp b/src/app/tools/drawTools/vdrawtool.cpp index 225f2e59c..228a9f85b 100644 --- a/src/app/tools/drawTools/vdrawtool.cpp +++ b/src/app/tools/drawTools/vdrawtool.cpp @@ -132,6 +132,7 @@ void VDrawTool::FullUpdateFromGuiApply() //--------------------------------------------------------------------------------------------------------------------- void VDrawTool::SaveDialogChange() { + qCDebug(vTool)<<"Saving tool options after using dialog"; QDomElement oldDomElement = doc->elementById(QString().setNum(id)); if (oldDomElement.isElement()) { @@ -144,7 +145,7 @@ void VDrawTool::SaveDialogChange() } else { - qDebug()<<"Can't find tool with id ="<< id << Q_FUNC_INFO; + qCDebug(vTool)<<"Can't find tool with id ="<< id << Q_FUNC_INFO; } } diff --git a/src/app/tools/vabstracttool.cpp b/src/app/tools/vabstracttool.cpp index df4efa59d..67037a51a 100644 --- a/src/app/tools/vabstracttool.cpp +++ b/src/app/tools/vabstracttool.cpp @@ -241,6 +241,7 @@ int VAbstractTool::ConfirmDeletion() //--------------------------------------------------------------------------------------------------------------------- void VAbstractTool::SaveOption(QSharedPointer &obj) { + qCDebug(vTool)<<"Saving tool options"; QDomElement oldDomElement = doc->elementById(QString().setNum(id)); if (oldDomElement.isElement()) { @@ -254,7 +255,7 @@ void VAbstractTool::SaveOption(QSharedPointer &obj) } else { - qDebug()<<"Can't find tool with id ="<< id << Q_FUNC_INFO; + qCDebug(vTool)<<"Can't find tool with id ="<< id << Q_FUNC_INFO; } } diff --git a/src/app/tools/vdatatool.cpp b/src/app/tools/vdatatool.cpp index d3140287b..aea1651f7 100644 --- a/src/app/tools/vdatatool.cpp +++ b/src/app/tools/vdatatool.cpp @@ -28,6 +28,8 @@ #include "vdatatool.h" +Q_LOGGING_CATEGORY(vTool, "v.tool") + //--------------------------------------------------------------------------------------------------------------------- /** * @brief VDataTool constructor. diff --git a/src/app/tools/vdatatool.h b/src/app/tools/vdatatool.h index 562d6dcca..e0798c7cb 100644 --- a/src/app/tools/vdatatool.h +++ b/src/app/tools/vdatatool.h @@ -30,6 +30,9 @@ #define VDATATOOL_H #include "../container/vcontainer.h" +#include + +Q_DECLARE_LOGGING_CATEGORY(vTool) class QObject; diff --git a/src/app/undocommands/adddet.cpp b/src/app/undocommands/adddet.cpp index 6f2985d28..de773f50d 100644 --- a/src/app/undocommands/adddet.cpp +++ b/src/app/undocommands/adddet.cpp @@ -28,9 +28,6 @@ #include "adddet.h" #include "../xml/vpattern.h" -#include - -Q_LOGGING_CATEGORY(vUndoAddDetail, "v.undo.add.detail") //--------------------------------------------------------------------------------------------------------------------- AddDet::AddDet(const QDomElement &xml, VPattern *doc, QUndoCommand *parent) @@ -48,7 +45,7 @@ AddDet::~AddDet() // cppcheck-suppress unusedFunction void AddDet::undo() { - qCDebug(vUndoAddDetail)<<"Undo."; + qCDebug(vUndo)<<"Undo."; QDomElement element; if (doc->GetActivNodeElement(VPattern::TagDetails, element)) @@ -58,19 +55,19 @@ void AddDet::undo() { if (element.removeChild(domElement).isNull()) { - qCDebug(vUndoAddDetail)<<"Can't delete node"; + qCDebug(vUndo)<<"Can't delete node"; return; } } else { - qCDebug(vUndoAddDetail)<<"Can't get node by id = "<GetActivNodeElement(VPattern::TagDetails, element)) @@ -89,7 +86,7 @@ void AddDet::redo() } else { - qCDebug(vUndoAddDetail)<<"Can't find tag"< - -Q_LOGGING_CATEGORY(vUndoAddDetailNode, "v.undo.add.detail.node") //--------------------------------------------------------------------------------------------------------------------- AddDetNode::AddDetNode(const QDomElement &xml, VPattern *doc, QUndoCommand *parent) @@ -47,7 +44,7 @@ AddDetNode::~AddDetNode() //--------------------------------------------------------------------------------------------------------------------- void AddDetNode::undo() { - qCDebug(vUndoAddDetailNode)<<"Undo."; + qCDebug(vUndo)<<"Undo."; QDomElement modelingElement; if (doc->GetActivNodeElement(VPattern::TagModeling, modelingElement)) @@ -57,19 +54,19 @@ void AddDetNode::undo() { if (modelingElement.removeChild(domElement).isNull()) { - qCDebug(vUndoAddDetailNode)<<"Can't delete node."; + qCDebug(vUndo)<<"Can't delete node."; return; } } else { - qCDebug(vUndoAddDetailNode)<<"Can't get node by id = "<GetActivNodeElement(VPattern::TagModeling, modelingElement)) @@ -86,7 +83,7 @@ void AddDetNode::redo() } else { - qCDebug(vUndoAddDetailNode)<<"Can't find tag"< - -Q_LOGGING_CATEGORY(vUndoAddPP, "v.undo.add.pp") //--------------------------------------------------------------------------------------------------------------------- AddPatternPiece::AddPatternPiece(const QDomElement &xml, VPattern *doc, const QString &namePP, const QString &mPath, @@ -49,7 +46,7 @@ AddPatternPiece::~AddPatternPiece() //--------------------------------------------------------------------------------------------------------------------- void AddPatternPiece::undo() { - qCDebug(vUndoAddPP)<<"Undo."; + qCDebug(vUndo)<<"Undo."; if (doc->CountPP() <= 1) { @@ -67,7 +64,7 @@ void AddPatternPiece::undo() //--------------------------------------------------------------------------------------------------------------------- void AddPatternPiece::redo() { - qCDebug(vUndoAddPP)<<"Redo."; + qCDebug(vUndo)<<"Redo."; if (doc->CountPP() == 0 && mPath.isEmpty() == false) { diff --git a/src/app/undocommands/addtocalc.cpp b/src/app/undocommands/addtocalc.cpp index 00d27682c..87f205c1f 100644 --- a/src/app/undocommands/addtocalc.cpp +++ b/src/app/undocommands/addtocalc.cpp @@ -32,9 +32,6 @@ #include "../core/vapplication.h" #include "../widgets/vmaingraphicsscene.h" #include "../widgets/vmaingraphicsview.h" -#include - -Q_LOGGING_CATEGORY(vUndoAddToCalc, "v.undo.add.to.calc") //--------------------------------------------------------------------------------------------------------------------- AddToCalc::AddToCalc(const QDomElement &xml, VPattern *doc, QUndoCommand *parent) @@ -51,7 +48,7 @@ AddToCalc::~AddToCalc() //--------------------------------------------------------------------------------------------------------------------- void AddToCalc::undo() { - qCDebug(vUndoAddToCalc)<<"Undo."; + qCDebug(vUndo)<<"Undo."; doc->ChangeActivPP(nameActivDraw);//User will not see this change doc->setCursor(cursor); @@ -64,19 +61,19 @@ void AddToCalc::undo() { if (calcElement.removeChild(domElement).isNull()) { - qCDebug(vUndoAddToCalc)<<"Can't delete node."; + qCDebug(vUndo)<<"Can't delete node."; return; } } else { - qCDebug(vUndoAddToCalc)<<"Can't get tool by id = "< 0) @@ -91,7 +88,7 @@ void AddToCalc::undo() //--------------------------------------------------------------------------------------------------------------------- void AddToCalc::redo() { - qCDebug(vUndoAddToCalc)<<"Redo."; + qCDebug(vUndo)<<"Redo."; doc->ChangeActivPP(nameActivDraw);//User will not see this change doc->setCursor(cursor); @@ -113,14 +110,14 @@ void AddToCalc::redo() } else { - qCDebug(vUndoAddToCalc)<<"Can not find the element after which you want to insert."; + qCDebug(vUndo)<<"Can not find the element after which you want to insert."; return; } } } else { - qCDebug(vUndoAddToCalc)<<"Can't find tag Calculation."; + qCDebug(vUndo)<<"Can't find tag Calculation."; return; } RedoFullParsing(); diff --git a/src/app/undocommands/adduniondetails.cpp b/src/app/undocommands/adduniondetails.cpp index 6e841a01b..9f5a8549e 100644 --- a/src/app/undocommands/adduniondetails.cpp +++ b/src/app/undocommands/adduniondetails.cpp @@ -28,9 +28,6 @@ #include "adduniondetails.h" #include "../xml/vpattern.h" -#include - -Q_LOGGING_CATEGORY(vUndoAddUnionDetails, "v.undo.add.union.details") //--------------------------------------------------------------------------------------------------------------------- AddUnionDetails::AddUnionDetails(const QDomElement &xml, VPattern *doc, QUndoCommand *parent) @@ -47,7 +44,7 @@ AddUnionDetails::~AddUnionDetails() //--------------------------------------------------------------------------------------------------------------------- void AddUnionDetails::undo() { - qCDebug(vUndoAddUnionDetails)<<"Undo."; + qCDebug(vUndo)<<"Undo."; QDomElement modelingElement; if (doc->GetActivNodeElement(VPattern::TagModeling, modelingElement)) @@ -57,19 +54,19 @@ void AddUnionDetails::undo() { if (modelingElement.removeChild(domElement).isNull()) { - qCDebug(vUndoAddUnionDetails)<<"Can't delete node."; + qCDebug(vUndo)<<"Can't delete node."; return; } } else { - qCDebug(vUndoAddUnionDetails)<<"Can't get node by id = "<GetActivNodeElement(VPattern::TagModeling, modelingElement)) @@ -87,7 +84,7 @@ void AddUnionDetails::redo() } else { - qCDebug(vUndoAddUnionDetails)<<"Can't find tag"< - -Q_LOGGING_CATEGORY(vUndoDeleteDetail, "v.undo.delete.detail") //--------------------------------------------------------------------------------------------------------------------- DeleteDetail::DeleteDetail(VPattern *doc, quint32 id, QUndoCommand *parent) @@ -57,7 +54,7 @@ DeleteDetail::DeleteDetail(VPattern *doc, quint32 id, QUndoCommand *parent) } else { - qCDebug(vUndoDeleteDetail)<<"Can't get detail by id ="<elementById(QString().setNum(nodeId)); if (domElement.isElement()) @@ -97,7 +94,7 @@ void DeleteDetail::redo() } else { - qCDebug(vUndoDeleteDetail)<<"Can't get detail by id = "< - -Q_LOGGING_CATEGORY(vUndoDeletePP, "v.undo.delete.pp") //--------------------------------------------------------------------------------------------------------------------- DeletePatternPiece::DeletePatternPiece(VPattern *doc, const QString &namePP, QUndoCommand *parent) @@ -54,7 +51,7 @@ DeletePatternPiece::~DeletePatternPiece() //--------------------------------------------------------------------------------------------------------------------- void DeletePatternPiece::undo() { - qCDebug(vUndoDeletePP)<<"Undo."; + qCDebug(vUndo)<<"Undo."; QDomElement rootElement = doc->documentElement(); QDomNode previousPP = doc->GetPPElement(previousPPName); @@ -67,7 +64,7 @@ void DeletePatternPiece::undo() //--------------------------------------------------------------------------------------------------------------------- void DeletePatternPiece::redo() { - qCDebug(vUndoDeletePP)<<"Redo."; + qCDebug(vUndo)<<"Redo."; QDomElement rootElement = doc->documentElement(); QDomElement patternPiece = doc->GetPPElement(namePP); diff --git a/src/app/undocommands/deltool.cpp b/src/app/undocommands/deltool.cpp index 661ae5c63..161bb88a8 100644 --- a/src/app/undocommands/deltool.cpp +++ b/src/app/undocommands/deltool.cpp @@ -30,9 +30,6 @@ #include "../xml/vpattern.h" #include #include "../tools/vtooldetail.h" -#include - -Q_LOGGING_CATEGORY(vUndoDeleteTool, "v.undo.delete.tool") //--------------------------------------------------------------------------------------------------------------------- DelTool::DelTool(VPattern *doc, quint32 id, QUndoCommand *parent) @@ -53,7 +50,7 @@ DelTool::~DelTool() //--------------------------------------------------------------------------------------------------------------------- void DelTool::undo() { - qCDebug(vUndoDeleteTool)<<"Undo."; + qCDebug(vUndo)<<"Undo."; UndoDeleteAfterSibling(parentNode, siblingId); emit NeedFullParsing(); @@ -63,7 +60,7 @@ void DelTool::undo() //--------------------------------------------------------------------------------------------------------------------- void DelTool::redo() { - qCDebug(vUndoDeleteTool)<<"Redo."; + qCDebug(vUndo)<<"Redo."; QDomElement domElement = doc->NodeById(nodeId); parentNode.removeChild(domElement); diff --git a/src/app/undocommands/movedetail.cpp b/src/app/undocommands/movedetail.cpp index ef2ca2cd0..8d5b42b16 100644 --- a/src/app/undocommands/movedetail.cpp +++ b/src/app/undocommands/movedetail.cpp @@ -32,9 +32,6 @@ #include "../xml/vpattern.h" #include "../tools/vabstracttool.h" #include "../core/vapplication.h" -#include - -Q_LOGGING_CATEGORY(vUndoMoveDetail, "v.undo.move.detail") //--------------------------------------------------------------------------------------------------------------------- MoveDetail::MoveDetail(VPattern *doc, const double &x, const double &y, const quint32 &id, QGraphicsScene *scene, @@ -53,7 +50,7 @@ MoveDetail::MoveDetail(VPattern *doc, const double &x, const double &y, const qu } else { - qCDebug(vUndoMoveDetail)<<"Can't find detail with id ="<elementById(QString().setNum(nodeId)); if (domElement.isElement()) @@ -79,7 +76,7 @@ void MoveDetail::undo() } else { - qCDebug(vUndoMoveDetail)<<"Can't find detail with id ="<elementById(QString().setNum(nodeId)); if (domElement.isElement()) @@ -105,7 +102,7 @@ void MoveDetail::redo() } else { - qCDebug(vUndoMoveDetail)<<"Can't find detail with id ="< #include #include "../xml/vpattern.h" -#include - -Q_LOGGING_CATEGORY(vUndoMoveSpline, "v.undo.move.spline") //--------------------------------------------------------------------------------------------------------------------- MoveSpline::MoveSpline(VPattern *doc, const VSpline *oldSpl, const VSpline &newSpl, const quint32 &id, @@ -53,7 +50,7 @@ MoveSpline::~MoveSpline() //--------------------------------------------------------------------------------------------------------------------- void MoveSpline::undo() { - qCDebug(vUndoMoveSpline)<<"Undo."; + qCDebug(vUndo)<<"Undo."; Do(oldSpline); } @@ -61,7 +58,7 @@ void MoveSpline::undo() //--------------------------------------------------------------------------------------------------------------------- void MoveSpline::redo() { - qCDebug(vUndoMoveSpline)<<"Redo."; + qCDebug(vUndo)<<"Redo."; Do(newSpline); } @@ -107,7 +104,7 @@ void MoveSpline::Do(const VSpline &spl) } else { - qCDebug(vUndoMoveSpline)<<"Can't find spline with id ="< #include "../tools/drawTools/vtoolsplinepath.h" -#include - -Q_LOGGING_CATEGORY(vUndoMoveSplinePath, "v.undo.move.splinepath") //--------------------------------------------------------------------------------------------------------------------- MoveSplinePath::MoveSplinePath(VPattern *doc, const VSplinePath &oldSplPath, const VSplinePath &newSplPath, @@ -51,7 +48,7 @@ MoveSplinePath::~MoveSplinePath() //--------------------------------------------------------------------------------------------------------------------- void MoveSplinePath::undo() { - qCDebug(vUndoMoveSplinePath)<<"Undo."; + qCDebug(vUndo)<<"Undo."; Do(oldSplinePath); } @@ -59,7 +56,7 @@ void MoveSplinePath::undo() //--------------------------------------------------------------------------------------------------------------------- void MoveSplinePath::redo() { - qCDebug(vUndoMoveSplinePath)<<"Redo."; + qCDebug(vUndo)<<"Redo."; Do(newSplinePath); } @@ -102,7 +99,7 @@ void MoveSplinePath::Do(const VSplinePath &splPath) } else { - qCDebug(vUndoMoveSplinePath)<<"Can't find spline path with id ="< - -Q_LOGGING_CATEGORY(vUndoMoveSPoint, "v.undo.move.spoint") //--------------------------------------------------------------------------------------------------------------------- MoveSPoint::MoveSPoint(VPattern *doc, const double &x, const double &y, const quint32 &id, QGraphicsScene *scene, @@ -43,6 +40,10 @@ MoveSPoint::MoveSPoint(VPattern *doc, const double &x, const double &y, const qu { setText(tr("Move single point")); nodeId = id; + qCDebug(vUndo)<<"SPoint id"<elementById(QString().setNum(id)); @@ -50,10 +51,13 @@ MoveSPoint::MoveSPoint(VPattern *doc, const double &x, const double &y, const qu { oldX = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrX, "0.0")); oldY = qApp->toPixel(doc->GetParametrDouble(domElement, VAbstractTool::AttrY, "0.0")); + + qCDebug(vUndo)<<"SPoint oldX"<getNewX(); newY = moveCommand->getNewY(); + qCDebug(vUndo)<<"SPoint newX"<elementById(QString().setNum(nodeId)); if (domElement.isElement()) { @@ -117,7 +127,7 @@ void MoveSPoint::Do(double x, double y) } else { - qCDebug(vUndoMoveSPoint)<<"Can't find spoint with id ="< #include "../options.h" #include "../xml/vpattern.h" -#include - -Q_LOGGING_CATEGORY(vUndoRenamePP, "v.undo.rename.pp") //--------------------------------------------------------------------------------------------------------------------- RenamePP::RenamePP(VPattern *doc, const QString &newPPname, QComboBox *combo, QUndoCommand *parent) @@ -51,7 +48,7 @@ RenamePP::~RenamePP() //--------------------------------------------------------------------------------------------------------------------- void RenamePP::undo() { - qCDebug(vUndoRenamePP)<<"Undo."; + qCDebug(vUndo)<<"Undo."; ChangeName(newPPname, oldPPname); } @@ -59,7 +56,7 @@ void RenamePP::undo() //--------------------------------------------------------------------------------------------------------------------- void RenamePP::redo() { - qCDebug(vUndoRenamePP)<<"Redo."; + qCDebug(vUndo)<<"Redo."; ChangeName(oldPPname, newPPname); } @@ -95,6 +92,6 @@ void RenamePP::ChangeName(const QString &oldName, const QString &newName) } else { - qCWarning(vUndoRenamePP)<<"Can't change pattern piece name"; + qCWarning(vUndo)<<"Can't change pattern piece name"; } } diff --git a/src/app/undocommands/savedetailoptions.cpp b/src/app/undocommands/savedetailoptions.cpp index 4c2d7d0d4..4dcb7d8d7 100644 --- a/src/app/undocommands/savedetailoptions.cpp +++ b/src/app/undocommands/savedetailoptions.cpp @@ -29,10 +29,8 @@ #include "savedetailoptions.h" #include "../tools/nodeDetails/vabstractnode.h" #include -#include - -Q_LOGGING_CATEGORY(vUndoSaveDetailOptions, "v.undo.save.detail.options") +//--------------------------------------------------------------------------------------------------------------------- SaveDetailOptions::SaveDetailOptions(const VDetail &oldDet, const VDetail &newDet, VPattern *doc, const quint32 &id, QGraphicsScene *scene, QUndoCommand *parent) : VUndoCommand(QDomElement(), doc, parent), oldDet(oldDet), newDet(newDet), scene(scene) @@ -48,7 +46,7 @@ SaveDetailOptions::~SaveDetailOptions() //--------------------------------------------------------------------------------------------------------------------- void SaveDetailOptions::undo() { - qCDebug(vUndoSaveDetailOptions)<<"Undo."; + qCDebug(vUndo)<<"Undo."; QDomElement domElement = doc->elementById(QString().setNum(nodeId)); if (domElement.isElement()) @@ -77,7 +75,7 @@ void SaveDetailOptions::undo() } else { - qCDebug(vUndoSaveDetailOptions)<<"Can't find detail with id ="<elementById(QString().setNum(nodeId)); if (domElement.isElement()) @@ -114,7 +112,7 @@ void SaveDetailOptions::redo() } else { - qCDebug(vUndoSaveDetailOptions)<<"Can't find detail with id ="< - -Q_LOGGING_CATEGORY(vUndoSaveToolOptions, "v.undo.save.tool.options") //--------------------------------------------------------------------------------------------------------------------- SaveToolOptions::SaveToolOptions(const QDomElement &oldXml, const QDomElement &newXml, VPattern *doc, const quint32 &id, @@ -49,7 +46,7 @@ SaveToolOptions::~SaveToolOptions() //--------------------------------------------------------------------------------------------------------------------- void SaveToolOptions::undo() { - qCDebug(vUndoSaveToolOptions)<<"Undo."; + qCDebug(vUndo)<<"Undo."; QDomElement domElement = doc->elementById(QString().setNum(nodeId)); if (domElement.isElement()) @@ -60,7 +57,7 @@ void SaveToolOptions::undo() } else { - qCDebug(vUndoSaveToolOptions)<<"Can't find tool with id ="<elementById(QString().setNum(nodeId)); if (domElement.isElement()) @@ -79,7 +76,7 @@ void SaveToolOptions::redo() } else { - qCDebug(vUndoSaveToolOptions)<<"Can't find tool with id ="< #include +#include #include "../xml/vpattern.h" +Q_DECLARE_LOGGING_CATEGORY(vUndo) + enum class UndoCommand: char { AddPatternPiece, AddToCalc, MoveSpline, diff --git a/src/app/visualization/visualization.cpp b/src/app/visualization/visualization.cpp index 6b27f3f02..2b9e14025 100644 --- a/src/app/visualization/visualization.cpp +++ b/src/app/visualization/visualization.cpp @@ -32,6 +32,8 @@ #include +Q_LOGGING_CATEGORY(vVis, "v.visualization") + //--------------------------------------------------------------------------------------------------------------------- Visualization::Visualization(const VContainer *data) :QObject(), data(data), factor(VDrawTool::factor), scenePos(QPointF()), diff --git a/src/app/visualization/visualization.h b/src/app/visualization/visualization.h index 3ff9a59e5..c2151697a 100644 --- a/src/app/visualization/visualization.h +++ b/src/app/visualization/visualization.h @@ -33,6 +33,9 @@ #include #include "../core/vapplication.h" #include "../widgets/vmaingraphicsscene.h" +#include + +Q_DECLARE_LOGGING_CATEGORY(vVis) class VContainer; diff --git a/src/app/xml/vdomdocument.cpp b/src/app/xml/vdomdocument.cpp index 82625bd29..1dce30c7d 100644 --- a/src/app/xml/vdomdocument.cpp +++ b/src/app/xml/vdomdocument.cpp @@ -39,7 +39,6 @@ #include #include #include -#include //This class need for validation pattern file using XSD shema class MessageHandler : public QAbstractMessageHandler @@ -91,7 +90,7 @@ void MessageHandler::handleMessage(QtMsgType type, const QString &description, c m_sourceLocation = sourceLocation; } -Q_LOGGING_CATEGORY(vDocument, "v.document") +Q_LOGGING_CATEGORY(vXML, "v.xml") const QString VDomDocument::AttrId = QStringLiteral("id"); const QString VDomDocument::AttrUnit = QStringLiteral("unit"); @@ -357,7 +356,7 @@ QString VDomDocument::UniqueTagText(const QString &tagName, const QString &defVa */ void VDomDocument::ValidateXML(const QString &schema, const QString &fileName) { - qCDebug(vDocument)<<"Validation xml file"< #include #include "../container/vcontainer.h" +#include + +Q_DECLARE_LOGGING_CATEGORY(vXML) /* can be used like #if (V_FORMAT_VERSION >= V_FORMAT_VERSION_CHECK(4, 4, 0)) diff --git a/src/app/xml/vpattern.cpp b/src/app/xml/vpattern.cpp index 310fae47d..f599ef77e 100644 --- a/src/app/xml/vpattern.cpp +++ b/src/app/xml/vpattern.cpp @@ -47,9 +47,6 @@ #include #include #include -#include - -Q_LOGGING_CATEGORY(vPatt, "v.pattern") const QString VPattern::TagPattern = QStringLiteral("pattern"); const QString VPattern::TagCalculation = QStringLiteral("calculation"); @@ -302,7 +299,7 @@ bool VPattern::ChangeNamePP(const QString& oldName, const QString &newName) */ void VPattern::Parse(const Document &parse) { - qCDebug(vPatt)<<"Parsing pattern."; + qCDebug(vXML)<<"Parsing pattern."; SCASSERT(sceneDraw != nullptr); SCASSERT(sceneDetail != nullptr); QStringList tags = QStringList() << TagDraw << TagIncrements << TagAuthor << TagDescription << TagNotes @@ -412,9 +409,14 @@ void VPattern::setCurrentData() { if (CountPP() > 1)//don't need upadate data if we have only one pattern piece { + qCDebug(vXML)<<"Setting current data"; + qCDebug(vXML)<<"Current PP name"<getData(); + qCDebug(vXML)<<"Data successfully updated."; + } + else + { + qCDebug(vXML)<<"List of tools is empty!"; } } } @@ -800,11 +812,13 @@ void VPattern::LiteParseTree(const Document &parse) // Restore name current pattern piece nameActivPP = namePP; + qCDebug(vXML)<<"Current pattern piece"<getSceneView()); VAbstractTool::NewSceneRect(sceneDetail, qApp->getSceneView()); + qCDebug(vXML)<<"Scene size updated."; } //---------------------------------------------------------------------------------------------------------------------