Ignore diacritics as well.
So [card]jotun grunt[/card] works as well as [card]Jötun Grunt[/card]. Also I removed some debugging information I accidentally left in.
This commit is contained in:
parent
e5be082714
commit
aff32e0f56
1 changed files with 4 additions and 2 deletions
|
@ -436,6 +436,10 @@ int CardInfo::getPreferredMuId()
|
||||||
|
|
||||||
QString CardInfo::simplifyName(const QString &name) {
|
QString CardInfo::simplifyName(const QString &name) {
|
||||||
QString simpleName(name);
|
QString simpleName(name);
|
||||||
|
|
||||||
|
// Replace Jötun Grunt with Jotun Grunt.
|
||||||
|
simpleName = simpleName.normalized(QString::NormalizationForm_KD);
|
||||||
|
|
||||||
simpleName.remove(QRegExp("[^a-zA-Z0-9 ]"));
|
simpleName.remove(QRegExp("[^a-zA-Z0-9 ]"));
|
||||||
simpleName = simpleName.toLower();
|
simpleName = simpleName.toLower();
|
||||||
return simpleName;
|
return simpleName;
|
||||||
|
@ -553,8 +557,6 @@ CardInfo *CardDatabase::getCard(const QString &cardName, bool createIfNotFound)
|
||||||
|
|
||||||
CardInfo *CardDatabase::getCardBySimpleName(const QString &cardName, bool createIfNotFound) {
|
CardInfo *CardDatabase::getCardBySimpleName(const QString &cardName, bool createIfNotFound) {
|
||||||
QString simpleName = CardInfo::simplifyName(cardName);
|
QString simpleName = CardInfo::simplifyName(cardName);
|
||||||
qDebug() << "Getting card by name " << simpleName << "\n";
|
|
||||||
qDebug() << "Cards available: " << simpleNameCards.size() << "\n";
|
|
||||||
return getCardFromMap(simpleNameCards, simpleName, createIfNotFound);
|
return getCardFromMap(simpleNameCards, simpleName, createIfNotFound);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue