Refactoring method DialogTool::GetNodeName().

Renamed an argument. Show node details only if requested.

--HG--
branch : release
This commit is contained in:
Roman Telezhynskyi 2018-09-24 14:41:34 +03:00
parent 56e05ab953
commit e252de9e80
2 changed files with 5 additions and 5 deletions

View File

@ -624,7 +624,7 @@ QFont DialogTool::NodeFont(QFont font, bool nodeExcluded)
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString DialogTool::GetNodeName(const VPieceNode &node, bool showPassmark) const QString DialogTool::GetNodeName(const VPieceNode &node, bool showDetails) const
{ {
const QSharedPointer<VGObject> obj = data->GetGObject(node.GetId()); const QSharedPointer<VGObject> obj = data->GetGObject(node.GetId());
QString name = obj->name(); QString name = obj->name();
@ -634,14 +634,14 @@ QString DialogTool::GetNodeName(const VPieceNode &node, bool showPassmark) const
int bias = 0; int bias = 0;
qApp->TrVars()->VariablesToUser(name, 0, obj->name(), bias); qApp->TrVars()->VariablesToUser(name, 0, obj->name(), bias);
if (node.GetReverse()) if (showDetails && node.GetReverse())
{ {
name = QLatin1String("- ") + name; name = QLatin1String("- ") + name;
} }
} }
else else
{ {
if (showPassmark && node.IsPassmark()) if (showDetails && node.IsPassmark())
{ {
switch(node.GetPassmarkLineType()) switch(node.GetPassmarkLineType())
{ {
@ -665,7 +665,7 @@ QString DialogTool::GetNodeName(const VPieceNode &node, bool showPassmark) const
} }
} }
if (not node.IsCheckUniqueness()) if (showDetails && not node.IsCheckUniqueness())
{ {
name = QLatin1Char('[') + name + QLatin1Char(']'); name = QLatin1Char('[') + name + QLatin1Char(']');
} }

View File

@ -284,7 +284,7 @@ protected:
static QString DialogWarningIcon(); static QString DialogWarningIcon();
static QFont NodeFont(QFont font, bool nodeExcluded = false); static QFont NodeFont(QFont font, bool nodeExcluded = false);
QString GetNodeName(const VPieceNode &node, bool showPassmark = false) const; QString GetNodeName(const VPieceNode &node, bool showDetails = false) const;
void NewNodeItem(QListWidget *listWidget, const VPieceNode &node, bool showPassmark = true); void NewNodeItem(QListWidget *listWidget, const VPieceNode &node, bool showPassmark = true);
void InitNodeAngles(QComboBox *box); void InitNodeAngles(QComboBox *box);