From e4d054e2dcd64cc5c785888f2110f4ffd16fdddd Mon Sep 17 00:00:00 2001 From: dismine Date: Sat, 1 Nov 2014 09:24:05 +0200 Subject: [PATCH] GarbageCollector make file broken. --HG-- branch : develop --- src/app/xml/vpattern.cpp | 24 ------------------------ src/app/xml/vpattern.h | 1 - 2 files changed, 25 deletions(-) diff --git a/src/app/xml/vpattern.cpp b/src/app/xml/vpattern.cpp index 2565a871d..d842e1ba6 100644 --- a/src/app/xml/vpattern.cpp +++ b/src/app/xml/vpattern.cpp @@ -711,7 +711,6 @@ bool VPattern::SaveDocument(const QString &fileName, QString &error) e.CriticalMessageBox(tr("Error no unique id."), qApp->getMainWindow()); return false; } - GarbageCollector(); return VDomDocument::SaveDocument(fileName, error); } @@ -2581,29 +2580,6 @@ void VPattern::UpdateMeasurements() } } -//--------------------------------------------------------------------------------------------------------------------- -void VPattern::GarbageCollector() -{ - QHashIterator t(tools); - while (t.hasNext()) - { - t.next(); - VDataTool *tool = t.value(); - if (tool->referens() <= 1) - { - QDomElement domElement = elementById(QString().setNum(t.key())); - if (domElement.isElement()) - { - QDomNode parent = domElement.parentNode(); - if (parent.isNull() == false && parent.toElement().tagName() == TagModeling) - { - parent.removeChild(domElement); - } - } - } - } -} - //--------------------------------------------------------------------------------------------------------------------- void VPattern::ToolsCommonAttributes(const QDomElement &domElement, quint32 &id) { diff --git a/src/app/xml/vpattern.h b/src/app/xml/vpattern.h index e37158ae1..24b7bdb81 100644 --- a/src/app/xml/vpattern.h +++ b/src/app/xml/vpattern.h @@ -271,7 +271,6 @@ private: void CollectId(const QDomElement &node, QVector &vector)const; void PrepareForParse(const Document &parse); void UpdateMeasurements(); - void GarbageCollector(); void ToolsCommonAttributes(const QDomElement &domElement, quint32 &id); void PointsCommonAttributes(const QDomElement &domElement, quint32 &id, QString &name, qreal &mx, qreal &my, QString &typeLine);