From 04d8cdfe88c00dfc1f6b449a728dad6d96d82d8e Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Thu, 21 Oct 2021 12:11:07 -0700 Subject: Convert LOG_TYPE and LOG_LEVELS to enum class --- Source/Core/DolphinQt/Config/LogConfigWidget.cpp | 38 ++++++++++++------------ 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'Source/Core/DolphinQt/Config/LogConfigWidget.cpp') diff --git a/Source/Core/DolphinQt/Config/LogConfigWidget.cpp b/Source/Core/DolphinQt/Config/LogConfigWidget.cpp index 3a7df3fb66..dab59e63d9 100644 --- a/Source/Core/DolphinQt/Config/LogConfigWidget.cpp +++ b/Source/Core/DolphinQt/Config/LogConfigWidget.cpp @@ -62,9 +62,9 @@ void LogConfigWidget::CreateWidgets() m_types_list = new QListWidget; const auto* const log_manager = Common::Log::LogManager::GetInstance(); - for (int i = 0; i < Common::Log::NUMBER_OF_LOGS; i++) + for (int i = 0; i < static_cast(Common::Log::LogType::NUMBER_OF_LOGS); i++) { - const auto log_type = static_cast(i); + const auto log_type = static_cast(i); const QString full_name = QString::fromUtf8(log_manager->GetFullName(log_type)); const QString short_name = QString::fromUtf8(log_manager->GetShortName(log_type)); auto* widget = new QListWidgetItem(QStringLiteral("%1 (%2)").arg(full_name, short_name)); @@ -77,7 +77,7 @@ void LogConfigWidget::CreateWidgets() verbosity_layout->addWidget(m_verbosity_error); verbosity_layout->addWidget(m_verbosity_warning); verbosity_layout->addWidget(m_verbosity_info); - if constexpr (Common::Log::MAX_LOGLEVEL == Common::Log::LOG_LEVELS::LDEBUG) + if constexpr (Common::Log::MAX_LOGLEVEL == Common::Log::LogLevel::LDEBUG) { verbosity_layout->addWidget(m_verbosity_debug); } @@ -139,12 +139,12 @@ void LogConfigWidget::LoadSettings() setFloating(settings.value(QStringLiteral("logconfigwidget/floating")).toBool()); // Config - Verbosity - const Common::Log::LOG_LEVELS verbosity = log_manager->GetLogLevel(); - m_verbosity_notice->setChecked(verbosity == Common::Log::LOG_LEVELS::LNOTICE); - m_verbosity_error->setChecked(verbosity == Common::Log::LOG_LEVELS::LERROR); - m_verbosity_warning->setChecked(verbosity == Common::Log::LOG_LEVELS::LWARNING); - m_verbosity_info->setChecked(verbosity == Common::Log::LOG_LEVELS::LINFO); - m_verbosity_debug->setChecked(verbosity == Common::Log::LOG_LEVELS::LDEBUG); + const Common::Log::LogLevel verbosity = log_manager->GetLogLevel(); + m_verbosity_notice->setChecked(verbosity == Common::Log::LogLevel::LNOTICE); + m_verbosity_error->setChecked(verbosity == Common::Log::LogLevel::LERROR); + m_verbosity_warning->setChecked(verbosity == Common::Log::LogLevel::LWARNING); + m_verbosity_info->setChecked(verbosity == Common::Log::LogLevel::LINFO); + m_verbosity_debug->setChecked(verbosity == Common::Log::LogLevel::LDEBUG); // Config - Outputs m_out_file->setChecked(log_manager->IsListenerEnabled(Common::Log::LogListener::FILE_LISTENER)); @@ -154,9 +154,9 @@ void LogConfigWidget::LoadSettings() log_manager->IsListenerEnabled(Common::Log::LogListener::LOG_WINDOW_LISTENER)); // Config - Log Types - for (int i = 0; i < Common::Log::NUMBER_OF_LOGS; ++i) + for (int i = 0; i < static_cast(Common::Log::LogType::NUMBER_OF_LOGS); ++i) { - const auto log_type = static_cast(i); + const auto log_type = static_cast(i); const bool log_enabled = log_manager->IsEnabled(log_type); if (!log_enabled) @@ -177,22 +177,22 @@ void LogConfigWidget::SaveSettings() settings.setValue(QStringLiteral("logconfigwidget/floating"), isFloating()); // Config - Verbosity - auto verbosity = Common::Log::LOG_LEVELS::LNOTICE; + auto verbosity = Common::Log::LogLevel::LNOTICE; if (m_verbosity_notice->isChecked()) - verbosity = Common::Log::LOG_LEVELS::LNOTICE; + verbosity = Common::Log::LogLevel::LNOTICE; if (m_verbosity_error->isChecked()) - verbosity = Common::Log::LOG_LEVELS::LERROR; + verbosity = Common::Log::LogLevel::LERROR; if (m_verbosity_warning->isChecked()) - verbosity = Common::Log::LOG_LEVELS::LWARNING; + verbosity = Common::Log::LogLevel::LWARNING; if (m_verbosity_info->isChecked()) - verbosity = Common::Log::LOG_LEVELS::LINFO; + verbosity = Common::Log::LogLevel::LINFO; if (m_verbosity_debug->isChecked()) - verbosity = Common::Log::LOG_LEVELS::LDEBUG; + verbosity = Common::Log::LogLevel::LDEBUG; auto* const log_manager = Common::Log::LogManager::GetInstance(); @@ -206,9 +206,9 @@ void LogConfigWidget::SaveSettings() log_manager->EnableListener(Common::Log::LogListener::LOG_WINDOW_LISTENER, m_out_window->isChecked()); // Config - Log Types - for (int i = 0; i < Common::Log::NUMBER_OF_LOGS; ++i) + for (int i = 0; i < static_cast(Common::Log::LogType::NUMBER_OF_LOGS); ++i) { - const auto type = static_cast(i); + const auto type = static_cast(i); const bool enabled = m_types_list->item(i)->checkState() == Qt::Checked; const bool was_enabled = log_manager->IsEnabled(type); -- cgit v1.2.3