From a7272191f43abfa4a75e8d40f38a661b1ddc42d0 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 27 Aug 2024 15:32:49 -0400 Subject: [PATCH] Fix some species name issues for encounter table --- src/project.cpp | 2 +- src/ui/encountertabledelegates.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/project.cpp b/src/project.cpp index d981fa2d..d1c3f63c 100644 --- a/src/project.cpp +++ b/src/project.cpp @@ -2611,7 +2611,7 @@ bool Project::readSpeciesIconPaths() { const QMap iconIncbins = parser.readCIncbinMulti(incfilename); // Read species constants. If this fails we can get them from the icon table (but we shouldn't rely on it). - const QStringList prefixes = {projectConfig.getIdentifier(ProjectIdentifier::define_species_prefix)}; + const QStringList prefixes = {QString("\\b%1").arg(projectConfig.getIdentifier(ProjectIdentifier::define_species_prefix))}; const QString constantsFilename = projectConfig.getFilePath(ProjectFilePath::constants_species); fileWatcher.addPath(root + "/" + constantsFilename); QStringList speciesNames = parser.readCDefineNames(constantsFilename, prefixes); diff --git a/src/ui/encountertabledelegates.cpp b/src/ui/encountertabledelegates.cpp index e2901d16..89d0ec89 100644 --- a/src/ui/encountertabledelegates.cpp +++ b/src/ui/encountertabledelegates.cpp @@ -50,7 +50,7 @@ QWidget *SpeciesComboDelegate::createEditor(QWidget *parent, const QStyleOptionV void SpeciesComboDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const { QString species = index.data(Qt::EditRole).toString(); NoScrollComboBox *combo = static_cast(editor); - combo->setCurrentIndex(combo->findText(species)); + combo->setCurrentText(species); } void SpeciesComboDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const {