Browse Source

remove deprecated optional arguments

master
yggverse 2 months ago
parent
commit
e2ab831d57
  1. 2
      src/app/browser.rs
  2. 2
      src/app/browser/header.rs
  3. 19
      src/app/browser/header/title.rs

2
src/app/browser.rs

@ -136,7 +136,7 @@ impl Browser { @@ -136,7 +136,7 @@ impl Browser {
None => GString::new(), // @TODO
};
header.update(Some(title.as_str()), Some(subtitle.as_str()));
header.update(title.as_str(), subtitle.as_str());
}
});

2
src/app/browser/header.rs

@ -56,7 +56,7 @@ impl Header { @@ -56,7 +56,7 @@ impl Header {
}
// Actions
pub fn update(&self, title: Option<&str>, description: Option<&str>) {
pub fn update(&self, title: &str, description: &str) {
self.title.update(title, description);
}

19
src/app/browser/header/title.rs

@ -16,25 +16,20 @@ impl Title { @@ -16,25 +16,20 @@ impl Title {
}
// Actions
pub fn update(&self, title: Option<&str>, subtitle: Option<&str>) {
pub fn update(&self, title: &str, subtitle: &str) {
// Update title
let mut name = Vec::new();
let mut parts = Vec::new();
if let Some(value) = title {
if !value.is_empty() {
name.push(value);
}
if !title.is_empty() {
parts.push(title);
}
name.push(DEFAULT_TITLE);
parts.push(DEFAULT_TITLE);
self.gobject.set_title(&name.join(" - "));
self.gobject.set_title(&parts.join(" - "));
// Update subtitle
self.gobject.set_subtitle(&match subtitle {
Some(value) => value,
None => "", // @TODO
});
self.gobject.set_subtitle(subtitle);
}
// Getters

Loading…
Cancel
Save