Rename model based variable names to entity (#24198)

## Context
While looking through the client crate, I noticed that some of the old
functions and variables were still using gpui::model name that was
deprecated during the gpui3 transition. This PR renames those instances
of model to entity to be more inline with gpui3.

In addition, I also renamed `model` to `entity` in cases found by the
below search terms given by @someone13574

- model = cx.
- model: Entity
- model: &Entity
- OpenedModelHandle
- model.update
- model.upgrade
- model = .*\.root (regex)
- parent_model
- model = cx.new
- cx.spawn(move |model

Release Notes:

- N/A
This commit is contained in:
Anthony Eid 2025-02-04 13:24:35 -05:00 committed by GitHub
parent 27d1c689cf
commit 8c7096f7a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
40 changed files with 332 additions and 327 deletions

View file

@ -387,18 +387,18 @@ impl ImageStoreImpl for Entity<LocalImageStore> {
let LoadedBinaryFile { file, content } = load_file.await?;
let image = create_gpui_image(content)?;
let model = cx.new(|cx| ImageItem {
let entity = cx.new(|cx| ImageItem {
id: cx.entity_id().as_non_zero_u64().into(),
file: file.clone(),
image,
reload_task: None,
})?;
let image_id = cx.read_entity(&model, |model, _| model.id)?;
let image_id = cx.read_entity(&entity, |model, _| model.id)?;
this.update(&mut cx, |this, cx| {
image_store.update(cx, |image_store, cx| {
image_store.add_image(model.clone(), cx)
image_store.add_image(entity.clone(), cx)
})??;
this.local_image_ids_by_path.insert(
ProjectPath {
@ -415,7 +415,7 @@ impl ImageStoreImpl for Entity<LocalImageStore> {
anyhow::Ok(())
})??;
Ok(model)
Ok(entity)
})
}