From 2f9708337d8a6a2dd0be808ad3b8ffc00a47de6a Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 31 Oct 2020 10:14:08 +0200 Subject: [PATCH] Cleaning code. --- src/app/valentina/mainwindow.cpp | 35 +++++--------------------------- src/libs/vmisc/def.h | 4 ++-- 2 files changed, 7 insertions(+), 32 deletions(-) diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 8e4dc705c..776a6574e 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -1815,17 +1815,6 @@ void MainWindow::LoadMultisize() 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 (not doc->MPath().isEmpty()) @@ -1841,19 +1830,6 @@ void MainWindow::LoadMultisize() doc->LiteParseTree(Document::FullLiteParse); 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(); + qApp->SetDimensionHeight(0); + qApp->SetDimensionSize(0); + qApp->SetDimensionHip(0); + qApp->SetDimensionWaist(0); + if (oldType == MeasurementsType::Multisize) { m_currentDimensionA = 0; @@ -1889,12 +1870,6 @@ void MainWindow::UnloadMeasurements() qApp->SetCustomerBirthDate(QDate()); qApp->SetCustomerEmail(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->SetDimensionSizeUnits(Unit::LAST_UNIT_DO_NOT_USE); } diff --git a/src/libs/vmisc/def.h b/src/libs/vmisc/def.h index 10ee1dfe1..9b4e76ae5 100644 --- a/src/libs/vmisc/def.h +++ b/src/libs/vmisc/def.h @@ -280,8 +280,8 @@ enum class IMD: qint8 // Individual measurement dimension N, // None X, // height Y, // size (chest half circumference) - W, // hip half circumference - Z // waist half circumference + W, // waist half circumference + Z // hip half circumference }; /* QImage supports a maximum of 32768x32768 px images (signed short).