From 2e8ee31cb025294635829e86f4e1df63fc69d5c9 Mon Sep 17 00:00:00 2001 From: yggverse Date: Tue, 10 Dec 2024 01:10:47 +0200 Subject: [PATCH] remove extra getters --- src/app/browser/window/tab.rs | 4 ++-- src/app/browser/window/tab/item/page.rs | 2 +- src/app/browser/window/tab/item/page/meta.rs | 10 +--------- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/app/browser/window/tab.rs b/src/app/browser/window/tab.rs index 102c572d..f8c25e48 100644 --- a/src/app/browser/window/tab.rs +++ b/src/app/browser/window/tab.rs @@ -229,7 +229,7 @@ impl Tab { if !item.page.is_loading() { item.widget .gobject - .set_title(item.page.meta.title().as_str()) + .set_title(&item.page.meta.title.borrow()) } } // Update all tabs @@ -242,7 +242,7 @@ impl Tab { if !item.page.is_loading() { item.widget .gobject - .set_title(item.page.meta.title().as_str()) + .set_title(&item.page.meta.title.borrow()) } } } diff --git a/src/app/browser/window/tab/item/page.rs b/src/app/browser/window/tab/item/page.rs index d59d1cc0..ddf49385 100644 --- a/src/app/browser/window/tab/item/page.rs +++ b/src/app/browser/window/tab/item/page.rs @@ -350,7 +350,7 @@ impl Page { pub fn progress_fraction(&self) -> Option { // Interpret status to progress fraction - match self.meta.status() { + match *self.meta.status.borrow() { Status::Reload | Status::SessionRestore => Some(0.0), Status::Resolving => Some(0.1), Status::Resolved => Some(0.2), diff --git a/src/app/browser/window/tab/item/page/meta.rs b/src/app/browser/window/tab/item/page/meta.rs index 4f4ad14a..66b25d40 100644 --- a/src/app/browser/window/tab/item/page/meta.rs +++ b/src/app/browser/window/tab/item/page/meta.rs @@ -74,14 +74,6 @@ impl Meta { // Getters - pub fn status(&self) -> Status { - self.status.borrow().clone() - } - - pub fn title(&self) -> GString { - self.title.borrow().clone() - } - pub fn redirects(&self) -> usize { self.redirect.borrow().len() + 1 } @@ -149,7 +141,7 @@ impl Meta { app_browser_window_tab_page_id: &i64, ) -> Result<(), String> { // Keep value in memory until operation complete - let title = self.title(); + let title = self.title.borrow(); match database::insert( transaction,