Skip to content

Commit cda4661

Browse files
committed
Application: Move api_registry field to Runtime
1 parent b964754 commit cda4661

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/app.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,6 @@ pub struct ApplicationInner {
118118
pub runtime: Runtime,
119119
pub undo_db: RefCell<undo::UndoDatabase>,
120120
pub env_args: OnceCell<Vec<String>>,
121-
#[cfg(feature = "python")]
122-
pub api_registry: RefCell<crate::api::ObjectRegistry>,
123121
}
124122

125123
#[glib::object_subclass]
@@ -505,13 +503,13 @@ impl ApplicationInner {
505503

506504
#[cfg(feature = "python")]
507505
pub fn register_obj(&self, obj: &glib::Object) -> Uuid {
508-
let mut registry = self.api_registry.borrow_mut();
506+
let mut registry = self.runtime.api_registry.borrow_mut();
509507
registry.add(obj)
510508
}
511509

512510
#[cfg(feature = "python")]
513511
pub fn get_obj(&self, id: Uuid) -> Option<glib::Object> {
514-
let registry = self.api_registry.borrow();
512+
let registry = self.runtime.api_registry.borrow();
515513
registry.get(id)
516514
}
517515
}

0 commit comments

Comments
 (0)