2727#include " modlistversiondelegate.h"
2828#include " modlistviewactions.h"
2929#include " organizercore.h"
30- #include " shared/directoryentry.h"
31- #include " shared/fileentry.h"
32- #include " shared/filesorigin.h"
3330
3431using namespace MOBase ;
3532using namespace MOShared ;
@@ -1101,7 +1098,7 @@ void ModListView::refreshMarkersAndPlugins()
11011098
11021099 setOverwriteMarkers (indexes);
11031100
1104- // highligth plugins
1101+ // highlight plugins
11051102 std::vector<unsigned int > modIndices;
11061103 for (auto & idx : indexes) {
11071104 modIndices.push_back (idx.data (ModList::IndexRole).toInt ());
@@ -1110,22 +1107,13 @@ void ModListView::refreshMarkersAndPlugins()
11101107 ui.pluginList ->verticalScrollBar ()->repaint ();
11111108}
11121109
1113- void ModListView::setHighlightedMods (const std::vector< unsigned int >& pluginIndices )
1110+ void ModListView::setHighlightedMods (const std::set<QString >& modNames )
11141111{
11151112 m_markers.highlight .clear ();
1116- auto & directoryEntry = *m_core->directoryStructure ();
1117- for (auto idx : pluginIndices) {
1118- QString pluginName = m_core->pluginList ()->getName (idx);
1119-
1120- const MOShared::FileEntryPtr fileEntry =
1121- directoryEntry.findFile (pluginName.toStdWString ());
1122- if (fileEntry.get () != nullptr ) {
1123- QString originName = QString::fromStdWString (
1124- directoryEntry.getOriginByID (fileEntry->getOrigin ()).getName ());
1125- const auto index = ModInfo::getIndex (originName);
1126- if (index != UINT_MAX) {
1127- m_markers.highlight .insert (index);
1128- }
1113+ for (const auto & modName : modNames) {
1114+ const auto index = ModInfo::getIndex (modName);
1115+ if (index != UINT_MAX) {
1116+ m_markers.highlight .insert (index);
11291117 }
11301118 }
11311119 dataChanged (model ()->index (0 , 0 ),
@@ -1136,7 +1124,7 @@ void ModListView::setHighlightedMods(const std::vector<unsigned int>& pluginIndi
11361124QColor ModListView::markerColor (const QModelIndex& index) const
11371125{
11381126 unsigned int modIndex = index.data (ModList::IndexRole).toInt ();
1139- bool highligth = m_markers.highlight .find (modIndex) != m_markers.highlight .end ();
1127+ bool highlight = m_markers.highlight .find (modIndex) != m_markers.highlight .end ();
11401128 bool overwrite = m_markers.overwrite .find (modIndex) != m_markers.overwrite .end ();
11411129 bool archiveOverwrite =
11421130 m_markers.archiveOverwrite .find (modIndex) != m_markers.archiveOverwrite .end ();
@@ -1149,8 +1137,8 @@ QColor ModListView::markerColor(const QModelIndex& index) const
11491137 bool archiveLooseOverwritten = m_markers.archiveLooseOverwritten .find (modIndex) !=
11501138 m_markers.archiveLooseOverwritten .end ();
11511139
1152- if (highligth ) {
1153- return Settings::instance ().colors ().modlistContainsPlugin ();
1140+ if (highlight ) {
1141+ return Settings::instance ().colors ().modlistContainsFile ();
11541142 } else if (overwritten || archiveLooseOverwritten) {
11551143 return Settings::instance ().colors ().modlistOverwritingLoose ();
11561144 } else if (overwrite || archiveLooseOverwrite) {
0 commit comments