mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
fix gtk spacial chars warning
This commit is contained in:
parent
c34db6b5f7
commit
9a6c8be37f
2 changed files with 17 additions and 7 deletions
|
|
@ -73,7 +73,7 @@ impl Bookmarks for adw::PreferencesDialog {
|
||||||
.format_iso8601()
|
.format_iso8601()
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
)
|
)
|
||||||
.title(group)
|
.title(escape(&group))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
for record in records {
|
for record in records {
|
||||||
|
|
@ -86,7 +86,7 @@ impl Bookmarks for adw::PreferencesDialog {
|
||||||
None => record.time.format_iso8601().unwrap().to_string(),
|
None => record.time.format_iso8601().unwrap().to_string(),
|
||||||
})
|
})
|
||||||
.subtitle_selectable(true)
|
.subtitle_selectable(true)
|
||||||
.subtitle(&record.request)
|
.subtitle(escape(&record.request))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
a.add_suffix(&{
|
a.add_suffix(&{
|
||||||
|
|
@ -126,3 +126,8 @@ impl Bookmarks for adw::PreferencesDialog {
|
||||||
d
|
d
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Prevents GTK warnings (`use_markup` has no effect @TODO)
|
||||||
|
fn escape(value: &str) -> String {
|
||||||
|
value.replace("&", "&").replace("&", "&")
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ use adw::{
|
||||||
};
|
};
|
||||||
use gtk::{
|
use gtk::{
|
||||||
Align, Button,
|
Align, Button,
|
||||||
glib::{DateTime, GString, Uri, UriFlags, gformat},
|
glib::{DateTime, GString, Uri, UriFlags},
|
||||||
prelude::ButtonExt,
|
prelude::ButtonExt,
|
||||||
};
|
};
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
|
|
@ -85,7 +85,7 @@ impl History for adw::PreferencesDialog {
|
||||||
.format_iso8601()
|
.format_iso8601()
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
)
|
)
|
||||||
.title(group)
|
.title(escape(&group))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
for record in records {
|
for record in records {
|
||||||
|
|
@ -94,14 +94,14 @@ impl History for adw::PreferencesDialog {
|
||||||
.activatable(false)
|
.activatable(false)
|
||||||
.title_selectable(true)
|
.title_selectable(true)
|
||||||
.title(match record.title {
|
.title(match record.title {
|
||||||
Some(title) => title,
|
Some(title) => escape(&title),
|
||||||
None => gformat!(
|
None => format!(
|
||||||
"{} ({})",
|
"{} ({})",
|
||||||
record.event.time.format_iso8601().unwrap(),
|
record.event.time.format_iso8601().unwrap(),
|
||||||
record.event.count
|
record.event.count
|
||||||
),
|
),
|
||||||
})
|
})
|
||||||
.subtitle(&*record.request)
|
.subtitle(escape(&record.request))
|
||||||
.subtitle_selectable(true)
|
.subtitle_selectable(true)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
|
@ -150,3 +150,8 @@ impl History for adw::PreferencesDialog {
|
||||||
d
|
d
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Prevents GTK warnings (`use_markup` has no effect @TODO)
|
||||||
|
fn escape(value: &str) -> String {
|
||||||
|
value.replace("&", "&").replace("&", "&")
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue