mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
remove deprecation feature methods
This commit is contained in:
parent
560adff490
commit
f9365791e6
4 changed files with 10 additions and 40 deletions
|
|
@ -39,9 +39,6 @@ impl Client {
|
|||
pub fn handle(&self, request: &str, is_snap_history: bool) {
|
||||
self.page.escape();
|
||||
|
||||
// Deprecate page info but keep it data as is
|
||||
self.page.navigation.request.info.borrow_mut().deprecate();
|
||||
|
||||
// Initially disable find action
|
||||
self.page
|
||||
.window_action
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ fn handle(
|
|||
/// * includes commit action!
|
||||
fn update_page_info(page: &Page, event_name: &str) {
|
||||
let mut i = page.navigation.request.info.borrow_mut();
|
||||
i.add_event(event_name.to_string()).commit();
|
||||
i.add_event(event_name.to_string());
|
||||
page.navigation.request.update_secondary_icon(&i)
|
||||
}
|
||||
// Update socket info at the point, where the connection is active yet
|
||||
|
|
@ -196,7 +196,7 @@ fn handle(
|
|||
connection.socket_connection.remote_address().unwrap()
|
||||
)));
|
||||
// * unwrap fails only on `connection.socket_connection.is_closed()`
|
||||
// drop the panic as unexpected.
|
||||
// drop the panic as unexpected here.
|
||||
}
|
||||
// Handle response
|
||||
match response {
|
||||
|
|
@ -212,8 +212,7 @@ fn handle(
|
|||
i
|
||||
.add_event(EVENT_COMPLETED.to_string())
|
||||
.set_header(Some(input.as_str().to_string()))
|
||||
.set_size(Some(input.as_bytes().len()))
|
||||
.commit();
|
||||
.set_size(Some(input.as_bytes().len()));
|
||||
page.navigation.request.update_secondary_icon(&i);
|
||||
match input {
|
||||
// https://geminiprotocol.net/docs/protocol-specification.gmi#status-10
|
||||
|
|
@ -354,9 +353,7 @@ fn handle(
|
|||
page.snap_history();
|
||||
}
|
||||
redirects.replace(0); // reset
|
||||
i
|
||||
.add_event(EVENT_COMPLETED.to_string())
|
||||
.commit();
|
||||
i.add_event(EVENT_COMPLETED.to_string());
|
||||
page.navigation.request.update_secondary_icon(&i)
|
||||
},
|
||||
Err(e) => {
|
||||
|
|
@ -435,8 +432,7 @@ fn handle(
|
|||
.add_event(EVENT_COMPLETED.to_string())
|
||||
.set_header(Some(success.as_header_str().to_string()))
|
||||
.set_mime(Some(mime))
|
||||
.set_size(Some(buffer.byte_length()))
|
||||
.commit();
|
||||
.set_size(Some(buffer.byte_length()));
|
||||
page.navigation.request.update_secondary_icon(&i)
|
||||
}
|
||||
Err(e) => {
|
||||
|
|
@ -485,8 +481,7 @@ fn handle(
|
|||
i
|
||||
.add_event(EVENT_COMPLETED.to_string())
|
||||
.set_header(Some(success.as_header_str().to_string()))
|
||||
.set_mime(Some(mime.to_string()))
|
||||
.commit();
|
||||
.set_mime(Some(mime.to_string()));
|
||||
page.navigation.request.update_secondary_icon(&i)
|
||||
},
|
||||
},
|
||||
|
|
@ -553,8 +548,7 @@ fn handle(
|
|||
let mut i = page.navigation.request.info.take();
|
||||
i
|
||||
.add_event(EVENT_COMPLETED.to_string())
|
||||
.set_header(Some(redirect.as_str().to_string()))
|
||||
.commit();
|
||||
.set_header(Some(redirect.as_str().to_string()));
|
||||
page.navigation.request.info.replace(match redirect {
|
||||
Redirect::Permanent { .. } => i.into_permanent_redirect(),
|
||||
Redirect::Temporary { .. } => i.into_temporary_redirect(),
|
||||
|
|
@ -578,8 +572,7 @@ fn handle(
|
|||
i
|
||||
.add_event(EVENT_COMPLETED.to_string())
|
||||
.set_header(Some(certificate.as_str().to_string()))
|
||||
.set_size(Some(certificate.as_bytes().len()))
|
||||
.commit();
|
||||
.set_size(Some(certificate.as_bytes().len()));
|
||||
page.navigation.request.update_secondary_icon(&i);
|
||||
// update page content widget
|
||||
let s = page.content.to_status_identity();
|
||||
|
|
@ -619,7 +612,7 @@ fn handle(
|
|||
}
|
||||
redirects.replace(0); // reset
|
||||
let mut i = page.navigation.request.info.borrow_mut();
|
||||
i.add_event(EVENT_COMPLETED.to_string()).set_request(Some(uri.to_string())).commit();
|
||||
i.add_event(EVENT_COMPLETED.to_string()).set_request(Some(uri.to_string()));
|
||||
page.navigation.request.update_secondary_icon(&i)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -355,7 +355,7 @@ fn update_secondary_icon(entry: &Entry, info: &Info) {
|
|||
entry.set_secondary_icon_name(Some("pan-end-symbolic"));
|
||||
entry.set_secondary_icon_tooltip_text(Some("Go to the location"))
|
||||
} else {
|
||||
if !info.is_deprecated() && info.matches(&entry.text()) {
|
||||
if info.matches(&entry.text()) {
|
||||
entry.set_secondary_icon_name(Some("help-about-symbolic"));
|
||||
entry.set_secondary_icon_tooltip_text(Some("Page info"));
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -19,9 +19,6 @@ pub struct Info {
|
|||
/// Hold optional header string to dump it in the info dialog
|
||||
/// and calculate total size
|
||||
header: Option<String>,
|
||||
/// Mark holder as deprecated on handle begin
|
||||
/// * useful on some driver does not update status properly
|
||||
is_deprecated: bool,
|
||||
/// Page content type
|
||||
mime: Option<String>,
|
||||
/// Hold redirections chain with handled details
|
||||
|
|
@ -44,7 +41,6 @@ impl Info {
|
|||
Self {
|
||||
event: Vec::with_capacity(50), // estimated max events quantity for all drivers
|
||||
header: None,
|
||||
is_deprecated: false,
|
||||
mime: None,
|
||||
redirect: None,
|
||||
request: None,
|
||||
|
|
@ -76,18 +72,6 @@ impl Info {
|
|||
PreferencesDialog::info(profile, self).present(Some(parent))
|
||||
}
|
||||
|
||||
/// Actualize `Self`
|
||||
pub fn commit(&mut self) {
|
||||
self.is_deprecated = false;
|
||||
}
|
||||
|
||||
/// Mark `Self` as deprecated
|
||||
/// * tip: usually called on page load begin,
|
||||
/// to prevent driver implementation mistakes
|
||||
pub fn deprecate(&mut self) {
|
||||
self.is_deprecated = true;
|
||||
}
|
||||
|
||||
// Setters
|
||||
// * update `Self` in chain
|
||||
|
||||
|
|
@ -149,10 +133,6 @@ impl Info {
|
|||
pub fn matches(&self, request: &str) -> bool {
|
||||
self.request.as_ref().is_some_and(|r| r == request)
|
||||
}
|
||||
|
||||
pub fn is_deprecated(&self) -> bool {
|
||||
self.is_deprecated
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Info {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue