1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 14:27:35 +00:00

Everywhere: Stop using NonnullRefPtrVector

This class had slightly confusing semantics and the added weirdness
doesn't seem worth it just so we can say "." instead of "->" when
iterating over a vector of NNRPs.

This patch replaces NonnullRefPtrVector<T> with Vector<NNRP<T>>.
This commit is contained in:
Andreas Kling 2023-03-06 14:17:01 +01:00
parent 104be6c8ac
commit 8a48246ed1
168 changed files with 1280 additions and 1280 deletions

View file

@ -17,7 +17,7 @@ void AccountHolder::add_account_with_name_and_mailboxes(DeprecatedString name, V
auto account = AccountNode::create(move(name));
// This holds all of the ancestors of the current leaf folder.
NonnullRefPtrVector<MailboxNode> folder_stack;
Vector<NonnullRefPtr<MailboxNode>> folder_stack;
for (auto& mailbox : mailboxes) {
// mailbox.name is converted to StringView to get access to split by string.
@ -44,7 +44,7 @@ void AccountHolder::add_account_with_name_and_mailboxes(DeprecatedString name, V
// Only keep the ancestors of the current leaf folder.
folder_stack.shrink(subfolders.size() - 1);
parent_folder.add_child(mailbox_node);
parent_folder->add_child(mailbox_node);
VERIFY(!mailbox_node->has_parent());
mailbox_node->set_parent(parent_folder);
@ -54,7 +54,7 @@ void AccountHolder::add_account_with_name_and_mailboxes(DeprecatedString name, V
} else {
// FIXME: This assumes that the server has the "CHILDREN" capability.
if (mailbox.flags & (unsigned)IMAP::MailboxFlag::HasChildren) {
if (!folder_stack.is_empty() && folder_stack.first().select_name() != mailbox.name) {
if (!folder_stack.is_empty() && folder_stack.first()->select_name() != mailbox.name) {
// This is a new root folder, clear the stack as there are no ancestors of the current leaf folder at this point.
folder_stack.clear();
}