Cleaning code.

This commit is contained in:
Roman Telezhynskyi 2020-10-31 10:14:08 +02:00
parent 25a5a564b5
commit 2f9708337d
2 changed files with 7 additions and 32 deletions

View File

@ -1815,17 +1815,6 @@ void MainWindow::LoadMultisize()
if (not mPath.isEmpty()) if (not mPath.isEmpty())
{ {
QString hText;
if (not dimensionA.isNull())
{
hText = dimensionA->currentText();
}
QString sText;
if (not dimensionB.isNull())
{
sText = dimensionB->currentText();
}
if(LoadMeasurements(mPath)) if(LoadMeasurements(mPath))
{ {
if (not doc->MPath().isEmpty()) if (not doc->MPath().isEmpty())
@ -1841,19 +1830,6 @@ void MainWindow::LoadMultisize()
doc->LiteParseTree(Document::FullLiteParse); doc->LiteParseTree(Document::FullLiteParse);
UpdateWindowTitle(); UpdateWindowTitle();
if (qApp->GetMeasurementsType() == MeasurementsType::Multisize)
{
if (not hText.isEmpty() && not dimensionA.isNull())
{
dimensionA->setCurrentText(hText);
}
if (not sText.isEmpty() && not dimensionB.isNull())
{
dimensionB->setCurrentText(sText);
}
}
} }
} }
} }
@ -1876,6 +1852,11 @@ void MainWindow::UnloadMeasurements()
m.clear(); m.clear();
qApp->SetDimensionHeight(0);
qApp->SetDimensionSize(0);
qApp->SetDimensionHip(0);
qApp->SetDimensionWaist(0);
if (oldType == MeasurementsType::Multisize) if (oldType == MeasurementsType::Multisize)
{ {
m_currentDimensionA = 0; m_currentDimensionA = 0;
@ -1889,12 +1870,6 @@ void MainWindow::UnloadMeasurements()
qApp->SetCustomerBirthDate(QDate()); qApp->SetCustomerBirthDate(QDate());
qApp->SetCustomerEmail(QString()); qApp->SetCustomerEmail(QString());
qApp->SetCustomerName(QString()); qApp->SetCustomerName(QString());
qApp->SetDimensionHeight(0);
qApp->SetDimensionSize(0);
qApp->SetDimensionHip(0);
qApp->SetDimensionWaist(0);
qApp->SetMeasurementsUnits(Unit::LAST_UNIT_DO_NOT_USE); qApp->SetMeasurementsUnits(Unit::LAST_UNIT_DO_NOT_USE);
qApp->SetDimensionSizeUnits(Unit::LAST_UNIT_DO_NOT_USE); qApp->SetDimensionSizeUnits(Unit::LAST_UNIT_DO_NOT_USE);
} }

View File

@ -280,8 +280,8 @@ enum class IMD: qint8 // Individual measurement dimension
N, // None N, // None
X, // height X, // height
Y, // size (chest half circumference) Y, // size (chest half circumference)
W, // hip half circumference W, // waist half circumference
Z // waist half circumference Z // hip half circumference
}; };
/* QImage supports a maximum of 32768x32768 px images (signed short). /* QImage supports a maximum of 32768x32768 px images (signed short).