From e19597ee4e8d045d61bd6c4a85e280e500475ed6 Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Sat, 2 Dec 2017 13:36:33 -0600 Subject: Final highlighting changes --- src/mainwindow.cpp | 2 +- src/pluginlist.cpp | 4 ++-- src/pluginlist.h | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 84860767..cdc32918 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2126,7 +2126,7 @@ void MainWindow::modlistSelectionChanged(const QModelIndex ¤t, const QMode void MainWindow::modlistSelectionsChanged(const QItemSelection &selected) { - m_OrganizerCore.pluginList()->highlightPlugins(selected, *m_OrganizerCore.directoryStructure()); + m_OrganizerCore.pluginList()->highlightPlugins(selected, *m_OrganizerCore.directoryStructure(), *m_OrganizerCore.currentProfile()); ui->espList->verticalScrollBar()->repaint(); } diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index add34b3f..61d33fe9 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -108,14 +108,14 @@ QString PluginList::getColumnToolTip(int column) } } -void PluginList::highlightPlugins(const QItemSelection &selected, const MOShared::DirectoryEntry &directoryEntry) +void PluginList::highlightPlugins(const QItemSelection &selected, const MOShared::DirectoryEntry &directoryEntry, const Profile &profile) { for (auto &esp : m_ESPs) { esp.m_ModSelected = false; } for (QModelIndex idx : selected.indexes()) { ModInfo::Ptr selectedMod = ModInfo::getByIndex(idx.data(Qt::UserRole + 1).toInt()); - if (!selectedMod.isNull()) { + if (!selectedMod.isNull() && profile.modEnabled(idx.data(Qt::UserRole + 1).toInt())) { QDir dir(selectedMod->absolutePath()); QStringList plugins = dir.entryList(QStringList() << "*.esp" << "*.esm" << "*.esl"); MOShared::FilesOrigin origin = directoryEntry.getOriginByName(selectedMod->internalName().toStdWString()); diff --git a/src/pluginlist.h b/src/pluginlist.h index 19e98989..8d1a5491 100644 --- a/src/pluginlist.h +++ b/src/pluginlist.h @@ -22,6 +22,7 @@ along with Mod Organizer. If not, see . #include #include +#include "profile.h" namespace MOBase { class IPluginGame; } #include @@ -200,7 +201,7 @@ public: static QString getColumnName(int column); static QString getColumnToolTip(int column); - void highlightPlugins(const QItemSelection &selected, const MOShared::DirectoryEntry &directoryEntry); + void highlightPlugins(const QItemSelection &selected, const MOShared::DirectoryEntry &directoryEntry, const Profile &profile); void refreshLoadOrder(); -- cgit v1.3.1