From ff6d3c7155f31546d218ef221fa0fc81598d2407 Mon Sep 17 00:00:00 2001 From: BojanKverh Date: Sun, 21 Aug 2016 10:27:39 +0200 Subject: [PATCH] Fixed user defined materials --HG-- branch : feature --- src/app/valentina/xml/vpattern.cpp | 4 ---- src/libs/vtools/dialogs/tools/dialogdetail.cpp | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index dae100813..61b45100e 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -693,10 +693,6 @@ void VPattern::ParseDetailElement(const QDomElement &domElement, const Document { mcp.m_qsMaterialUserDef = GetParametrString(domMCP, AttrUserDefined, ""); } - else - { - mcp.m_qsMaterialUserDef.clear(); - } mcp.m_iCutNumber = GetParametrUInt(domMCP, AttrCutNumber, 0); mcp.m_ePlacement = PlacementType(GetParametrUInt(domMCP, AttrPlacement, 0)); detail.GetPatternPieceData().Append(mcp); diff --git a/src/libs/vtools/dialogs/tools/dialogdetail.cpp b/src/libs/vtools/dialogs/tools/dialogdetail.cpp index fc53e805e..8d16da5f4 100644 --- a/src/libs/vtools/dialogs/tools/dialogdetail.cpp +++ b/src/libs/vtools/dialogs/tools/dialogdetail.cpp @@ -252,15 +252,16 @@ void DialogDetail::AddUpdate() MaterialCutPlacement mcp; QStringList qslUserMaterials = qApp->Settings()->GetUserDefinedMaterials(); - mcp.m_qsMaterialUserDef = ui.comboBoxMaterial->currentText(); int i = ui.comboBoxMaterial->currentData().toInt(); if (i < m_qslMaterials.count() && mcp.m_qsMaterialUserDef == m_qslMaterials[i]) { mcp.m_eMaterial = MaterialType(i); + mcp.m_qsMaterialUserDef.clear(); } else { mcp.m_eMaterial = MaterialType::mtUserDefined; + mcp.m_qsMaterialUserDef = ui.comboBoxMaterial->currentText(); // check if we have new user defined material bool bFound = false; for (int i = 0; i < qslUserMaterials.count() && bFound == false; ++i)