Commit aff32e0f authored by Waleed Khan's avatar Waleed Khan
Browse files

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.
parent e5be0827
......@@ -436,6 +436,10 @@ int CardInfo::getPreferredMuId()
QString CardInfo::simplifyName(const QString &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 = simpleName.toLower();
return simpleName;
......@@ -553,8 +557,6 @@ CardInfo *CardDatabase::getCard(const QString &cardName, bool createIfNotFound)
CardInfo *CardDatabase::getCardBySimpleName(const QString &cardName, bool createIfNotFound) {
QString simpleName = CardInfo::simplifyName(cardName);
qDebug() << "Getting card by name " << simpleName << "\n";
qDebug() << "Cards available: " << simpleNameCards.size() << "\n";
return getCardFromMap(simpleNameCards, simpleName, createIfNotFound);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment