From e252de9e80ebb52f0c3300be4ef45b6abb22d1bf Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 24 Sep 2018 14:41:34 +0300 Subject: [PATCH] Refactoring method DialogTool::GetNodeName(). Renamed an argument. Show node details only if requested. --HG-- branch : release --- src/libs/vtools/dialogs/tools/dialogtool.cpp | 8 ++++---- src/libs/vtools/dialogs/tools/dialogtool.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libs/vtools/dialogs/tools/dialogtool.cpp b/src/libs/vtools/dialogs/tools/dialogtool.cpp index db00e6173..39e64daa1 100644 --- a/src/libs/vtools/dialogs/tools/dialogtool.cpp +++ b/src/libs/vtools/dialogs/tools/dialogtool.cpp @@ -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 obj = data->GetGObject(node.GetId()); QString name = obj->name(); @@ -634,14 +634,14 @@ QString DialogTool::GetNodeName(const VPieceNode &node, bool showPassmark) const int bias = 0; qApp->TrVars()->VariablesToUser(name, 0, obj->name(), bias); - if (node.GetReverse()) + if (showDetails && node.GetReverse()) { name = QLatin1String("- ") + name; } } else { - if (showPassmark && node.IsPassmark()) + if (showDetails && node.IsPassmark()) { 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(']'); } diff --git a/src/libs/vtools/dialogs/tools/dialogtool.h b/src/libs/vtools/dialogs/tools/dialogtool.h index 1e4bef0eb..2f22b624b 100644 --- a/src/libs/vtools/dialogs/tools/dialogtool.h +++ b/src/libs/vtools/dialogs/tools/dialogtool.h @@ -284,7 +284,7 @@ protected: static QString DialogWarningIcon(); 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 InitNodeAngles(QComboBox *box);