From 6bc160075b628e3164bf46442d133857da79668b Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 28 Dec 2018 15:55:47 +0200 Subject: [PATCH] Refactoring. Fixing warnings. --HG-- branch : develop --- src/libs/vlayout/vcontour.cpp | 5 +++-- src/libs/vlayout/vlayoutpaper.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/libs/vlayout/vcontour.cpp b/src/libs/vlayout/vcontour.cpp index f00ed01bc..42814c464 100644 --- a/src/libs/vlayout/vcontour.cpp +++ b/src/libs/vlayout/vcontour.cpp @@ -188,7 +188,7 @@ QVector VContour::UniteWithContour(const VLayoutPiece &detail, int glob } } - if (newContour.isEmpty() == false) + if (not newContour.isEmpty()) { if (newContour.last() != d->globalContour.at(i)) { @@ -208,7 +208,8 @@ QVector VContour::UniteWithContour(const VLayoutPiece &detail, int glob //--------------------------------------------------------------------------------------------------------------------- int VContour::GlobalEdgesCount() const { - if (d->globalContour.isEmpty()) + int count = 0; + if (not d->globalContour.isEmpty()) { return 10; } diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index f2537f09f..1bc2a70d0 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -166,9 +166,9 @@ void VLayoutPaper::SetRotationIncrease(int value) { d->globalRotationIncrease = value; - if ((d->globalRotationIncrease >= 1 + if (not (d->globalRotationIncrease >= 1 && d->globalRotationIncrease <= 180 - && 360 % d->globalRotationIncrease == 0) == false) + && 360 % d->globalRotationIncrease == 0)) { d->globalRotationIncrease = 180; } @@ -253,8 +253,8 @@ bool VLayoutPaper::AddToSheet(const VLayoutPiece &detail, std::atomic_bool &stop { for (int i=1; i<= detailEdgesCount; ++i) { - VPosition *thread = new VPosition(d->globalContour, j, detail, i, &stop, d->localRotate, - d->localRotationIncrease, d->saveLength, d->followGrainline); + auto *thread = new VPosition(d->globalContour, j, detail, i, &stop, d->localRotate, + d->localRotationIncrease, d->saveLength, d->followGrainline); //Info for debug #ifdef LAYOUT_DEBUG thread->setPaperIndex(d->paperIndex);