Use the new wait_object_type_name() to avoid code duplication.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34589 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -45,7 +45,7 @@ public:
|
||||
|
||||
switch (columnIndex) {
|
||||
case 0:
|
||||
value.SetTo(_TypeToString(group->Type()),
|
||||
value.SetTo(wait_object_type_name(group->Type()),
|
||||
B_VARIANT_DONT_COPY_DATA);
|
||||
return true;
|
||||
case 1:
|
||||
@@ -62,29 +62,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
static const char* _TypeToString(uint32 type)
|
||||
{
|
||||
switch (type) {
|
||||
case THREAD_BLOCK_TYPE_SEMAPHORE:
|
||||
return "semaphore";
|
||||
case THREAD_BLOCK_TYPE_CONDITION_VARIABLE:
|
||||
return "condition";
|
||||
case THREAD_BLOCK_TYPE_MUTEX:
|
||||
return "mutex";
|
||||
case THREAD_BLOCK_TYPE_RW_LOCK:
|
||||
return "rw lock";
|
||||
case THREAD_BLOCK_TYPE_OTHER:
|
||||
return "other";
|
||||
case THREAD_BLOCK_TYPE_SNOOZE:
|
||||
return "snooze";
|
||||
case THREAD_BLOCK_TYPE_SIGNAL:
|
||||
return "signal";
|
||||
default:
|
||||
return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
Model* fModel;
|
||||
};
|
||||
|
||||
@@ -193,34 +193,12 @@ private:
|
||||
};
|
||||
|
||||
private:
|
||||
static const char* _TypeToString(uint32 type)
|
||||
{
|
||||
switch (type) {
|
||||
case THREAD_BLOCK_TYPE_SEMAPHORE:
|
||||
return "semaphore";
|
||||
case THREAD_BLOCK_TYPE_CONDITION_VARIABLE:
|
||||
return "condition";
|
||||
case THREAD_BLOCK_TYPE_MUTEX:
|
||||
return "mutex";
|
||||
case THREAD_BLOCK_TYPE_RW_LOCK:
|
||||
return "rw lock";
|
||||
case THREAD_BLOCK_TYPE_OTHER:
|
||||
return "other";
|
||||
case THREAD_BLOCK_TYPE_SNOOZE:
|
||||
return "snooze";
|
||||
case THREAD_BLOCK_TYPE_SIGNAL:
|
||||
return "signal";
|
||||
default:
|
||||
return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
static bool _GetWaitObjectValueAt(Model::ThreadWaitObject* waitObject,
|
||||
int32 columnIndex, BVariant& value)
|
||||
{
|
||||
switch (columnIndex) {
|
||||
case 0:
|
||||
value.SetTo(_TypeToString(waitObject->Type()),
|
||||
value.SetTo(wait_object_type_name(waitObject->Type()),
|
||||
B_VARIANT_DONT_COPY_DATA);
|
||||
return true;
|
||||
case 1:
|
||||
|
||||
Reference in New Issue
Block a user