1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-27 01:57:52 +00:00

fixup! refactor: make parts of tr file private (#2241) (#2281)

fix: crash regression in GTK client details dialog
This commit is contained in:
Charles Kerr 2021-12-07 19:03:32 -06:00 committed by GitHub
parent 76719bf34c
commit 0a85c3aaa4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -425,7 +425,7 @@ void buildTree(FileRowNode& node, build_data& build)
auto const mime_type = isLeaf ? gtr_get_mime_type_from_filename(child_data.name) : DIRECTORY_MIME_TYPE;
auto const icon = gtr_get_mime_type_icon(mime_type, Gtk::ICON_SIZE_MENU, *build.w);
auto const file = tr_torrentFile(build.tor, child_data.index);
auto const file = isLeaf ? tr_torrentFile(build.tor, child_data.index) : tr_file_view{};
int const priority = isLeaf ? file.priority : 0;
bool const enabled = isLeaf ? file.wanted : true;
auto name_esc = Glib::Markup::escape_text(child_data.name);

View file

@ -375,6 +375,12 @@ static uint64_t loadName(tr_variant* dict, tr_torrent* tor)
return 0;
}
name = tr_strvDup(name);
if (std::empty(name))
{
return 0;
}
if (name != tr_torrentName(tor))
{
tr_free(tor->info.name);