diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-10-14 14:12:22 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-14 14:12:22 -0400 |
commit | b02d662980a401057d2ff7c1522d47f9f6538d81 (patch) | |
tree | 2717ff56b111eb1adfcb712e14ad69f25ab76b68 /src/yuzu/compatdb.cpp | |
parent | 894b483a0d619c3ceaa79fa0ff4cef6d37301f9c (diff) | |
parent | b6894bfc5b86c2fae0b401f2cfc294a08994781d (diff) |
Merge pull request #6774 from lat9nq/remove-global-yuzu
yuzu qt: Remove global system instances
Diffstat (limited to 'src/yuzu/compatdb.cpp')
-rw-r--r-- | src/yuzu/compatdb.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/yuzu/compatdb.cpp b/src/yuzu/compatdb.cpp index a470056ef..2442bb3c3 100644 --- a/src/yuzu/compatdb.cpp +++ b/src/yuzu/compatdb.cpp @@ -8,14 +8,13 @@ #include <QtConcurrent/qtconcurrentrun.h> #include "common/logging/log.h" #include "common/telemetry.h" -#include "core/core.h" #include "core/telemetry_session.h" #include "ui_compatdb.h" #include "yuzu/compatdb.h" -CompatDB::CompatDB(QWidget* parent) +CompatDB::CompatDB(Core::TelemetrySession& telemetry_session_, QWidget* parent) : QWizard(parent, Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::WindowSystemMenuHint), - ui{std::make_unique<Ui::CompatDB>()} { + ui{std::make_unique<Ui::CompatDB>()}, telemetry_session{telemetry_session_} { ui->setupUi(this); connect(ui->radioButton_Perfect, &QRadioButton::clicked, this, &CompatDB::EnableNext); connect(ui->radioButton_Great, &QRadioButton::clicked, this, &CompatDB::EnableNext); @@ -53,16 +52,15 @@ void CompatDB::Submit() { case CompatDBPage::Final: back(); LOG_DEBUG(Frontend, "Compatibility Rating: {}", compatibility->checkedId()); - Core::System::GetInstance().TelemetrySession().AddField( - Common::Telemetry::FieldType::UserFeedback, "Compatibility", - compatibility->checkedId()); + telemetry_session.AddField(Common::Telemetry::FieldType::UserFeedback, "Compatibility", + compatibility->checkedId()); button(NextButton)->setEnabled(false); button(NextButton)->setText(tr("Submitting")); button(CancelButton)->setVisible(false); - testcase_watcher.setFuture(QtConcurrent::run( - [] { return Core::System::GetInstance().TelemetrySession().SubmitTestcase(); })); + testcase_watcher.setFuture( + QtConcurrent::run([this] { return telemetry_session.SubmitTestcase(); })); break; default: LOG_ERROR(Frontend, "Unexpected page: {}", currentId()); |