HaikuDepot: Custom List Removal

Remove use of custom list class where it is not
really required.

Relates To #15534

Change-Id: I4bdc258a64055b6e36c7be93672c52d0499e512b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2991
Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
Andrew Lindesay
2020-07-05 09:13:38 +00:00
parent 981f67b9c8
commit 66a4cd11c2
5 changed files with 23 additions and 24 deletions
+10 -10
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2017, Andrew Lindesay <[email protected]>.
* Copyright 2017-2020, Andrew Lindesay <[email protected]>.
* All rights reserved. Distributed under the terms of the MIT License.
*/
@@ -68,22 +68,22 @@ status_t
LocalIconStore::_IdentifyBestIconFileAtDirectory(const BPath& directory,
BPath& bestIconPath) const
{
StringList iconLeafnames;
iconLeafnames.Add("icon.hvif");
iconLeafnames.Add("64.png");
iconLeafnames.Add("32.png");
iconLeafnames.Add("16.png");
static const char* kIconLeafnames[] = {
"icon.hvif",
"64.png",
"32.png",
"16.png",
NULL
};
bestIconPath.Unset();
for (int32 i = 0; i < iconLeafnames.CountItems(); i++) {
BString iconLeafname = iconLeafnames.ItemAt(i);
for (int32 i = 0; kIconLeafnames[i] != NULL; i++) {
BPath workingPath(directory);
bool exists;
bool isDir;
if ( (workingPath.Append(iconLeafname) == B_OK
if ( (workingPath.Append(kIconLeafnames[i]) == B_OK
&& StorageUtils::ExistsObject(
workingPath, &exists, &isDir, NULL) == B_OK)
&& exists
@@ -1,5 +1,5 @@
/*
* Copyright 2018, Andrew Lindesay <[email protected]>.
* Copyright 2018-2020, Andrew Lindesay <[email protected]>.
* All rights reserved. Distributed under the terms of the MIT License.
*/
@@ -104,7 +104,7 @@ void
ProcessCoordinator::AddNode(ProcessNode* node)
{
AutoLocker<BLocker> locker(&fLock);
fNodes.Add(node);
fNodes.AddItem(node);
node->Process()->SetListener(this);
}
@@ -1,5 +1,5 @@
/*
* Copyright 2018, Andrew Lindesay <[email protected]>.
* Copyright 2018-2020, Andrew Lindesay <[email protected]>.
* All rights reserved. Distributed under the terms of the MIT License.
*/
@@ -9,9 +9,10 @@
#include "ProcessCoordinator.h"
#include <ObjectList.h>
#include "AbstractProcess.h"
#include "ProcessNode.h"
#include "List.h"
class ProcessCoordinator;
@@ -111,7 +112,7 @@ private:
private:
BString fName;
BLocker fLock;
List<ProcessNode*, true>
BObjectList<ProcessNode>
fNodes;
ProcessCoordinatorListener*
fListener;
+3 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2018, Andrew Lindesay <[email protected]>.
* Copyright 2018-2020, Andrew Lindesay <[email protected]>.
* All rights reserved. Distributed under the terms of the MIT License.
*/
@@ -142,7 +142,7 @@ ProcessNode::_StartProcess(void* cookie)
void
ProcessNode::AddPredecessor(ProcessNode *node)
{
fPredecessorNodes.Add(node);
fPredecessorNodes.AddItem(node);
node->_AddSuccessor(this);
}
@@ -176,7 +176,7 @@ ProcessNode::AllPredecessorsComplete() const
void
ProcessNode::_AddSuccessor(ProcessNode* node)
{
fSuccessorNodes.Add(node);
fSuccessorNodes.AddItem(node);
}
+4 -6
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2018, Andrew Lindesay <[email protected]>.
* Copyright 2018-2020, Andrew Lindesay <[email protected]>.
* All rights reserved. Distributed under the terms of the MIT License.
*/
@@ -7,11 +7,9 @@
#ifndef PROCESS_NODE_H
#define PROCESS_NODE_H
#include <ObjectList.h>
#include <OS.h>
#include "List.h"
class AbstractProcess;
@@ -48,9 +46,9 @@ private:
thread_id fWorker;
AbstractProcess* fProcess;
List<ProcessNode*, true>
BObjectList<ProcessNode>
fPredecessorNodes;
List<ProcessNode*, true>
BObjectList<ProcessNode>
fSuccessorNodes;
};