Merge branch 'master' into rnnoise

This commit is contained in:
ouwou 2023-08-02 01:48:33 -04:00
commit 9e4382aa77
3 changed files with 7 additions and 3 deletions

View File

@ -204,7 +204,8 @@ void ChatMessageItemContainer::UpdateTextComponent(Gtk::TextView *tv) {
if (data->Application.has_value()) {
static const auto regex = Glib::Regex::create(R"(</(.*?):(\d+)>)");
Glib::MatchInfo match;
if (regex->match(data->Content, match)) {
Glib::ustring string = data->Content;
if (regex->match(string, match)) {
const auto cmd = match.fetch(1);
const auto app = data->Application->Name;
b->insert_markup(s, "<i>used <span color='#697ec4'>" + cmd + "</span> with " + app + "</i>");

View File

@ -39,7 +39,9 @@ bool LazyImage::OnDraw(const Cairo::RefPtr<Cairo::Context> &context) {
Abaddon::Get().GetImageManager().LoadAnimationFromURL(m_url, m_width, m_height, sigc::track_obj(cb, *this));
} else {
auto cb = [this](const Glib::RefPtr<Gdk::Pixbuf> &pb) {
property_pixbuf() = pb->scale_simple(m_width, m_height, Gdk::INTERP_BILINEAR);
int cw, ch;
GetImageDimensions(pb->get_width(), pb->get_height(), cw, ch, m_width, m_height);
property_pixbuf() = pb->scale_simple(cw, ch, Gdk::INTERP_BILINEAR);
};
Abaddon::Get().GetImageManager().LoadFromURL(m_url, sigc::track_obj(cb, *this));

View File

@ -54,7 +54,8 @@ std::optional<uint32_t> GetBuildNumberFromJSURL(const Glib::ustring &url, const
auto regex = Glib::Regex::create(R"("buildNumber",null!==\(t="(\d+)\"\))");
Glib::MatchInfo match;
if (regex->match(res.text, match)) {
Glib::ustring string = res.text;
if (regex->match(string, match)) {
const auto str_value = match.fetch(1);
try {
return std::stoul(str_value);