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:
parent
27d1c689cf
commit
8c7096f7a6
40 changed files with 332 additions and 327 deletions
|
@ -1504,8 +1504,8 @@ pub mod test {
|
|||
_window: &mut Window,
|
||||
cx: &mut App,
|
||||
) -> Task<anyhow::Result<Entity<Self>>> {
|
||||
let model = cx.new(|cx| Self::new_deserialized(workspace_id, cx));
|
||||
Task::ready(Ok(model))
|
||||
let entity = cx.new(|cx| Self::new_deserialized(workspace_id, cx));
|
||||
Task::ready(Ok(entity))
|
||||
}
|
||||
|
||||
fn cleanup(
|
||||
|
|
|
@ -2540,8 +2540,10 @@ impl Pane {
|
|||
let navigate_backward = IconButton::new("navigate_backward", IconName::ArrowLeft)
|
||||
.icon_size(IconSize::Small)
|
||||
.on_click({
|
||||
let model = cx.entity().clone();
|
||||
move |_, window, cx| model.update(cx, |pane, cx| pane.navigate_backward(window, cx))
|
||||
let entity = cx.entity().clone();
|
||||
move |_, window, cx| {
|
||||
entity.update(cx, |pane, cx| pane.navigate_backward(window, cx))
|
||||
}
|
||||
})
|
||||
.disabled(!self.can_navigate_backward())
|
||||
.tooltip({
|
||||
|
@ -2554,8 +2556,8 @@ impl Pane {
|
|||
let navigate_forward = IconButton::new("navigate_forward", IconName::ArrowRight)
|
||||
.icon_size(IconSize::Small)
|
||||
.on_click({
|
||||
let model = cx.entity().clone();
|
||||
move |_, window, cx| model.update(cx, |pane, cx| pane.navigate_forward(window, cx))
|
||||
let entity = cx.entity().clone();
|
||||
move |_, window, cx| entity.update(cx, |pane, cx| pane.navigate_forward(window, cx))
|
||||
})
|
||||
.disabled(!self.can_navigate_forward())
|
||||
.tooltip({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue