From b7caafb0c40f2fe40a8936e141cc3a5bb7e9e8ad Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sun, 22 Nov 2015 17:49:36 +0200 Subject: [PATCH] Fixed test failure. --HG-- branch : develop --- src/app/valentina/core/vcmdexport.cpp | 13 +++++++------ src/app/valentina/dialogs/dialoglayoutsettings.cpp | 3 ++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/app/valentina/core/vcmdexport.cpp b/src/app/valentina/core/vcmdexport.cpp index b7ad4c66b..9e6c7bb66 100644 --- a/src/app/valentina/core/vcmdexport.cpp +++ b/src/app/valentina/core/vcmdexport.cpp @@ -32,6 +32,7 @@ #include "xml/vdomdocument.h" #include "../vformat/vmeasurements.h" #include "../vmisc/commandoptions.h" +#include "../vmisc/vsettings.h" VCommandLinePtr VCommandLine::instance = nullptr; @@ -352,12 +353,12 @@ VLayoutGeneratorPtr VCommandLine::DefaultGenerator() const } } - int rotateDegree = OptRotation(); - diag.SetRotate(rotateDegree != 0 ); + const int rotateDegree = OptRotation(); + diag.SetRotate(rotateDegree != 0 ); // 0 disable rotation - if (rotateDegree != 0) + if (rotateDegree != VSettings::GetDefLayoutRotationIncrease())//Value by default { - if (!diag.SetIncrease(rotateDegree)) + if (not diag.SetIncrease(rotateDegree)) { qCritical() << translate("VCommandLine", "Invalid rotation value. That must be one of predefined values.") << "\n"; @@ -523,7 +524,7 @@ DialogLayoutSettings::PaperSizeTemplate VCommandLine::OptPaperSize() const //------------------------------------------------------------------------------------------------------ int VCommandLine::OptRotation() const { - int rotate = 180; + int rotate = VSettings::GetDefLayoutRotationIncrease(); if (parser.isSet(*optionsUsed.value(optionsIndex.value(LONG_OPTION_ROTATE)))) { bool ok = false; @@ -531,7 +532,7 @@ int VCommandLine::OptRotation() const if (not ok) { - rotate = 180; + rotate = VSettings::GetDefLayoutRotationIncrease(); } } diff --git a/src/app/valentina/dialogs/dialoglayoutsettings.cpp b/src/app/valentina/dialogs/dialoglayoutsettings.cpp index eff2010bb..7b770d722 100644 --- a/src/app/valentina/dialogs/dialoglayoutsettings.cpp +++ b/src/app/valentina/dialogs/dialoglayoutsettings.cpp @@ -258,7 +258,8 @@ bool DialogLayoutSettings::SetIncrease(int increase) bool failed = (index == -1); if (failed) { - index = 21;//180 degree + const QString def = QString::number(VSettings::GetDefLayoutRotationIncrease());// Value by default + index = ui->comboBoxIncrease->findText(def); } ui->comboBoxIncrease->setCurrentIndex(index);