diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-11-26 03:50:15 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-11-26 03:50:15 -0500 |
| commit | 42fb0c6bfc0a9e2e16b7b82bd137235e2a1422a2 (patch) | |
| tree | 1f38482980218c0888a68ef644d454eab97cd84d /src | |
| parent | a99dd1d6ebf972888bb872441c23c93129466b41 (diff) | |
ignore loot reports about disabled plugins
Diffstat (limited to 'src')
| -rw-r--r-- | src/loot.cpp | 48 | ||||
| -rw-r--r-- | src/loot.h | 8 |
2 files changed, 36 insertions, 20 deletions
diff --git a/src/loot.cpp b/src/loot.cpp index 47a70596..a86cdcff 100644 --- a/src/loot.cpp +++ b/src/loot.cpp @@ -385,8 +385,8 @@ QString Loot::Message::toMarkdown() const } -Loot::Loot() - : m_thread(nullptr), m_cancel(false), m_result(false) +Loot::Loot(OrganizerCore& core) + : m_core(core), m_thread(nullptr), m_cancel(false), m_result(false) { } @@ -408,7 +408,7 @@ Loot::~Loot() } } -bool Loot::start(QWidget* parent, OrganizerCore& core, bool didUpdateMasterList) +bool Loot::start(QWidget* parent, bool didUpdateMasterList) { log::debug("starting loot"); @@ -420,10 +420,10 @@ bool Loot::start(QWidget* parent, OrganizerCore& core, bool didUpdateMasterList) } // vfs - core.prepareVFS(); + m_core.prepareVFS(); // spawning - if (!spawnLootcli(parent, core, didUpdateMasterList, std::move(stdoutHandle))) { + if (!spawnLootcli(parent, didUpdateMasterList, std::move(stdoutHandle))) { return false; } @@ -436,19 +436,29 @@ bool Loot::start(QWidget* parent, OrganizerCore& core, bool didUpdateMasterList) } bool Loot::spawnLootcli( - QWidget* parent, OrganizerCore& core, bool didUpdateMasterList, - env::HandlePtr stdoutHandle) + QWidget* parent, bool didUpdateMasterList, env::HandlePtr stdoutHandle) { - const auto logLevel = core.settings().diagnostics().lootLogLevel(); + const auto logLevel = m_core.settings().diagnostics().lootLogLevel(); QStringList parameters; parameters - << "--game" << core.managedGame()->gameShortName() - << "--gamePath" << QString("\"%1\"").arg(core.managedGame()->gameDirectory().absolutePath()) - << "--pluginListPath" << QString("\"%1/loadorder.txt\"").arg(core.profilePath()) - << "--logLevel" << QString::fromStdString(lootcli::logLevelToString(logLevel)) - << "--out" << QString("\"%1\"").arg(LootReportPath) - << "--language" << core.settings().interface().language(); + << "--game" + << m_core.managedGame()->gameShortName() + + << "--gamePath" + << QString("\"%1\"").arg(m_core.managedGame()->gameDirectory().absolutePath()) + + << "--pluginListPath" + << QString("\"%1/loadorder.txt\"").arg(m_core.profilePath()) + + << "--logLevel" + << QString::fromStdString(lootcli::logLevelToString(logLevel)) + + << "--out" + << QString("\"%1\"").arg(LootReportPath) + + << "--language" + << m_core.settings().interface().language(); if (didUpdateMasterList) { parameters << "--skipUpdateMasterlist"; @@ -696,6 +706,12 @@ Loot::Plugin Loot::reportPlugin(const QJsonObject& plugin) const return {}; } + // ignore disabled plugins; lootcli doesn't know if a plugin is enabled or not + // and will report information on any plugin that's in the filesystem + if (!m_core.pluginList()->isEnabled(p.name)) { + return {}; + } + if (plugin.contains("incompatibilities")) { p.incompatibilities = reportFiles(getOpt<QJsonArray>(plugin, "incompatibilities")); } @@ -836,10 +852,10 @@ bool runLoot(QWidget* parent, OrganizerCore& core, bool didUpdateMasterList) core.savePluginList(); try { - Loot loot; + Loot loot(core); LootDialog dialog(parent, core, loot); - if (!loot.start(parent, core, didUpdateMasterList)) { + if (!loot.start(parent, didUpdateMasterList)) { return false; } @@ -79,10 +79,10 @@ public: }; - Loot(); + Loot(OrganizerCore& core); ~Loot(); - bool start(QWidget* parent, OrganizerCore& core, bool didUpdateMasterList); + bool start(QWidget* parent, bool didUpdateMasterList); void cancel(); bool result() const; const QString& outPath() const; @@ -95,6 +95,7 @@ signals: void finished(); private: + OrganizerCore& m_core; std::unique_ptr<QThread> m_thread; std::atomic<bool> m_cancel; std::atomic<bool> m_result; @@ -104,8 +105,7 @@ private: Report m_report; bool spawnLootcli( - QWidget* parent, OrganizerCore& core, bool didUpdateMasterList, - env::HandlePtr stdoutHandle); + QWidget* parent, bool didUpdateMasterList, env::HandlePtr stdoutHandle); void lootThread(); bool waitForCompletion(); |
