Compare commits
4 Commits
7286516cdc
...
cff3e08c9e
Author | SHA1 | Date |
---|---|---|
Roman Telezhynskyi | cff3e08c9e | |
Roman Telezhynskyi | 7a89aa93e9 | |
Roman Telezhynskyi | b2e1e339c0 | |
Roman Telezhynskyi | 0fd034c483 |
20
appveyor.yml
20
appveyor.yml
|
@ -43,13 +43,13 @@ environment:
|
|||
VALENTINA_VERSION: 0_7_52
|
||||
|
||||
matrix:
|
||||
# - job_name: Windows_Qt_6_5_(GCC_x64)
|
||||
# - job_name: Windows_Qt_6_7_(GCC_x64)
|
||||
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
|
||||
# COMPILER: mingw
|
||||
# COMPILER_CPPSTD: gnu17
|
||||
# COMPILER_LIBCXX: libstdc++11
|
||||
# QT: Qt\6.5\mingw_64
|
||||
# QT_VERSION: Qt6_5
|
||||
# QT: Qt\6.7\mingw_64
|
||||
# QT_VERSION: Qt6_7
|
||||
# BUILD_SYSTEM: "qbs"
|
||||
# QMAKE: qmake.exe
|
||||
# ENABLE_PCH: true
|
||||
|
@ -119,11 +119,11 @@ environment:
|
|||
MULTI_BUNDLE: false
|
||||
DEPLOY: true
|
||||
|
||||
- job_name: Windows_Qt_6_5_(MSVC_x64)
|
||||
- job_name: Windows_Qt_6_7_(MSVC_x64)
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
|
||||
COMPILER: msvc
|
||||
QT: Qt\6.5\msvc2019_64
|
||||
QT_VERSION: Qt6_5
|
||||
QT: Qt\6.7\msvc2019_64
|
||||
QT_VERSION: Qt6_7
|
||||
BUILD_SYSTEM: "qbs"
|
||||
QMAKE: qmake.exe
|
||||
ENABLE_PCH: true
|
||||
|
@ -257,9 +257,9 @@ matrix:
|
|||
fast_finish: false
|
||||
exclude:
|
||||
# - platform: x86
|
||||
# job_name: Windows_Qt_6_5_(GCC_x64)
|
||||
# job_name: Windows_Qt_6_7_(GCC_x64)
|
||||
- platform: x86
|
||||
job_name: Windows_Qt_6_5_(MSVC_x64)
|
||||
job_name: Windows_Qt_6_7_(MSVC_x64)
|
||||
- platform: x86
|
||||
job_name: Windows_Qt_5_15_(make_GCC_x64)
|
||||
- platform: x86
|
||||
|
@ -292,8 +292,8 @@ for:
|
|||
-
|
||||
matrix:
|
||||
only:
|
||||
# - job_name: Windows_Qt_6_5_(GCC_x64)
|
||||
- job_name: Windows_Qt_6_5_(MSVC_x64)
|
||||
# - job_name: Windows_Qt_6_7_(GCC_x64)
|
||||
- job_name: Windows_Qt_6_7_(MSVC_x64)
|
||||
- job_name: Windows_Qt_5_15_(qbs_GCC_x64)
|
||||
- job_name: Windows_Qt_5_15_(qbs_MSVC_x64)
|
||||
- job_name: Windows_Qt_5_15_(qbs_GCC_x86)
|
||||
|
|
|
@ -238,7 +238,10 @@ Source: "{#buildDirectory}\*.ini"; DestDir: "{app}"; Flags: ignoreversion
|
|||
|
||||
[InstallDelete]
|
||||
Type: filesandordirs; Name: "{app}\translations"
|
||||
Type: files; Name: "{autoappdata}\ValentinaTeam\*.ini"; Tasks: deletesettings
|
||||
Type: files; Name: "{autodocs}\Valentina\common.ini"; Tasks: deletesettings
|
||||
Type: files; Name: "{autodocs}\Valentina\Valentina.ini"; Tasks: deletesettings
|
||||
Type: files; Name: "{autodocs}\Valentina\Tape.ini"; Tasks: deletesettings
|
||||
Type: files; Name: "{autodocs}\Valentina\Puzzle.ini"; Tasks: deletesettings
|
||||
|
||||
[Icons]
|
||||
Name: "{group}\{#MyAppName}{#MyAppStatus}"; Filename: "{app}\valentina.exe"
|
||||
|
@ -660,14 +663,39 @@ var
|
|||
end;
|
||||
|
||||
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
|
||||
var
|
||||
CommonIniPath: string;
|
||||
ValentinaIniPath: string;
|
||||
TapeIniPath: string;
|
||||
PuzzleIniPath: string;
|
||||
begin
|
||||
if CurUninstallStep = usPostUninstall then
|
||||
begin
|
||||
if MsgBox(ExpandConstant('{cm:QuestionRemoveAnyExistingSettings}'), mbConfirmation, MB_YESNO or MB_DEFBUTTON2) = IDYES then
|
||||
//this is the msg that will display after uninstall
|
||||
CommonIniPath := ExpandConstant('{autodocs}\Valentina\common.ini');
|
||||
ValentinaIniPath := ExpandConstant('{autodocs}\Valentina\Valentina.ini');
|
||||
TapeIniPath := ExpandConstant('{autodocs}\Valentina\Tape.ini');
|
||||
PuzzleIniPath := ExpandConstant('{autodocs}\Valentina\Puzzle.ini');
|
||||
|
||||
if FileExists(CommonIniPath) or FileExists(ValentinaIniPath) or FileExists(TapeIniPath) or FileExists(PuzzleIniPath) then
|
||||
begin
|
||||
DelTree(ExpandConstant('{autoappdata}\ValentinaTeam'), True, True, True);
|
||||
if MsgBox(ExpandConstant('{cm:QuestionRemoveAnyExistingSettings}'), mbConfirmation, MB_YESNO or MB_DEFBUTTON2) = IDYES then
|
||||
begin
|
||||
if FileExists(CommonIniPath) then
|
||||
if not DeleteFile(CommonIniPath) then
|
||||
MsgBox('Failed to delete common.ini', mbError, MB_OK);
|
||||
|
||||
if FileExists(ValentinaIniPath) then
|
||||
if not DeleteFile(ValentinaIniPath) then
|
||||
MsgBox('Failed to delete Valentina.ini', mbError, MB_OK);
|
||||
|
||||
if FileExists(TapeIniPath) then
|
||||
if not DeleteFile(TapeIniPath) then
|
||||
MsgBox('Failed to delete Tape.ini', mbError, MB_OK);
|
||||
|
||||
if FileExists(PuzzleIniPath) then
|
||||
if not DeleteFile(PuzzleIniPath) then
|
||||
MsgBox('Failed to delete Puzzle.ini', mbError, MB_OK);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
|
@ -27,8 +27,6 @@
|
|||
*************************************************************************/
|
||||
#include "vppiece.h"
|
||||
|
||||
#include <QtMath>
|
||||
|
||||
#include "../vgeometry/vlayoutplacelabel.h"
|
||||
#include "../vlayout/vlayoutpiecepath.h"
|
||||
#include "../vlayout/vtextmanager.h"
|
||||
|
@ -42,6 +40,9 @@
|
|||
#include <QPainter>
|
||||
#include <QPainterPath>
|
||||
#include <QtConcurrent>
|
||||
#include <QtMath>
|
||||
#include <functional>
|
||||
#include <limits>
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
|
||||
#include "../vmisc/compatibility.h"
|
||||
|
@ -439,35 +440,36 @@ auto VPPiece::PrepareStickyPath(const QVector<QPointF> &path) -> QVector<QPointF
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
auto VPPiece::ClosestDistance(const QVector<QPointF> &path1, const QVector<QPointF> &path2) -> QLineF
|
||||
{
|
||||
return QtConcurrent::blockingMappedReduced(
|
||||
path1,
|
||||
[path2](const QPointF &p1)
|
||||
{
|
||||
qreal minLocalDistance = std::numeric_limits<qreal>::max();
|
||||
QLineF localClosestDistance;
|
||||
std::function<QLineF(const QPointF &)> const DistanceFunc = [path2](const QPointF &p1)
|
||||
{
|
||||
qreal minLocalDistance = std::numeric_limits<qreal>::max();
|
||||
QLineF localClosestDistance;
|
||||
|
||||
for (const auto &p2 : path2)
|
||||
{
|
||||
QLineF const d(p1, p2);
|
||||
qreal const length = d.length();
|
||||
if (length < minLocalDistance)
|
||||
{
|
||||
minLocalDistance = length;
|
||||
localClosestDistance = d;
|
||||
}
|
||||
}
|
||||
|
||||
return localClosestDistance;
|
||||
},
|
||||
[](QLineF &result, const QLineF &next)
|
||||
for (const auto &p2 : path2)
|
||||
{
|
||||
qreal const dist1 = result.length();
|
||||
qreal const dist2 = next.length();
|
||||
if (result.isNull() || dist2 < dist1)
|
||||
QLineF const d(p1, p2);
|
||||
qreal const length = d.length();
|
||||
if (length < minLocalDistance)
|
||||
{
|
||||
result = next;
|
||||
minLocalDistance = length;
|
||||
localClosestDistance = d;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return localClosestDistance;
|
||||
};
|
||||
|
||||
std::function<void(QLineF &, const QLineF &)> const ReduceFunc = [](QLineF &result, const QLineF &next)
|
||||
{
|
||||
qreal const dist1 = result.length();
|
||||
qreal const dist2 = next.length();
|
||||
if (result.isNull() || dist2 < dist1)
|
||||
{
|
||||
result = next;
|
||||
}
|
||||
};
|
||||
|
||||
return QtConcurrent::blockingMappedReduced<QLineF>(path1, DistanceFunc, ReduceFunc);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue