Fix Lupdate warnings.

This commit is contained in:
Roman Telezhynskyi 2023-01-12 20:12:16 +02:00
parent 0a681d7f93
commit 1669fbd3b2
19 changed files with 58 additions and 27 deletions

View File

@ -45,6 +45,7 @@ class VPSheet;
class VPPiece : public VLayoutPiece class VPPiece : public VLayoutPiece
{ {
Q_DECLARE_TR_FUNCTIONS(VPPiece) // NOLINT
public: public:
VPPiece() = default; VPPiece() = default;
explicit VPPiece(const VLayoutPiece &layoutPiece); explicit VPPiece(const VLayoutPiece &layoutPiece);

View File

@ -44,6 +44,7 @@ QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods")
class VAbstractConverter :public VDomDocument class VAbstractConverter :public VDomDocument
{ {
Q_OBJECT // NOLINT
public: public:
explicit VAbstractConverter(const QString &fileName); explicit VAbstractConverter(const QString &fileName);
virtual ~VAbstractConverter() = default; virtual ~VAbstractConverter() = default;

View File

@ -2554,7 +2554,9 @@ auto VAbstractPattern::GetGroups(const QString &patternPieceName) -> QMap<quint3
VGroupData groupData; VGroupData groupData;
const quint32 id = GetParametrUInt(group, AttrId, QChar('0')); const quint32 id = GetParametrUInt(group, AttrId, QChar('0'));
groupData.visible = GetParametrBool(group, AttrVisible, trueStr); groupData.visible = GetParametrBool(group, AttrVisible, trueStr);
groupData.name = GetParametrString(group, AttrName, tr("New group")); groupData.name =
GetParametrString(group, AttrName,
QCoreApplication::translate("VAbstractPattern", "New group"));
groupData.tags = FilterGroupTags(GetParametrEmptyString(group, AttrTags)); groupData.tags = FilterGroupTags(GetParametrEmptyString(group, AttrTags));
groupData.tool = GetParametrUInt(group, AttrTool, NULL_ID_STR); groupData.tool = GetParametrUInt(group, AttrTool, NULL_ID_STR);

View File

@ -35,6 +35,7 @@ class QString;
class VLayoutConverter : public VAbstractConverter class VLayoutConverter : public VAbstractConverter
{ {
Q_OBJECT // NOLINT
public: public:
explicit VLayoutConverter(const QString &fileName); explicit VLayoutConverter(const QString &fileName);
~VLayoutConverter() override =default; ~VLayoutConverter() override =default;

View File

@ -211,7 +211,7 @@ auto VAbstartMeasurementDimension::IsRangeValid() -> bool
if (not valid) if (not valid)
{ {
m_error = tr("Invalid min/max range"); m_error = QCoreApplication::translate("VAbstartMeasurementDimension", "Invalid min/max range");
} }
return valid; return valid;
@ -223,7 +223,7 @@ auto VAbstartMeasurementDimension::IsStepValid() -> bool
bool valid = ValidSteps().indexOf(m_step) != -1; bool valid = ValidSteps().indexOf(m_step) != -1;
if (not valid) if (not valid)
{ {
m_error = tr("Invalid step"); m_error = QCoreApplication::translate("VAbstartMeasurementDimension", "Invalid step");
} }
return valid; return valid;
@ -235,7 +235,7 @@ auto VAbstartMeasurementDimension::IsBaseValid() -> bool
bool valid = ValidBases().indexOf(m_baseValue) != -1; bool valid = ValidBases().indexOf(m_baseValue) != -1;
if (not valid) if (not valid)
{ {
m_error = tr("Base value invalid"); m_error = QCoreApplication::translate("VAbstartMeasurementDimension", "Base value invalid");
} }
return valid; return valid;
@ -253,13 +253,13 @@ auto VAbstartMeasurementDimension::DimensionName(MeasurementDimension type) -> Q
switch(type) switch(type)
{ {
case MeasurementDimension::X: case MeasurementDimension::X:
return tr("Height", "dimension"); return QCoreApplication::translate("VAbstartMeasurementDimension", "Height", "dimension");
case MeasurementDimension::Y: case MeasurementDimension::Y:
return tr("Size", "dimension"); return QCoreApplication::translate("VAbstartMeasurementDimension", "Size", "dimension");
case MeasurementDimension::W: case MeasurementDimension::W:
return tr("Waist", "dimension"); return QCoreApplication::translate("VAbstartMeasurementDimension", "Waist", "dimension");
case MeasurementDimension::Z: case MeasurementDimension::Z:
return tr("Hip", "dimension"); return QCoreApplication::translate("VAbstartMeasurementDimension", "Hip", "dimension");
default: default:
return {}; return {};
} }
@ -278,19 +278,28 @@ auto VAbstartMeasurementDimension::DimensionToolTip(const MeasurementDimension_p
case MeasurementDimension::Y: case MeasurementDimension::Y:
if (dimension->CustomName().isEmpty() && dimension->IsBodyMeasurement()) if (dimension->CustomName().isEmpty() && dimension->IsBodyMeasurement())
{ {
return fc ? tr("Chest full circumference", "dimension") : tr("Chest half circumference", "dimension"); return fc ? QCoreApplication::translate("VAbstartMeasurementDimension", "Chest full circumference",
"dimension")
: QCoreApplication::translate("VAbstartMeasurementDimension", "Chest half circumference",
"dimension");
} }
return {}; return {};
case MeasurementDimension::W: case MeasurementDimension::W:
if (dimension->CustomName().isEmpty() && dimension->IsBodyMeasurement()) if (dimension->CustomName().isEmpty() && dimension->IsBodyMeasurement())
{ {
return fc ? tr("Waist full circumference", "dimension") : tr("Waist half circumference", "dimension"); return fc ? QCoreApplication::translate("VAbstartMeasurementDimension", "Waist full circumference",
"dimension")
: QCoreApplication::translate("VAbstartMeasurementDimension", "Waist half circumference",
"dimension");
} }
return {}; return {};
case MeasurementDimension::Z: case MeasurementDimension::Z:
if (dimension->CustomName().isEmpty() && dimension->IsBodyMeasurement()) if (dimension->CustomName().isEmpty() && dimension->IsBodyMeasurement())
{ {
return fc ? tr("Hip full circumference", "dimension") : tr("Hip half circumference", "dimension"); return fc ? QCoreApplication::translate("VAbstartMeasurementDimension", "Hip full circumference",
"dimension")
: QCoreApplication::translate("VAbstartMeasurementDimension", "Hip half circumference",
"dimension");
} }
return {}; return {};
case MeasurementDimension::X: case MeasurementDimension::X:

View File

@ -1069,7 +1069,9 @@ auto VAbstractPiece::Equidistant(QVector<VSAPoint> points, qreal width, const QS
points = CorrectEquidistantPoints(points); points = CorrectEquidistantPoints(points);
if ( points.size() < 3 ) if ( points.size() < 3 )
{ {
const QString errorMsg = tr("Piece '%1'. Not enough points to build seam allowance.").arg(name); const QString errorMsg =
QCoreApplication::translate("VAbstractPiece", "Piece '%1'. Not enough points to build seam allowance.")
.arg(name);
VAbstractApplication::VApp()->IsPedantic() ? throw VException(errorMsg) : VAbstractApplication::VApp()->IsPedantic() ? throw VException(errorMsg) :
qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg; qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg;
return {}; return {};

View File

@ -291,11 +291,11 @@ QString VToolCutArc::MakeToolTip() const
->FormulaToUser(formula, VAbstractApplication::VApp()->Settings()->GetOsSeparator()); ->FormulaToUser(formula, VAbstractApplication::VApp()->Settings()->GetOsSeparator());
const qreal length = Visualization::FindValFromUser(expression, VAbstractTool::data.DataVariables()); const qreal length = Visualization::FindValFromUser(expression, VAbstractTool::data.DataVariables());
const QString arcStr = tr("Arc"); const QString arcStr = QCoreApplication::translate("VToolCutArc", "Arc");
const QString lengthStr = tr("length"); const QString lengthStr = QCoreApplication::translate("VToolCutArc", "length");
const QString startAngleStr = tr("start angle"); const QString startAngleStr = QCoreApplication::translate("VToolCutArc", "start angle");
const QString endAngleStr = tr("end angle"); const QString endAngleStr = QCoreApplication::translate("VToolCutArc", "end angle");
const QString radiusStr = tr("radius"); const QString radiusStr = QCoreApplication::translate("VToolCutArc", "radius");
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(m_id); const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(m_id);
@ -326,7 +326,9 @@ QString VToolCutArc::MakeToolTip() const
.arg(arc.GetStartAngle()) .arg(arc.GetStartAngle())
.arg(arcStr + arcNumber + QChar(QChar::Space) + endAngleStr) .arg(arcStr + arcNumber + QChar(QChar::Space) + endAngleStr)
.arg(arc.GetEndAngle()) .arg(arc.GetEndAngle())
.arg(arcStr + arcNumber + QChar(QChar::Space) + tr("label"), arc.ObjectName()); .arg(arcStr + arcNumber +
QChar(QChar::Space) + QCoreApplication::translate("VToolCutArc", "label"),
arc.ObjectName());
return toolTip; return toolTip;
}; };

View File

@ -302,8 +302,8 @@ auto VToolCutSpline::MakeToolTip() const -> QString
VSpline spline2 = VSpline(VPointF(point), spl2p2, spl2p3, spl->GetP4()); VSpline spline2 = VSpline(VPointF(point), spl2p2, spl2p3, spl->GetP4());
spline2.SetAliasSuffix(m_aliasSuffix2); spline2.SetAliasSuffix(m_aliasSuffix2);
const QString curveStr = tr("Curve"); const QString curveStr = QCoreApplication::translate("VToolCutSpline", "Curve");
const QString lengthStr = tr("length"); const QString lengthStr = QCoreApplication::translate("VToolCutSpline", "length");
const QString toolTip = QString("<table>" const QString toolTip = QString("<table>"
"<tr> <td><b>%6:</b> %7</td> </tr>" "<tr> <td><b>%6:</b> %7</td> </tr>"
@ -316,8 +316,10 @@ auto VToolCutSpline::MakeToolTip() const -> QString
.arg(UnitsToStr(VAbstractValApplication::VApp()->patternUnits(), true), .arg(UnitsToStr(VAbstractValApplication::VApp()->patternUnits(), true),
curveStr + QStringLiteral("2 ") + lengthStr) curveStr + QStringLiteral("2 ") + lengthStr)
.arg(VAbstractValApplication::VApp()->fromPixel(spline2.GetLength())) .arg(VAbstractValApplication::VApp()->fromPixel(spline2.GetLength()))
.arg(curveStr + QStringLiteral(" 1") + tr("label"), spline1.ObjectName(), .arg(curveStr + QStringLiteral(" 1") + QCoreApplication::translate("VToolCutSpline", "label"),
curveStr + QStringLiteral(" 2") + tr("label"), spline2.ObjectName()); spline1.ObjectName(),
curveStr + QStringLiteral(" 2") + QCoreApplication::translate("VToolCutSpline", "label"),
spline2.ObjectName());
return toolTip; return toolTip;
} }

View File

@ -393,8 +393,8 @@ QString VToolCutSplinePath::MakeToolTip() const
splPath1->SetAliasSuffix(m_aliasSuffix1); splPath1->SetAliasSuffix(m_aliasSuffix1);
splPath2->SetAliasSuffix(m_aliasSuffix2); splPath2->SetAliasSuffix(m_aliasSuffix2);
const QString curveStr = tr("Curve"); const QString curveStr = QCoreApplication::translate("VToolCutSplinePath", "Curve");
const QString lengthStr = tr("length"); const QString lengthStr = QCoreApplication::translate("VToolCutSplinePath", "length");
const QString toolTip = QString("<table>" const QString toolTip = QString("<table>"
"<tr> <td><b>%6:</b> %7</td> </tr>" "<tr> <td><b>%6:</b> %7</td> </tr>"
@ -407,8 +407,10 @@ QString VToolCutSplinePath::MakeToolTip() const
.arg(UnitsToStr(VAbstractValApplication::VApp()->patternUnits(), true), .arg(UnitsToStr(VAbstractValApplication::VApp()->patternUnits(), true),
curveStr + QLatin1String("2 ") + lengthStr) curveStr + QLatin1String("2 ") + lengthStr)
.arg(VAbstractValApplication::VApp()->fromPixel(splPath2->GetLength())) .arg(VAbstractValApplication::VApp()->fromPixel(splPath2->GetLength()))
.arg(curveStr + QLatin1String(" 1") + tr("label"), splPath1->ObjectName(), .arg(curveStr + QLatin1String(" 1") + QCoreApplication::translate("VToolCutSplinePath", "label"),
curveStr + QLatin1String(" 2") + tr("label"), splPath2->ObjectName()); splPath1->ObjectName(),
curveStr + QLatin1String(" 2") + QCoreApplication::translate("VToolCutSplinePath", "label"),
splPath2->ObjectName());
delete splPath1; delete splPath1;
delete splPath2; delete splPath2;

View File

@ -37,6 +37,7 @@
class HideAllBackgroundImages : public VUndoCommand class HideAllBackgroundImages : public VUndoCommand
{ {
Q_OBJECT // NOLINT
public: public:
HideAllBackgroundImages(bool hide, VAbstractPattern *doc, QUndoCommand *parent = nullptr); HideAllBackgroundImages(bool hide, VAbstractPattern *doc, QUndoCommand *parent = nullptr);
~HideAllBackgroundImages() override =default; ~HideAllBackgroundImages() override =default;

View File

@ -37,6 +37,7 @@
class HideBackgroundImage : public VUndoCommand class HideBackgroundImage : public VUndoCommand
{ {
Q_OBJECT // NOLINT
public: public:
HideBackgroundImage(QUuid id, bool hide, VAbstractPattern *doc, QUndoCommand *parent = nullptr); HideBackgroundImage(QUuid id, bool hide, VAbstractPattern *doc, QUndoCommand *parent = nullptr);
~HideBackgroundImage() override =default; ~HideBackgroundImage() override =default;

View File

@ -36,6 +36,7 @@
class HoldAllBackgroundImages : public VUndoCommand class HoldAllBackgroundImages : public VUndoCommand
{ {
Q_OBJECT // NOLINT
public: public:
HoldAllBackgroundImages(bool hold, VAbstractPattern *doc, QUndoCommand *parent = nullptr); HoldAllBackgroundImages(bool hold, VAbstractPattern *doc, QUndoCommand *parent = nullptr);
~HoldAllBackgroundImages() override =default; ~HoldAllBackgroundImages() override =default;

View File

@ -37,6 +37,7 @@
class HoldBackgroundImage : public VUndoCommand class HoldBackgroundImage : public VUndoCommand
{ {
Q_OBJECT // NOLINT
public: public:
HoldBackgroundImage(QUuid id, bool hold, VAbstractPattern *doc, QUndoCommand *parent = nullptr); HoldBackgroundImage(QUuid id, bool hold, VAbstractPattern *doc, QUndoCommand *parent = nullptr);
~HoldBackgroundImage() override =default; ~HoldBackgroundImage() override =default;

View File

@ -36,6 +36,7 @@
class OpaqueBackgroundImage : public VUndoCommand class OpaqueBackgroundImage : public VUndoCommand
{ {
Q_OBJECT // NOLINT
public: public:
OpaqueBackgroundImage(QUuid id, qreal opacity, VAbstractPattern *doc, QUndoCommand *parent = nullptr); OpaqueBackgroundImage(QUuid id, qreal opacity, VAbstractPattern *doc, QUndoCommand *parent = nullptr);
~OpaqueBackgroundImage() override =default; ~OpaqueBackgroundImage() override =default;

View File

@ -37,6 +37,7 @@
class RenameBackgroundImage : public VUndoCommand class RenameBackgroundImage : public VUndoCommand
{ {
Q_OBJECT // NOLINT
public: public:
RenameBackgroundImage(QUuid id, const QString &name, VAbstractPattern *doc, QUndoCommand *parent = nullptr); RenameBackgroundImage(QUuid id, const QString &name, VAbstractPattern *doc, QUndoCommand *parent = nullptr);
~RenameBackgroundImage() override =default; ~RenameBackgroundImage() override =default;

View File

@ -39,6 +39,7 @@
class ResetBackgroundImage : public VUndoCommand class ResetBackgroundImage : public VUndoCommand
{ {
Q_OBJECT // NOLINT
public: public:
ResetBackgroundImage(QUuid id, VAbstractPattern *doc, QUndoCommand *parent = nullptr); ResetBackgroundImage(QUuid id, VAbstractPattern *doc, QUndoCommand *parent = nullptr);
~ResetBackgroundImage() override = default; ~ResetBackgroundImage() override = default;

View File

@ -40,6 +40,7 @@
class RotateBackgroundImage : public VUndoCommand class RotateBackgroundImage : public VUndoCommand
{ {
Q_OBJECT // NOLINT
public: public:
RotateBackgroundImage(QUuid id, const QTransform &matrix, VAbstractPattern *doc, bool allowMerge = false, RotateBackgroundImage(QUuid id, const QTransform &matrix, VAbstractPattern *doc, bool allowMerge = false,
QUndoCommand *parent = nullptr); QUndoCommand *parent = nullptr);

View File

@ -44,6 +44,7 @@ enum class ZValueMoveType
class ZValueMoveBackgroundImage : public VUndoCommand class ZValueMoveBackgroundImage : public VUndoCommand
{ {
Q_OBJECT // NOLINT
public: public:
ZValueMoveBackgroundImage(QUuid id, ZValueMoveType move, VAbstractPattern *doc, QUndoCommand *parent = nullptr); ZValueMoveBackgroundImage(QUuid id, ZValueMoveType move, VAbstractPattern *doc, QUndoCommand *parent = nullptr);
~ZValueMoveBackgroundImage() override =default; ~ZValueMoveBackgroundImage() override =default;

View File

@ -682,7 +682,7 @@ auto ColorPickerPopup::CustomItems() const ->QVector<ColorPickerItem *>
for (auto *item : items) for (auto *item : items)
{ {
if (item!= nullptr && item->text() == tr("Custom")) if (item!= nullptr && item->text() == QCoreApplication::translate("ColorPickerPopup", "Custom"))
{ {
customItems.append(item); customItems.append(item);
} }