Corrected code to satisfy code style specifications

--HG--
branch : feature
This commit is contained in:
BojanKverh 2016-06-19 13:46:19 +02:00
parent 8140647242
commit 9386ae2ff1

View File

@ -174,16 +174,23 @@ void DialogDetail::UpdateList()
for (int i = 0; i < detail.GetPatternPieceData().GetMCPCount(); ++i) for (int i = 0; i < detail.GetPatternPieceData().GetMCPCount(); ++i)
{ {
MaterialCutPlacement mcp = detail.GetPatternPieceData().GetMCP(i); MaterialCutPlacement mcp = detail.GetPatternPieceData().GetMCP(i);
QString qsText = tr("Cut %1 of %2%3"); QString qsText = tr("Cut %1 of %2%3").arg(mcp.m_iCutNumber);
qsText = qsText.arg(mcp.m_iCutNumber);
if (mcp.m_eMaterial < MaterialType::mtUserDefined) if (mcp.m_eMaterial < MaterialType::mtUserDefined)
{
qsText = qsText.arg(m_qslMaterials[int(mcp.m_eMaterial)]); qsText = qsText.arg(m_qslMaterials[int(mcp.m_eMaterial)]);
}
else else
{
qsText = qsText.arg(mcp.m_qsMaterialUserDef); qsText = qsText.arg(mcp.m_qsMaterialUserDef);
}
if (mcp.m_ePlacement == PlacementType::ptCutOnFold) if (mcp.m_ePlacement == PlacementType::ptCutOnFold)
{
qsText = qsText.arg(tr(" on Fold")); qsText = qsText.arg(tr(" on Fold"));
}
else else
{
qsText = qsText.arg(""); qsText = qsText.arg("");
}
ui.listWidgetMCP->addItem(qsText); ui.listWidgetMCP->addItem(qsText);
} }
@ -196,8 +203,12 @@ void DialogDetail::AddUpdate()
mcp.m_qsMaterialUserDef = ui.comboBoxMaterial->currentText(); mcp.m_qsMaterialUserDef = ui.comboBoxMaterial->currentText();
mcp.m_eMaterial = MaterialType::mtUserDefined; mcp.m_eMaterial = MaterialType::mtUserDefined;
for (int i = 0; i < m_qslMaterials.count(); ++i) for (int i = 0; i < m_qslMaterials.count(); ++i)
{
if (mcp.m_qsMaterialUserDef == m_qslMaterials[i]) if (mcp.m_qsMaterialUserDef == m_qslMaterials[i])
{
mcp.m_eMaterial = MaterialType(i); mcp.m_eMaterial = MaterialType(i);
}
}
mcp.m_iCutNumber = ui.spinBoxCutNumber->value(); mcp.m_iCutNumber = ui.spinBoxCutNumber->value();
mcp.m_ePlacement = PlacementType(ui.comboBoxPlacement->currentIndex()); mcp.m_ePlacement = PlacementType(ui.comboBoxPlacement->currentIndex());
@ -675,7 +686,9 @@ void DialogDetail::SetEditMode()
int iR = ui.listWidgetMCP->currentRow(); int iR = ui.listWidgetMCP->currentRow();
// this method can be called by clicking on item or by update. In the latter case there is nothing else to do! // this method can be called by clicking on item or by update. In the latter case there is nothing else to do!
if (iR < 0 || iR >= detail.GetPatternPieceData().GetMCPCount()) if (iR < 0 || iR >= detail.GetPatternPieceData().GetMCPCount())
{
return; return;
}
ui.pushButtonAdd->setText(tr("Update")); ui.pushButtonAdd->setText(tr("Update"));
ui.pushButtonCancel->show(); ui.pushButtonCancel->show();