diff options
| author | Seth Riley <17361645+Qudix@users.noreply.github.com> | 2020-12-01 15:55:50 -0600 |
|---|---|---|
| committer | Seth Riley <17361645+Qudix@users.noreply.github.com> | 2020-12-01 15:55:50 -0600 |
| commit | 852d8745a1ac3ef2aaa83ae21d473d20428d7d30 (patch) | |
| tree | 7ff242377cd3ec72571cd96cd631c28bbaac6470 /src/problemsdialog.cpp | |
| parent | 60688ecf5bc6e44795472cb22888ec5994a904a8 (diff) | |
| parent | 1ec3ab2b8a845f75495b4cacbeb17c86ea137a01 (diff) | |
Merge https://github.com/ModOrganizer2/modorganizer into ignore_alt
Diffstat (limited to 'src/problemsdialog.cpp')
| -rw-r--r-- | src/problemsdialog.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/problemsdialog.cpp b/src/problemsdialog.cpp index 4b944ed2..d72f8c20 100644 --- a/src/problemsdialog.cpp +++ b/src/problemsdialog.cpp @@ -7,12 +7,13 @@ #include <QPushButton>
#include <Shellapi.h>
+#include "plugincontainer.h"
using namespace MOBase;
-ProblemsDialog::ProblemsDialog(std::vector<QObject *> pluginObjects, QWidget *parent) :
- QDialog(parent), ui(new Ui::ProblemsDialog), m_PluginObjects(pluginObjects),
+ProblemsDialog::ProblemsDialog(const PluginContainer& pluginContainer, QWidget *parent) :
+ QDialog(parent), ui(new Ui::ProblemsDialog), m_PluginContainer(pluginContainer),
m_hasProblems(false)
{
ui->setupUi(this);
@@ -40,14 +41,10 @@ void ProblemsDialog::runDiagnosis() m_hasProblems = false;
ui->problemsWidget->clear();
- for(QObject *pluginObj : m_PluginObjects) {
- IPlugin *plugin = qobject_cast<IPlugin*>(pluginObj);
- if (plugin != nullptr && !plugin->isActive())
- continue;
-
- IPluginDiagnose *diagnose = qobject_cast<IPluginDiagnose*>(pluginObj);
- if (diagnose == nullptr)
+ for (IPluginDiagnose *diagnose : m_PluginContainer.plugins<IPluginDiagnose>()) {
+ if (!m_PluginContainer.isEnabled(diagnose)) {
continue;
+ }
std::vector<unsigned int> activeProblems = diagnose->activeProblems();
foreach (unsigned int key, activeProblems) {
|
