diff --git a/README.md b/README.md index 4c88363f..37d9d873 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Guide and protocol draft * implementable `struct` is public, where it members - private * contain main `struct` implementation: * at least one constructor that must: - * have common for application name: `new` + * have common for application name: `new` or/and `new_arc`, `new_mutex`, etc - on return object in container * grant ownership for new `Self` object created * public `activate` action if the new object can not be activated on construct * public `link` getter for GTK `widget` (parental composition) diff --git a/src/app/browser/window/tab.rs b/src/app/browser/window/tab.rs index 2412f0e8..082b7047 100644 --- a/src/app/browser/window/tab.rs +++ b/src/app/browser/window/tab.rs @@ -253,6 +253,7 @@ impl Tab { // Read HashMap index collected let mut page_number = 0; + // @TODO incorrect order for (_, item) in self.index.borrow().iter() { item.save( transaction, diff --git a/src/app/browser/window/tab/item.rs b/src/app/browser/window/tab/item.rs index 859777b4..38b3e961 100644 --- a/src/app/browser/window/tab/item.rs +++ b/src/app/browser/window/tab/item.rs @@ -43,9 +43,9 @@ impl Item { let id = uuid_string_random(); // Init components - let label = Label::new(id.clone(), false); + let label = Label::new_arc(id.clone(), false); - let page = Page::new( + let page = Page::new_arc( id.clone(), page_navigation_request_text.clone(), action_tab_page_navigation_base.clone(), diff --git a/src/app/browser/window/tab/item/label.rs b/src/app/browser/window/tab/item/label.rs index 59b52ea2..3f8a2e07 100644 --- a/src/app/browser/window/tab/item/label.rs +++ b/src/app/browser/window/tab/item/label.rs @@ -24,11 +24,11 @@ pub struct Label { impl Label { // Construct - pub fn new(name: GString, is_pinned: bool) -> Arc { + pub fn new_arc(name: GString, is_pinned: bool) -> Arc { // Init components - let pin = Pin::new(is_pinned); - let title = Title::new(); - let widget = Widget::new(name, pin.gobject(), title.gobject()); + let pin = Pin::new_arc(is_pinned); + let title = Title::new_arc(); + let widget = Widget::new_arc(name, pin.gobject(), title.gobject()); // Init label struct let label = Arc::new(Self { diff --git a/src/app/browser/window/tab/item/label/pin.rs b/src/app/browser/window/tab/item/label/pin.rs index 2d84fd84..51e1e330 100644 --- a/src/app/browser/window/tab/item/label/pin.rs +++ b/src/app/browser/window/tab/item/label/pin.rs @@ -8,7 +8,7 @@ pub struct Pin { impl Pin { // Construct - pub fn new(visible: bool) -> Arc { + pub fn new_arc(visible: bool) -> Arc { let gobject = Image::builder() .icon_name("view-pin-symbolic") .visible(visible) diff --git a/src/app/browser/window/tab/item/label/title.rs b/src/app/browser/window/tab/item/label/title.rs index 6d48bf95..aadacb57 100644 --- a/src/app/browser/window/tab/item/label/title.rs +++ b/src/app/browser/window/tab/item/label/title.rs @@ -10,7 +10,7 @@ pub struct Title { impl Title { // Construct - pub fn new() -> Arc { + pub fn new_arc() -> Arc { Arc::new(Self { gobject: Label::builder() .label(DEFAULT_LABEL_TEXT) diff --git a/src/app/browser/window/tab/item/label/widget.rs b/src/app/browser/window/tab/item/label/widget.rs index 2dd43ba2..b6e4c84a 100644 --- a/src/app/browser/window/tab/item/label/widget.rs +++ b/src/app/browser/window/tab/item/label/widget.rs @@ -10,7 +10,7 @@ pub struct Widget { impl Widget { // Construct - pub fn new(name: GString, pin: &Image, title: &Label) -> Arc { + pub fn new_arc(name: GString, pin: &Image, title: &Label) -> Arc { let gobject = Box::builder() .orientation(Orientation::Horizontal) .halign(Align::Center) diff --git a/src/app/browser/window/tab/item/page.rs b/src/app/browser/window/tab/item/page.rs index ca3b8ec4..5a4cc82b 100644 --- a/src/app/browser/window/tab/item/page.rs +++ b/src/app/browser/window/tab/item/page.rs @@ -36,7 +36,7 @@ pub struct Page { impl Page { // Construct - pub fn new( + pub fn new_arc( name: GString, navigation_request_text: Option, action_tab_page_navigation_base: Arc,