CPoiMapModel: Mark strings as translatable where applicable
This commit is contained in:
parent
a9292c1b29
commit
9a157ed58d
|
@ -13,8 +13,8 @@ CPoiMapModel::CPoiMapModel(CWorldEditor *pEditor, QObject *pParent)
|
||||||
|
|
||||||
QVariant CPoiMapModel::headerData(int Section, Qt::Orientation Orientation, int Role) const
|
QVariant CPoiMapModel::headerData(int Section, Qt::Orientation Orientation, int Role) const
|
||||||
{
|
{
|
||||||
if ( (Section == 0) && (Orientation == Qt::Horizontal) && (Role == Qt::DisplayRole) )
|
if (Section == 0 && Orientation == Qt::Horizontal && Role == Qt::DisplayRole)
|
||||||
return "PointOfInterest";
|
return tr("PointOfInterest");
|
||||||
|
|
||||||
return QVariant::Invalid;
|
return QVariant::Invalid;
|
||||||
}
|
}
|
||||||
|
@ -35,28 +35,27 @@ QVariant CPoiMapModel::data(const QModelIndex& rkIndex, int Role) const
|
||||||
{
|
{
|
||||||
if (pPOI)
|
if (pPOI)
|
||||||
return TO_QSTRING(pPOI->InstanceName());
|
return TO_QSTRING(pPOI->InstanceName());
|
||||||
else
|
|
||||||
return "[INVALID POI]";
|
return tr("[INVALID POI]");
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (Role == Qt::DecorationRole)
|
if (Role == Qt::DecorationRole)
|
||||||
{
|
{
|
||||||
CScriptNode *pNode = mpEditor->Scene()->NodeForInstance(pPOI);
|
|
||||||
bool IsImportant = false;
|
bool IsImportant = false;
|
||||||
|
|
||||||
if (pNode)
|
if (const CScriptNode* pNode = mpEditor->Scene()->NodeForInstance(pPOI))
|
||||||
{
|
{
|
||||||
// Get scan
|
// Get scan
|
||||||
CScan *pScan = static_cast<CPointOfInterestExtra*>(pNode->Extra())->GetScan();
|
const CScan *pScan = static_cast<CPointOfInterestExtra*>(pNode->Extra())->GetScan();
|
||||||
|
|
||||||
if (pScan)
|
if (pScan)
|
||||||
IsImportant = pScan->IsCriticalPropertyRef();
|
IsImportant = pScan->IsCriticalPropertyRef();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsImportant)
|
if (IsImportant)
|
||||||
return QIcon(":/icons/POI Important.svg");
|
return QIcon(QStringLiteral(":/icons/POI Important.svg"));
|
||||||
else
|
else
|
||||||
return QIcon(":/icons/POI Normal.svg");
|
return QIcon(QStringLiteral(":/icons/POI Normal.svg"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue