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. * All rights reserved. Distributed under the terms of the MIT License.
*/ */
@@ -68,22 +68,22 @@ status_t
LocalIconStore::_IdentifyBestIconFileAtDirectory(const BPath& directory, LocalIconStore::_IdentifyBestIconFileAtDirectory(const BPath& directory,
BPath& bestIconPath) const BPath& bestIconPath) const
{ {
StringList iconLeafnames; static const char* kIconLeafnames[] = {
"icon.hvif",
iconLeafnames.Add("icon.hvif"); "64.png",
iconLeafnames.Add("64.png"); "32.png",
iconLeafnames.Add("32.png"); "16.png",
iconLeafnames.Add("16.png"); NULL
};
bestIconPath.Unset(); bestIconPath.Unset();
for (int32 i = 0; i < iconLeafnames.CountItems(); i++) { for (int32 i = 0; kIconLeafnames[i] != NULL; i++) {
BString iconLeafname = iconLeafnames.ItemAt(i);
BPath workingPath(directory); BPath workingPath(directory);
bool exists; bool exists;
bool isDir; bool isDir;
if ( (workingPath.Append(iconLeafname) == B_OK if ( (workingPath.Append(kIconLeafnames[i]) == B_OK
&& StorageUtils::ExistsObject( && StorageUtils::ExistsObject(
workingPath, &exists, &isDir, NULL) == B_OK) workingPath, &exists, &isDir, NULL) == B_OK)
&& exists && 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. * All rights reserved. Distributed under the terms of the MIT License.
*/ */
@@ -104,7 +104,7 @@ void
ProcessCoordinator::AddNode(ProcessNode* node) ProcessCoordinator::AddNode(ProcessNode* node)
{ {
AutoLocker<BLocker> locker(&fLock); AutoLocker<BLocker> locker(&fLock);
fNodes.Add(node); fNodes.AddItem(node);
node->Process()->SetListener(this); 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. * All rights reserved. Distributed under the terms of the MIT License.
*/ */
@@ -9,9 +9,10 @@
#include "ProcessCoordinator.h" #include "ProcessCoordinator.h"
#include <ObjectList.h>
#include "AbstractProcess.h" #include "AbstractProcess.h"
#include "ProcessNode.h" #include "ProcessNode.h"
#include "List.h"
class ProcessCoordinator; class ProcessCoordinator;
@@ -111,7 +112,7 @@ private:
private: private:
BString fName; BString fName;
BLocker fLock; BLocker fLock;
List<ProcessNode*, true> BObjectList<ProcessNode>
fNodes; fNodes;
ProcessCoordinatorListener* ProcessCoordinatorListener*
fListener; 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. * All rights reserved. Distributed under the terms of the MIT License.
*/ */
@@ -142,7 +142,7 @@ ProcessNode::_StartProcess(void* cookie)
void void
ProcessNode::AddPredecessor(ProcessNode *node) ProcessNode::AddPredecessor(ProcessNode *node)
{ {
fPredecessorNodes.Add(node); fPredecessorNodes.AddItem(node);
node->_AddSuccessor(this); node->_AddSuccessor(this);
} }
@@ -176,7 +176,7 @@ ProcessNode::AllPredecessorsComplete() const
void void
ProcessNode::_AddSuccessor(ProcessNode* node) 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. * All rights reserved. Distributed under the terms of the MIT License.
*/ */
@@ -7,11 +7,9 @@
#ifndef PROCESS_NODE_H #ifndef PROCESS_NODE_H
#define PROCESS_NODE_H #define PROCESS_NODE_H
#include <ObjectList.h>
#include <OS.h> #include <OS.h>
#include "List.h"
class AbstractProcess; class AbstractProcess;
@@ -48,9 +46,9 @@ private:
thread_id fWorker; thread_id fWorker;
AbstractProcess* fProcess; AbstractProcess* fProcess;
List<ProcessNode*, true> BObjectList<ProcessNode>
fPredecessorNodes; fPredecessorNodes;
List<ProcessNode*, true> BObjectList<ProcessNode>
fSuccessorNodes; fSuccessorNodes;
}; };