kernel/thread: Include thread-related enums within the kernel namespace

Previously, these were sitting outside of the Kernel namespace, which
doesn't really make sense, given they're related to the Thread class
which is within the Kernel namespace.
This commit is contained in:
Lioncash 2018-09-13 15:57:45 -04:00 committed by fearlessTobi
parent 5dfa7b74b5
commit ca3d9d659e
6 changed files with 39 additions and 37 deletions

View file

@ -145,32 +145,32 @@ QString WaitTreeThread::GetText() const {
const auto& thread = static_cast<const Kernel::Thread&>(object);
QString status;
switch (thread.status) {
case ThreadStatus::Running:
case Kernel::ThreadStatus::Running:
status = tr("running");
break;
case ThreadStatus::Ready:
case Kernel::ThreadStatus::Ready:
status = tr("ready");
break;
case ThreadStatus::WaitArb:
case Kernel::ThreadStatus::WaitArb:
status = tr("waiting for address 0x%1").arg(thread.wait_address, 8, 16, QLatin1Char('0'));
break;
case ThreadStatus::WaitSleep:
case Kernel::ThreadStatus::WaitSleep:
status = tr("sleeping");
break;
case ThreadStatus::WaitIPC:
case Kernel::ThreadStatus::WaitIPC:
status = tr("waiting for IPC response");
break;
case ThreadStatus::WaitSynchAll:
case ThreadStatus::WaitSynchAny:
case Kernel::ThreadStatus::WaitSynchAll:
case Kernel::ThreadStatus::WaitSynchAny:
status = tr("waiting for objects");
break;
case ThreadStatus::WaitHleEvent:
case Kernel::ThreadStatus::WaitHleEvent:
status = tr("waiting for HLE return");
break;
case ThreadStatus::Dormant:
case Kernel::ThreadStatus::Dormant:
status = tr("dormant");
break;
case ThreadStatus::Dead:
case Kernel::ThreadStatus::Dead:
status = tr("dead");
break;
}
@ -183,23 +183,23 @@ QString WaitTreeThread::GetText() const {
QColor WaitTreeThread::GetColor() const {
const auto& thread = static_cast<const Kernel::Thread&>(object);
switch (thread.status) {
case ThreadStatus::Running:
case Kernel::ThreadStatus::Running:
return QColor(Qt::GlobalColor::darkGreen);
case ThreadStatus::Ready:
case Kernel::ThreadStatus::Ready:
return QColor(Qt::GlobalColor::darkBlue);
case ThreadStatus::WaitArb:
case Kernel::ThreadStatus::WaitArb:
return QColor(Qt::GlobalColor::darkRed);
case ThreadStatus::WaitSleep:
case Kernel::ThreadStatus::WaitSleep:
return QColor(Qt::GlobalColor::darkYellow);
case ThreadStatus::WaitIPC:
case Kernel::ThreadStatus::WaitIPC:
return QColor(Qt::GlobalColor::darkCyan);
case ThreadStatus::WaitSynchAll:
case ThreadStatus::WaitSynchAny:
case ThreadStatus::WaitHleEvent:
case Kernel::ThreadStatus::WaitSynchAll:
case Kernel::ThreadStatus::WaitSynchAny:
case Kernel::ThreadStatus::WaitHleEvent:
return QColor(Qt::GlobalColor::red);
case ThreadStatus::Dormant:
case Kernel::ThreadStatus::Dormant:
return QColor(Qt::GlobalColor::darkCyan);
case ThreadStatus::Dead:
case Kernel::ThreadStatus::Dead:
return QColor(Qt::GlobalColor::gray);
default:
return WaitTreeItem::GetColor();
@ -213,16 +213,16 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeThread::GetChildren() const {
QString processor;
switch (thread.processor_id) {
case ThreadProcessorId::THREADPROCESSORID_DEFAULT:
case Kernel::ThreadProcessorId::THREADPROCESSORID_DEFAULT:
processor = tr("default");
break;
case ThreadProcessorId::THREADPROCESSORID_ALL:
case Kernel::ThreadProcessorId::THREADPROCESSORID_ALL:
processor = tr("all");
break;
case ThreadProcessorId::THREADPROCESSORID_0:
case Kernel::ThreadProcessorId::THREADPROCESSORID_0:
processor = tr("AppCore");
break;
case ThreadProcessorId::THREADPROCESSORID_1:
case Kernel::ThreadProcessorId::THREADPROCESSORID_1:
processor = tr("SysCore");
break;
default:
@ -243,9 +243,9 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeThread::GetChildren() const {
} else {
list.push_back(std::make_unique<WaitTreeMutexList>(thread.held_mutexes));
}
if (thread.status == ThreadStatus::WaitSynchAny ||
thread.status == ThreadStatus::WaitSynchAll ||
thread.status == ThreadStatus::WaitHleEvent) {
if (thread.status == Kernel::ThreadStatus::WaitSynchAny ||
thread.status == Kernel::ThreadStatus::WaitSynchAll ||
thread.status == Kernel::ThreadStatus::WaitHleEvent) {
list.push_back(std::make_unique<WaitTreeObjectList>(thread.wait_objects,
thread.IsSleepingOnWaitAll()));
}