Improve file format conversion.

This commit is contained in:
Roman Telezhynskyi 2022-03-24 12:43:52 +02:00
parent 6960dd9d00
commit 1e88d2f8c8
8 changed files with 6 additions and 900 deletions

View File

@ -7,6 +7,7 @@
- Suspend use of qt_ntfs_permission_lookup. QTBUG-101168
- Remove support for russian language.
- Improve CLI. Better handle printer margins.
- Improve file format conversion.
# Valentina 0.7.50 February 14, 2022
- Fix regression. Minimal seam allowance width is less than the point accuracy values.

View File

@ -312,7 +312,8 @@ void VAbstractConverter::ValidateInputFile(const QString &currentSchema) const
{ // Version less than minimally supported version. Can't do anything.
throw;
}
else if (m_ver > MaxVer())
if (m_ver > MaxVer())
{ // Version bigger than maximum supported version. We still have a chance to open the file.
try
{ // Try to open like the current version.

View File

@ -283,263 +283,89 @@ void VPatternConverter::ApplyPatches()
{
case (FormatVersion(0, 1, 4)):
ToV0_2_0();
ValidateXML(XSDSchema(FormatVersion(0, 2, 0)));
Q_FALLTHROUGH();
case (FormatVersion(0, 2, 0)):
ToV0_2_1();
ValidateXML(XSDSchema(FormatVersion(0, 2, 1)));
Q_FALLTHROUGH();
case (FormatVersion(0, 2, 1)):
ToV0_2_2();
ValidateXML(XSDSchema(FormatVersion(0, 2, 2)));
Q_FALLTHROUGH();
case (FormatVersion(0, 2, 2)):
ToV0_2_3();
ValidateXML(XSDSchema(FormatVersion(0, 2, 3)));
Q_FALLTHROUGH();
case (FormatVersion(0, 2, 3)):
ToV0_2_4();
ValidateXML(XSDSchema(FormatVersion(0, 2, 4)));
Q_FALLTHROUGH();
case (FormatVersion(0, 2, 4)):
ToV0_2_5();
ValidateXML(XSDSchema(FormatVersion(0, 2, 5)));
Q_FALLTHROUGH();
case (FormatVersion(0, 2, 5)):
ToV0_2_6();
ValidateXML(XSDSchema(FormatVersion(0, 2, 6)));
Q_FALLTHROUGH();
case (FormatVersion(0, 2, 6)):
ToV0_2_7();
ValidateXML(XSDSchema(FormatVersion(0, 2, 7)));
Q_FALLTHROUGH();
case (FormatVersion(0, 2, 7)):
ToV0_3_0();
ValidateXML(XSDSchema(FormatVersion(0, 3, 0)));
Q_FALLTHROUGH();
case (FormatVersion(0, 3, 0)):
ToV0_3_1();
ValidateXML(XSDSchema(FormatVersion(0, 3, 1)));
Q_FALLTHROUGH();
case (FormatVersion(0, 3, 1)):
ToV0_3_2();
ValidateXML(XSDSchema(FormatVersion(0, 3, 2)));
Q_FALLTHROUGH();
case (FormatVersion(0, 3, 2)):
ToV0_3_3();
ValidateXML(XSDSchema(FormatVersion(0, 3, 3)));
Q_FALLTHROUGH();
case (FormatVersion(0, 3, 3)):
ToV0_3_4();
ValidateXML(XSDSchema(FormatVersion(0, 3, 4)));
Q_FALLTHROUGH();
case (FormatVersion(0, 3, 4)):
ToV0_3_5();
ValidateXML(XSDSchema(FormatVersion(0, 3, 5)));
Q_FALLTHROUGH();
case (FormatVersion(0, 3, 5)):
ToV0_3_6();
ValidateXML(XSDSchema(FormatVersion(0, 3, 6)));
Q_FALLTHROUGH();
case (FormatVersion(0, 3, 6)):
ToV0_3_7();
ValidateXML(XSDSchema(FormatVersion(0, 3, 7)));
Q_FALLTHROUGH();
case (FormatVersion(0, 3, 7)):
ToV0_3_8();
ValidateXML(XSDSchema(FormatVersion(0, 3, 8)));
Q_FALLTHROUGH();
case (FormatVersion(0, 3, 8)):
ToV0_3_9();
ValidateXML(XSDSchema(FormatVersion(0, 3, 9)));
Q_FALLTHROUGH();
case (FormatVersion(0, 3, 9)):
ToV0_4_0();
ValidateXML(XSDSchema(FormatVersion(0, 4, 0)));
Q_FALLTHROUGH();
case (FormatVersion(0, 4, 0)):
ToV0_4_1();
ValidateXML(XSDSchema(FormatVersion(0, 4, 1)));
Q_FALLTHROUGH();
case (FormatVersion(0, 4, 1)):
ToV0_4_2();
ValidateXML(XSDSchema(FormatVersion(0, 4, 2)));
Q_FALLTHROUGH();
case (FormatVersion(0, 4, 2)):
ToV0_4_3();
ValidateXML(XSDSchema(FormatVersion(0, 4, 3)));
Q_FALLTHROUGH();
case (FormatVersion(0, 4, 3)):
ToV0_4_4();
ValidateXML(XSDSchema(FormatVersion(0, 4, 4)));
Q_FALLTHROUGH();
case (FormatVersion(0, 4, 4)):
ToV0_4_5();
ValidateXML(XSDSchema(FormatVersion(0, 4, 5)));
Q_FALLTHROUGH();
case (FormatVersion(0, 4, 5)):
ToV0_4_6();
ValidateXML(XSDSchema(FormatVersion(0, 4, 6)));
Q_FALLTHROUGH();
case (FormatVersion(0, 4, 6)):
ToV0_4_7();
ValidateXML(XSDSchema(FormatVersion(0, 4, 7)));
Q_FALLTHROUGH();
case (FormatVersion(0, 4, 7)):
ToV0_4_8();
ValidateXML(XSDSchema(FormatVersion(0, 4, 8)));
Q_FALLTHROUGH();
case (FormatVersion(0, 4, 8)):
ToV0_5_0();
ValidateXML(XSDSchema(FormatVersion(0, 5, 0)));
Q_FALLTHROUGH();
case (FormatVersion(0, 5, 0)):
ToV0_5_1();
ValidateXML(XSDSchema(FormatVersion(0, 5, 1)));
Q_FALLTHROUGH();
case (FormatVersion(0, 5, 1)):
ToV0_6_0();
ValidateXML(XSDSchema(FormatVersion(0, 6, 0)));
Q_FALLTHROUGH();
case (FormatVersion(0, 6, 0)):
ToV0_6_1();
ValidateXML(XSDSchema(FormatVersion(0, 6, 1)));
Q_FALLTHROUGH();
case (FormatVersion(0, 6, 1)):
ToV0_6_2();
ValidateXML(XSDSchema(FormatVersion(0, 6, 2)));
Q_FALLTHROUGH();
case (FormatVersion(0, 6, 2)):
ToV0_6_3();
ValidateXML(XSDSchema(FormatVersion(0, 6, 3)));
Q_FALLTHROUGH();
case (FormatVersion(0, 6, 3)):
ToV0_6_4();
ValidateXML(XSDSchema(FormatVersion(0, 6, 4)));
Q_FALLTHROUGH();
case (FormatVersion(0, 6, 4)):
ToV0_6_5();
ValidateXML(XSDSchema(FormatVersion(0, 6, 5)));
Q_FALLTHROUGH();
case (FormatVersion(0, 6, 5)):
ToV0_6_6();
ValidateXML(XSDSchema(FormatVersion(0, 6, 6)));
Q_FALLTHROUGH();
case (FormatVersion(0, 6, 6)):
ToV0_7_0();
ValidateXML(XSDSchema(FormatVersion(0, 7, 0)));
Q_FALLTHROUGH();
case (FormatVersion(0, 7, 0)):
ToV0_7_1();
ValidateXML(XSDSchema(FormatVersion(0, 7, 1)));
Q_FALLTHROUGH();
case (FormatVersion(0, 7, 1)):
ToV0_7_2();
ValidateXML(XSDSchema(FormatVersion(0, 7, 2)));
Q_FALLTHROUGH();
case (FormatVersion(0, 7, 2)):
ToV0_7_3();
ValidateXML(XSDSchema(FormatVersion(0, 7, 3)));
Q_FALLTHROUGH();
case (FormatVersion(0, 7, 3)):
ToV0_7_4();
ValidateXML(XSDSchema(FormatVersion(0, 7, 4)));
Q_FALLTHROUGH();
case (FormatVersion(0, 7, 4)):
ToV0_7_5();
ValidateXML(XSDSchema(FormatVersion(0, 7, 5)));
Q_FALLTHROUGH();
case (FormatVersion(0, 7, 5)):
ToV0_7_6();
ValidateXML(XSDSchema(FormatVersion(0, 7, 6)));
Q_FALLTHROUGH();
case (FormatVersion(0, 7, 6)):
ToV0_7_7();
ValidateXML(XSDSchema(FormatVersion(0, 7, 7)));
Q_FALLTHROUGH();
case (FormatVersion(0, 7, 7)):
ToV0_7_8();
ValidateXML(XSDSchema(FormatVersion(0, 7, 8)));
Q_FALLTHROUGH();
case (FormatVersion(0, 7, 8)):
ToV0_7_9();
ValidateXML(XSDSchema(FormatVersion(0, 7, 9)));
Q_FALLTHROUGH();
case (FormatVersion(0, 7, 9)):
ToV0_7_10();
ValidateXML(XSDSchema(FormatVersion(0, 7, 10)));
Q_FALLTHROUGH();
case (FormatVersion(0, 7, 10)):
ToV0_7_11();
ValidateXML(XSDSchema(FormatVersion(0, 7, 11)));
Q_FALLTHROUGH();
case (FormatVersion(0, 7, 11)):
ToV0_7_12();
ValidateXML(XSDSchema(FormatVersion(0, 7, 12)));
Q_FALLTHROUGH();
case (FormatVersion(0, 7, 12)):
ToV0_7_13();
ValidateXML(XSDSchema(FormatVersion(0, 7, 13)));
Q_FALLTHROUGH();
case (FormatVersion(0, 7, 13)):
ToV0_8_0();
ValidateXML(XSDSchema(FormatVersion(0, 8, 0)));
Q_FALLTHROUGH();
case (FormatVersion(0, 8, 0)):
ToV0_8_1();
ValidateXML(XSDSchema(FormatVersion(0, 8, 1)));
Q_FALLTHROUGH();
case (FormatVersion(0, 8, 1)):
ToV0_8_2();
ValidateXML(XSDSchema(FormatVersion(0, 8, 2)));
Q_FALLTHROUGH();
case (FormatVersion(0, 8, 2)):
ToV0_8_3();
ValidateXML(XSDSchema(FormatVersion(0, 8, 3)));
Q_FALLTHROUGH();
case (FormatVersion(0, 8, 3)):
ToV0_8_4();
ValidateXML(XSDSchema(FormatVersion(0, 8, 4)));
Q_FALLTHROUGH();
case (FormatVersion(0, 8, 4)):
ToV0_8_5();
ValidateXML(XSDSchema(FormatVersion(0, 8, 5)));
Q_FALLTHROUGH();
case (FormatVersion(0, 8, 5)):
ToV0_8_6();
ValidateXML(XSDSchema(FormatVersion(0, 8, 6)));
Q_FALLTHROUGH();
case (FormatVersion(0, 8, 6)):
ToV0_8_7();
ValidateXML(XSDSchema(FormatVersion(0, 8, 7)));
Q_FALLTHROUGH();
case (FormatVersion(0, 8, 7)):
ToV0_8_8();
ValidateXML(XSDSchema(FormatVersion(0, 8, 8)));
Q_FALLTHROUGH();
case (FormatVersion(0, 8, 8)):
ToV0_8_9();
ValidateXML(XSDSchema(FormatVersion(0, 8, 9)));
Q_FALLTHROUGH();
case (FormatVersion(0, 8, 9)):
ToV0_8_10();
ValidateXML(XSDSchema(FormatVersion(0, 8, 10)));
Q_FALLTHROUGH();
case (FormatVersion(0, 8, 10)):
ToV0_8_11();
ValidateXML(XSDSchema(FormatVersion(0, 8, 11)));
Q_FALLTHROUGH();
case (FormatVersion(0, 8, 11)):
ToV0_8_12();
ValidateXML(XSDSchema(FormatVersion(0, 8, 12)));
Q_FALLTHROUGH();
case (FormatVersion(0, 8, 12)):
ToV0_8_13();
ValidateXML(XSDSchema(FormatVersion(0, 8, 13)));
Q_FALLTHROUGH();
case (FormatVersion(0, 8, 13)):
ToV0_9_0();
ValidateXML(XSDSchema(FormatVersion(0, 9, 0)));
ValidateXML(CurrentSchema);
Q_FALLTHROUGH();
case (FormatVersion(0, 9, 0)):
break;
@ -603,28 +429,6 @@ void VPatternConverter::ToV0_2_1()
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_2_2()
{
// TODO. Delete if minimal supported version is 0.2.2
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 2, 2),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.2.2"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_2_3()
{
// TODO. Delete if minimal supported version is 0.2.3
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 2, 3),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.2.3"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_2_4()
{
@ -637,39 +441,6 @@ void VPatternConverter::ToV0_2_4()
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_2_5()
{
// TODO. Delete if minimal supported version is 0.2.5
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 2, 5),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.2.5"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_2_6()
{
// TODO. Delete if minimal supported version is 0.2.6
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 2, 6),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.2.6"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_2_7()
{
// TODO. Delete if minimal supported version is 0.2.7
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 2, 7),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.2.7"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_3_0()
{
@ -696,94 +467,6 @@ void VPatternConverter::ToV0_3_1()
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_3_2()
{
// TODO. Delete if minimal supported version is 0.3.2
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 3, 2),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.3.2"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_3_3()
{
// TODO. Delete if minimal supported version is 0.3.3
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 3, 3),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.3.3"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_3_4()
{
// TODO. Delete if minimal supported version is 0.3.4
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 3, 4),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.3.4"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_3_5()
{
// TODO. Delete if minimal supported version is 0.3.5
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 3, 5),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.3.5"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_3_6()
{
// TODO. Delete if minimal supported version is 0.3.6
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 3, 6),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.3.6"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_3_7()
{
// TODO. Delete if minimal supported version is 0.3.7
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 3, 7),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.3.7"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_3_8()
{
// TODO. Delete if minimal supported version is 0.3.8
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 3, 8),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.3.8"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_3_9()
{
// TODO. Delete if minimal supported version is 0.3.9
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 3, 9),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.3.9"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_4_0()
{
@ -798,39 +481,6 @@ void VPatternConverter::ToV0_4_0()
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_4_1()
{
// TODO. Delete if minimal supported version is 0.4.1
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 4, 1),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.4.1"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_4_2()
{
// TODO. Delete if minimal supported version is 0.4.2
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 4, 2),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.4.2"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_4_3()
{
// TODO. Delete if minimal supported version is 0.4.3
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 4, 3),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.4.3"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_4_4()
{
@ -844,66 +494,6 @@ void VPatternConverter::ToV0_4_4()
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_4_5()
{
// TODO. Delete if minimal supported version is 0.4.5
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 4, 5),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.4.5"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_4_6()
{
// TODO. Delete if minimal supported version is 0.4.6
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 4, 6),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.4.6"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_4_7()
{
// TODO. Delete if minimal supported version is 0.4.7
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 4, 7),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.4.7"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_4_8()
{
// TODO. Delete if minimal supported version is 0.4.8
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 4, 8),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.4.8"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_5_0()
{
// TODO. Delete if minimal supported version is 0.5.0
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 5, 0),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.5.0"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_5_1()
{
// TODO. Delete if minimal supported version is 0.5.1
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 5, 1),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.5.1"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_6_0()
{
@ -918,16 +508,6 @@ void VPatternConverter::ToV0_6_0()
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_6_1()
{
// TODO. Delete if minimal supported version is 0.6.1
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 6, 1),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.6.1"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_6_2()
{
@ -939,328 +519,6 @@ void VPatternConverter::ToV0_6_2()
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_6_3()
{
// TODO. Delete if minimal supported version is 0.6.3
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 6, 3),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.6.3"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_6_4()
{
// TODO. Delete if minimal supported version is 0.6.4
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 6, 4),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.6.4"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_6_5()
{
// TODO. Delete if minimal supported version is 0.6.5
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 6, 5),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.6.5"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_6_6()
{
// TODO. Delete if minimal supported version is 0.6.6
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 6, 6),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.6.6"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_7_0()
{
// TODO. Delete if minimal supported version is 0.7.0
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 7, 0),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.7.0"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_7_1()
{
// TODO. Delete if minimal supported version is 0.7.1
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 7, 1),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.7.1"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_7_2()
{
// TODO. Delete if minimal supported version is 0.7.2
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 7, 2),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.7.2"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_7_3()
{
// TODO. Delete if minimal supported version is 0.7.3
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 7, 3),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.7.3"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_7_4()
{
// TODO. Delete if minimal supported version is 0.7.4
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 7, 4),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.7.4"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_7_5()
{
// TODO. Delete if minimal supported version is 0.7.5
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 7, 5),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.7.5"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_7_6()
{
// TODO. Delete if minimal supported version is 0.7.6
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 7, 6),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.7.6"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_7_7()
{
// TODO. Delete if minimal supported version is 0.7.7
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 7, 7),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.7.7"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_7_8()
{
// TODO. Delete if minimal supported version is 0.7.8
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 7, 8),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.7.8"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_7_9()
{
// TODO. Delete if minimal supported version is 0.7.9
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 7, 9),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.7.9"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_7_10()
{
// TODO. Delete if minimal supported version is 0.7.10
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 7, 10),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.7.10"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_7_11()
{
// TODO. Delete if minimal supported version is 0.7.11
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 7, 11),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.7.11"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_7_12()
{
// TODO. Delete if minimal supported version is 0.7.12
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 7, 12),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.7.12"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_7_13()
{
// TODO. Delete if minimal supported version is 0.7.13
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 7, 13),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.7.13"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_8_0()
{
// TODO. Delete if minimal supported version is 0.8.0
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 8, 0),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.8.0"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_8_1()
{
// TODO. Delete if minimal supported version is 0.8.1
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 8, 1),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.8.1"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_8_2()
{
// TODO. Delete if minimal supported version is 0.8.2
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 8, 2),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.8.2"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_8_3()
{
// TODO. Delete if minimal supported version is 0.8.3
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 8, 3),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.8.3"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_8_4()
{
// TODO. Delete if minimal supported version is 0.8.4
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 8, 4),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.8.4"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_8_5()
{
// TODO. Delete if minimal supported version is 0.8.5
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 8, 5),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.8.5"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_8_6()
{
// TODO. Delete if minimal supported version is 0.8.6
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 8, 6),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.8.6"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_8_7()
{
// TODO. Delete if minimal supported version is 0.8.7
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 8, 7),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.8.7"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_8_8()
{
// TODO. Delete if minimal supported version is 0.8.8
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 8, 8),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.8.8"));
RemoveGradationV0_8_8();
AddPieceUUIDV0_8_8();
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_8_9()
{
// TODO. Delete if minimal supported version is 0.8.9
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 8, 9),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.8.9"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_8_10()
{
// TODO. Delete if minimal supported version is 0.8.10
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 8, 10),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.8.10"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_8_11()
{
// TODO. Delete if minimal supported version is 0.8.11
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 8, 11),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.8.11"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_8_12()
{
// TODO. Delete if minimal supported version is 0.8.12
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 8, 12),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.8.12"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_8_13()
{
// TODO. Delete if minimal supported version is 0.8.13
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 8, 13),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.8.13"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_9_0()
{

View File

@ -76,68 +76,13 @@ private:
void ToV0_2_0();
void ToV0_2_1();
void ToV0_2_2();
void ToV0_2_3();
void ToV0_2_4();
void ToV0_2_5();
void ToV0_2_6();
void ToV0_2_7();
void ToV0_3_0();
void ToV0_3_1();
void ToV0_3_2();
void ToV0_3_3();
void ToV0_3_4();
void ToV0_3_5();
void ToV0_3_6();
void ToV0_3_7();
void ToV0_3_8();
void ToV0_3_9();
void ToV0_4_0();
void ToV0_4_1();
void ToV0_4_2();
void ToV0_4_3();
void ToV0_4_4();
void ToV0_4_5();
void ToV0_4_6();
void ToV0_4_7();
void ToV0_4_8();
void ToV0_5_0();
void ToV0_5_1();
void ToV0_6_0();
void ToV0_6_1();
void ToV0_6_2();
void ToV0_6_3();
void ToV0_6_4();
void ToV0_6_5();
void ToV0_6_6();
void ToV0_7_0();
void ToV0_7_1();
void ToV0_7_2();
void ToV0_7_3();
void ToV0_7_4();
void ToV0_7_5();
void ToV0_7_6();
void ToV0_7_7();
void ToV0_7_8();
void ToV0_7_9();
void ToV0_7_10();
void ToV0_7_11();
void ToV0_7_12();
void ToV0_7_13();
void ToV0_8_0();
void ToV0_8_1();
void ToV0_8_2();
void ToV0_8_3();
void ToV0_8_4();
void ToV0_8_5();
void ToV0_8_6();
void ToV0_8_7();
void ToV0_8_8();
void ToV0_8_9();
void ToV0_8_10();
void ToV0_8_11();
void ToV0_8_12();
void ToV0_8_13();
void ToV0_9_0();
void TagUnitToV0_2_0();

View File

@ -111,35 +111,24 @@ void VVITConverter::ApplyPatches()
{
case (FormatVersion(0, 2, 0)):
ToV0_3_0();
ValidateXML(XSDSchema(FormatVersion(0, 3, 0)));
Q_FALLTHROUGH();
case (FormatVersion(0, 3, 0)):
ToV0_3_1();
ValidateXML(XSDSchema(FormatVersion(0, 3, 1)));
Q_FALLTHROUGH();
case (FormatVersion(0, 3, 1)):
ToV0_3_2();
ValidateXML(XSDSchema(FormatVersion(0, 3, 2)));
Q_FALLTHROUGH();
case (FormatVersion(0, 3, 2)):
ToV0_3_3();
ValidateXML(XSDSchema(FormatVersion(0, 3, 3)));
Q_FALLTHROUGH();
case (FormatVersion(0, 3, 3)):
ToV0_4_0();
ValidateXML(XSDSchema(FormatVersion(0, 4, 0)));
Q_FALLTHROUGH();
case (FormatVersion(0, 4, 0)):
ToV0_5_0();
ValidateXML(XSDSchema(FormatVersion(0, 5, 0)));
Q_FALLTHROUGH();
case (FormatVersion(0, 5, 0)):
ToV0_5_1();
ValidateXML(XSDSchema(FormatVersion(0, 5, 1)));
Q_FALLTHROUGH();
case (FormatVersion(0, 5, 1)):
ToV0_5_2();
ValidateXML(XSDSchema(FormatVersion(0, 5, 2)));
ValidateXML(CurrentSchema);
Q_FALLTHROUGH();
case (FormatVersion(0, 5, 2)):
break;
@ -428,28 +417,6 @@ void VVITConverter::ToV0_4_0()
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VVITConverter::ToV0_5_0()
{
// TODO. Delete if minimal supported version is 0.5.0
Q_STATIC_ASSERT_X(VVITConverter::MeasurementMinVer < FormatVersion(0, 5, 0),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.5.0"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VVITConverter::ToV0_5_1()
{
// TODO. Delete if minimal supported version is 0.5.1
Q_STATIC_ASSERT_X(VVITConverter::MeasurementMinVer < FormatVersion(0, 5, 1),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.5.1"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VVITConverter::ToV0_5_2()
{

View File

@ -81,8 +81,6 @@ private:
void ToV0_3_2();
void ToV0_3_3();
void ToV0_4_0();
void ToV0_5_0();
void ToV0_5_1();
void ToV0_5_2();
};

View File

@ -104,39 +104,23 @@ void VVSTConverter::ApplyPatches()
{
case (FormatVersion(0, 3, 0)):
ToV0_4_0();
ValidateXML(XSDSchema(FormatVersion(0, 4, 0)));
Q_FALLTHROUGH();
case (FormatVersion(0, 4, 0)):
ToV0_4_1();
ValidateXML(XSDSchema(FormatVersion(0, 4, 1)));
Q_FALLTHROUGH();
case (FormatVersion(0, 4, 1)):
ToV0_4_2();
ValidateXML(XSDSchema(FormatVersion(0, 4, 2)));
Q_FALLTHROUGH();
case (FormatVersion(0, 4, 2)):
ToV0_4_3();
ValidateXML(XSDSchema(FormatVersion(0, 4, 3)));
Q_FALLTHROUGH();
case (FormatVersion(0, 4, 3)):
ToV0_4_4();
ValidateXML(XSDSchema(FormatVersion(0, 4, 4)));
Q_FALLTHROUGH();
case (FormatVersion(0, 4, 4)):
ToV0_5_0();
ValidateXML(XSDSchema(FormatVersion(0, 5, 0)));
Q_FALLTHROUGH();
case (FormatVersion(0, 5, 0)):
ToV0_5_1();
ValidateXML(XSDSchema(FormatVersion(0, 5, 1)));
Q_FALLTHROUGH();
case (FormatVersion(0, 5, 1)):
ToV0_5_2();
ValidateXML(XSDSchema(FormatVersion(0, 5, 2)));
Q_FALLTHROUGH();
case (FormatVersion(0, 5, 2)):
ToV0_5_3();
ValidateXML(XSDSchema(FormatVersion(0, 5, 3)));
ValidateXML(CurrentSchema);
Q_FALLTHROUGH();
case (FormatVersion(0, 5, 3)):
break;
@ -470,28 +454,6 @@ void VVSTConverter::ToV0_4_2()
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VVSTConverter::ToV0_4_3()
{
// TODO. Delete if minimal supported version is 0.4.3
Q_STATIC_ASSERT_X(VVSTConverter::MeasurementMinVer < FormatVersion(0, 4, 3),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.4.3"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VVSTConverter::ToV0_4_4()
{
// TODO. Delete if minimal supported version is 0.4.4
Q_STATIC_ASSERT_X(VVSTConverter::MeasurementMinVer < FormatVersion(0, 4, 4),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.4.4"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VVSTConverter::ToV0_5_0()
{
@ -506,28 +468,6 @@ void VVSTConverter::ToV0_5_0()
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VVSTConverter::ToV0_5_1()
{
// TODO. Delete if minimal supported version is 0.5.1
Q_STATIC_ASSERT_X(VVSTConverter::MeasurementMinVer < FormatVersion(0, 5, 1),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.5.1"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VVSTConverter::ToV0_5_2()
{
// TODO. Delete if minimal supported version is 0.5.2
Q_STATIC_ASSERT_X(VVSTConverter::MeasurementMinVer < FormatVersion(0, 5, 2),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.5.2"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VVSTConverter::ToV0_5_3()
{

View File

@ -81,11 +81,7 @@ private:
void ToV0_4_0();
void ToV0_4_1();
void ToV0_4_2();
void ToV0_4_3();
void ToV0_4_4();
void ToV0_5_0();
void ToV0_5_1();
void ToV0_5_2();
void ToV0_5_3();
};