Wrong conversion for the tag unit.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2015-08-27 14:00:20 +03:00
parent a69223299c
commit e3d13cd3b5
3 changed files with 21 additions and 4 deletions

View File

@ -1948,7 +1948,10 @@ void MainWindow::Clear()
qCDebug(vMainWindow, "Returned to Draw mode."); qCDebug(vMainWindow, "Returned to Draw mode.");
pattern->Clear(); pattern->Clear();
qCDebug(vMainWindow, "Clearing pattern."); qCDebug(vMainWindow, "Clearing pattern.");
if (not curFile.isEmpty())
{
watcher->removePath(AbsoluteMPath(curFile, doc->MPath())); watcher->removePath(AbsoluteMPath(curFile, doc->MPath()));
}
doc->clear(); doc->clear();
setCurrentFile(QString()); setCurrentFile(QString());
qCDebug(vMainWindow, "Clearing scenes."); qCDebug(vMainWindow, "Clearing scenes.");

View File

@ -222,7 +222,7 @@ void VPatternConverter::TagUnitToV0_2_0()
unit.appendChild(newNodeText); unit.appendChild(newNodeText);
QDomElement patternElement = documentElement(); QDomElement patternElement = documentElement();
patternElement.insertAfter(unit, patternElement.firstChild()); patternElement.insertAfter(unit, patternElement.firstChildElement("version"));
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -239,8 +239,8 @@ void VPatternConverter::TagIncrementToV0_2_0()
QSet<QString> VPatternConverter::FixIncrementsToV0_2_0() QSet<QString> VPatternConverter::FixIncrementsToV0_2_0()
{ {
QSet<QString> names; QSet<QString> names;
const QDomElement ms = TagMeasurementsV0_1_4(); const QDomElement incr = TagIncrementsV0_1_4();
QDomNode domNode = ms.firstChild(); QDomNode domNode = incr.firstChild();
while (domNode.isNull() == false) while (domNode.isNull() == false)
{ {
if (domNode.isElement()) if (domNode.isElement())
@ -502,6 +502,19 @@ QDomElement VPatternConverter::TagMeasurementsV0_1_4() const
return element; return element;
} }
//---------------------------------------------------------------------------------------------------------------------
QDomElement VPatternConverter::TagIncrementsV0_1_4() const
{
const QDomNodeList list = elementsByTagName("increments");
const QDomElement element = list.at(0).toElement();
if (not element.isElement())
{
VException excep("Can't get tag measurements.");
throw excep;
}
return element;
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QStringList VPatternConverter::ListPathPointExpressionsV0_1_4() const QStringList VPatternConverter::ListPathPointExpressionsV0_1_4() const
{ {

View File

@ -73,6 +73,7 @@ private:
QString MUnitV0_1_4() const; QString MUnitV0_1_4() const;
QDomElement TagMeasurementsV0_1_4() const; QDomElement TagMeasurementsV0_1_4() const;
QDomElement TagIncrementsV0_1_4() const;
QStringList ListPathPointExpressionsV0_1_4() const; QStringList ListPathPointExpressionsV0_1_4() const;
}; };