Gui: [skip ci] Fix coverity warning
Coverity warnings fixed: CID 305123 (#1 of 1): Logically dead code (DEADCODE) dead_error_line: Execution cannot reach the expression this->linked inside this statement: if (role == Qt::TextColorRole && linked)
This commit is contained in:
@@ -549,11 +549,13 @@ QVariant PropertyItem::data(int column, int role) const
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
if (role == Qt::DisplayRole)
|
||||
if (role == Qt::DisplayRole) {
|
||||
return displayName();
|
||||
}
|
||||
// no properties set
|
||||
if (propertyItems.empty())
|
||||
if (propertyItems.empty()) {
|
||||
return QVariant();
|
||||
}
|
||||
else if (role == Qt::ToolTipRole) {
|
||||
if(!PropertyView::showAll())
|
||||
return toolTip(propertyItems[0]);
|
||||
@@ -563,17 +565,17 @@ QVariant PropertyItem::data(int column, int role) const
|
||||
if(doc.size())
|
||||
return type + QLatin1String("\n\n") + doc;
|
||||
return type;
|
||||
} else if (role == Qt::TextColorRole && linked)
|
||||
return QVariant::fromValue(QColor(0,0x80,0));
|
||||
else
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
}
|
||||
else {
|
||||
// no properties set
|
||||
if (propertyItems.empty()) {
|
||||
PropertyItem* parent = this->parent();
|
||||
if (!parent || !parent->parent())
|
||||
if (!parent || !parent->parent()) {
|
||||
return QVariant();
|
||||
}
|
||||
if (role == Qt::EditRole) {
|
||||
return parent->property(qPrintable(objectName()));
|
||||
}
|
||||
@@ -585,26 +587,32 @@ QVariant PropertyItem::data(int column, int role) const
|
||||
QVariant val = parent->property(qPrintable(objectName()));
|
||||
return toString(val);
|
||||
}
|
||||
else if( role == Qt::TextColorRole) {
|
||||
if(hasExpression())
|
||||
else if (role == Qt::TextColorRole) {
|
||||
if (hasExpression())
|
||||
return QVariant::fromValue(QApplication::palette().color(QPalette::Link));
|
||||
return QVariant();
|
||||
} else
|
||||
return QVariant();
|
||||
}
|
||||
if (role == Qt::EditRole)
|
||||
|
||||
return QVariant();
|
||||
}
|
||||
if (role == Qt::EditRole) {
|
||||
return value(propertyItems[0]);
|
||||
else if (role == Qt::DecorationRole)
|
||||
}
|
||||
else if (role == Qt::DecorationRole) {
|
||||
return decoration(value(propertyItems[0]));
|
||||
else if (role == Qt::DisplayRole)
|
||||
}
|
||||
else if (role == Qt::DisplayRole) {
|
||||
return toString(value(propertyItems[0]));
|
||||
else if (role == Qt::ToolTipRole)
|
||||
}
|
||||
else if (role == Qt::ToolTipRole) {
|
||||
return toolTip(propertyItems[0]);
|
||||
}
|
||||
else if( role == Qt::TextColorRole) {
|
||||
if(hasExpression())
|
||||
if (hasExpression())
|
||||
return QVariant::fromValue(QApplication::palette().color(QPalette::Link));
|
||||
return QVariant();
|
||||
} else
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user