fix: adjust `Glib::ustring` creation in a few places (#4859)
From what I observed, ctor accepting `(begin, end)` is getting called instead of one accepting `(data, size)` for no apparent reason in some cases. Switch to a ctor accepting a `std::string` in those problematic places.
This commit is contained in:
parent
05dded12a0
commit
25b50a7dff
|
@ -1296,9 +1296,7 @@ void Application::Impl::on_prefs_changed(tr_quark const key)
|
||||||
{
|
{
|
||||||
bool const b = gtr_pref_flag_get(key);
|
bool const b = gtr_pref_flag_get(key);
|
||||||
tr_sessionUseAltSpeed(tr, b);
|
tr_sessionUseAltSpeed(tr, b);
|
||||||
auto const key_sv = tr_quark_get_string_view(key);
|
gtr_action_set_toggled(std::string(tr_quark_get_string_view(key)), b);
|
||||||
auto const key_ustr = Glib::ustring{ std::data(key_sv), std::size(key_sv) };
|
|
||||||
gtr_action_set_toggled(key_ustr, b);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1215,8 +1215,8 @@ void initPeerRow(
|
||||||
(*iter)[peer_cols.address_collated] = collated_name;
|
(*iter)[peer_cols.address_collated] = collated_name;
|
||||||
(*iter)[peer_cols.client] = client;
|
(*iter)[peer_cols.client] = client;
|
||||||
(*iter)[peer_cols.encryption_stock_id] = peer->isEncrypted ? "lock" : "";
|
(*iter)[peer_cols.encryption_stock_id] = peer->isEncrypted ? "lock" : "";
|
||||||
(*iter)[peer_cols.key] = Glib::ustring{ std::data(key), std::size(key) };
|
(*iter)[peer_cols.key] = std::string(key);
|
||||||
(*iter)[peer_cols.torrent_name] = Glib::ustring{ std::data(torrent_name), std::size(torrent_name) };
|
(*iter)[peer_cols.torrent_name] = std::string(torrent_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void refreshPeerRow(Gtk::TreeModel::iterator const& iter, tr_peer_stat const* peer)
|
void refreshPeerRow(Gtk::TreeModel::iterator const& iter, tr_peer_stat const* peer)
|
||||||
|
|
Loading…
Reference in New Issue