diff options
Diffstat (limited to 'network/gtorrentviewer/patches/gtorrentviewer-0.2b-trackerdetails.patch')
-rw-r--r-- | network/gtorrentviewer/patches/gtorrentviewer-0.2b-trackerdetails.patch | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/network/gtorrentviewer/patches/gtorrentviewer-0.2b-trackerdetails.patch b/network/gtorrentviewer/patches/gtorrentviewer-0.2b-trackerdetails.patch new file mode 100644 index 0000000000..dbdb68d62c --- /dev/null +++ b/network/gtorrentviewer/patches/gtorrentviewer-0.2b-trackerdetails.patch @@ -0,0 +1,56 @@ +diff --git a/src/main.c b/src/main.c +index fc51205..a770768 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -336,12 +336,8 @@ tracker_scrape(gpointer tracker) + SHA1((guint8*)string, number, (guint8*)torrent_sha); + g_free(string); + +- if(g_str_has_suffix((gchar*)tracker, "info_hash=")) +- string = util_convert_to_hex(torrent_sha, SHA_DIGEST_LENGTH, "%"); +- else +- string = g_strdup(" "); +- +- host = g_strdup_printf("%s%s", (gchar*)tracker, string); ++ string = util_convert_to_hex(torrent_sha, SHA_DIGEST_LENGTH, "%"); ++ host = g_strdup_printf("%s?info_hash=%s", (gchar*)tracker, string); + g_free(string); + + string = g_strrstr(host, "announce"); +diff --git a/src/mainwindow.c b/src/mainwindow.c +index 6b1bbf0..415098e 100644 +--- a/src/mainwindow.c ++++ b/src/mainwindow.c +@@ -421,23 +421,23 @@ mainwindow_fill_trackers_tab(MainWindow const *mwin, BencNode *torrent) + + gtk_combo_box_set_active(mwin->TrackerComboBox, -1); + ++ node = benc_node_find_key(torrent, "announce"); ++ gtk_list_store_append(liststore, &iter); ++ gtk_list_store_set(liststore, &iter, 0, benc_node_data(node), -1); ++ + node = benc_node_find_key(torrent, "announce-list"); +- if(node == NULL) /* no multi-tracker */ +- { +- node = benc_node_find_key(torrent, "announce"); +- gtk_list_store_append(liststore, &iter); +- gtk_list_store_set(liststore, &iter, 0, benc_node_data(node), -1); +- } +- else /* multi-tracker support */ ++ if(node != NULL) /* multi-tracker support */ + { +- node = benc_node_first_child(node); +- if(node != NULL) ++ for (node = benc_node_first_child(node); node != NULL; ++ node = benc_node_next_sibling(node)) ++ { + for(subnode = benc_node_first_child(node); subnode != NULL; + subnode = benc_node_next_sibling(subnode)) + { + gtk_list_store_append(liststore, &iter); + gtk_list_store_set(liststore, &iter, 0, benc_node_data(subnode), -1); + } ++ } + } + + gtk_combo_box_set_model(mwin->TrackerComboBox, GTK_TREE_MODEL(liststore)); |