From 5b5c1138bc2d34750f4671b5c7cb08b96edf4815 Mon Sep 17 00:00:00 2001 From: Michael Cronenworth Date: Apr 12 2016 04:01:12 +0000 Subject: Fix misc GTK UI bugs (rhbz#1219582 and rhbz#1223058) --- diff --git a/deluge-gtk-column-types.patch b/deluge-gtk-column-types.patch new file mode 100644 index 0000000..c43f2c0 --- /dev/null +++ b/deluge-gtk-column-types.patch @@ -0,0 +1,37 @@ +From 58d385241fd235ab68d5372eaa44b6ef16f46c4d Mon Sep 17 00:00:00 2001 +From: Calum Lind +Date: Sun, 20 Sep 2015 15:39:04 +0100 +Subject: [#2762] [GTKUI] Use correct column types for data + +--- + deluge/ui/gtkui/torrentview.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/deluge/ui/gtkui/torrentview.py b/deluge/ui/gtkui/torrentview.py +index 80f49fb..7c68cbc 100644 +--- a/deluge/ui/gtkui/torrentview.py ++++ b/deluge/ui/gtkui/torrentview.py +@@ -277,9 +277,9 @@ class TorrentView(listview.ListView, component.Component): + sort_func=seed_peer_column_sort, default=False) + self.add_func_column(_("Seeders") + "/" + _("Peers"), listview.cell_data_ratio, [float], + status_field=["seeds_peers_ratio"], default=False) +- self.add_func_column(_("Down Speed"), listview.cell_data_speed, [float], ++ self.add_func_column(_("Down Speed"), listview.cell_data_speed, [int], + status_field=["download_payload_rate"]) +- self.add_func_column(_("Up Speed"), listview.cell_data_speed, [float], ++ self.add_func_column(_("Up Speed"), listview.cell_data_speed, [int], + status_field=["upload_payload_rate"]) + self.add_func_column(_("Down Limit"), listview.cell_data_speed_limit, [float], + status_field=["max_download_speed"], default=False) +@@ -291,7 +291,7 @@ class TorrentView(listview.ListView, component.Component): + status_field=["ratio"], default=False) + self.add_func_column(_("Avail"), listview.cell_data_ratio, [float], + status_field=["distributed_copies"], default=False) +- self.add_func_column(_("Added"), listview.cell_data_date, [float], ++ self.add_func_column(_("Added"), listview.cell_data_date, [int], + status_field=["time_added"], default=False) + self.add_texticon_column(_("Tracker"), + status_field=["tracker_host", "tracker_host"], +-- +cgit v0.12 + diff --git a/deluge-gtk-invalid-magnet.patch b/deluge-gtk-invalid-magnet.patch new file mode 100644 index 0000000..da6e381 --- /dev/null +++ b/deluge-gtk-invalid-magnet.patch @@ -0,0 +1,34 @@ +From 58059300bde65f0b45c6177b123e6957c3c814d5 Mon Sep 17 00:00:00 2001 +From: Calum Lind +Date: Sun, 20 Sep 2015 15:19:32 +0100 +Subject: [#2763] [GTKUI] Fix unhandled error with invalid magnet uri + +--- + deluge/ui/gtkui/addtorrentdialog.py | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/deluge/ui/gtkui/addtorrentdialog.py b/deluge/ui/gtkui/addtorrentdialog.py +index 195ac60..8b8d9c5 100644 +--- a/deluge/ui/gtkui/addtorrentdialog.py ++++ b/deluge/ui/gtkui/addtorrentdialog.py +@@ -251,12 +251,16 @@ class AddTorrentDialog(component.Component): + + for uri in uris: + s = uri.split("&")[0][20:] ++ info_hash = None + if len(s) == 32: + info_hash = base64.b32decode(s).encode("hex") + elif len(s) == 40: + info_hash = s ++ if info_hash is None: ++ log.error("Invalid info_hash in uri: %s", uri) ++ continue + if info_hash in self.infos: +- log.debug("Torrent already in list!") ++ log.debug("Torrent already in list: %s", uri) + continue + name = None + for i in uri.split("&"): +-- +cgit v0.12 + diff --git a/deluge-twisted-15.patch b/deluge-twisted-15.patch deleted file mode 100644 index e587209..0000000 --- a/deluge-twisted-15.patch +++ /dev/null @@ -1,49 +0,0 @@ -From d40dfcd53c2439de121ddaff476e66194dc2c738 Mon Sep 17 00:00:00 2001 -From: Andrew Resch -Date: Mon, 23 Feb 2015 08:31:00 +0000 -Subject: Fix for Twisted 15.0 URI class rename - ---- -diff --git a/deluge/httpdownloader.py b/deluge/httpdownloader.py -index b146477..14dcdc3 100644 ---- a/deluge/httpdownloader.py -+++ b/deluge/httpdownloader.py -@@ -146,7 +146,7 @@ def sanitise_filename(filename): - log.warning("Potentially malicious server: trying to write to file '%s'" % filename) - # Only use the basename - filename = os.path.basename(filename) -- -+ - filename = filename.strip() - if filename.startswith(".") or ";" in filename or "|" in filename: - # Dodgy server, log it -@@ -192,17 +192,22 @@ def download_file(url, filename, callback=None, headers=None, force_filename=Fal - headers = {} - headers["accept-encoding"] = "deflate, gzip, x-gzip" - -- # In twisted 13.1.0 the _parse() function was replaced by the _URI class -- if hasattr(client, '_parse'): -+ # In Twisted 13.1.0 _parse() function replaced by _URI class. -+ # In Twisted 15.0.0 _URI class renamed to URI. -+ if hasattr(client, "_parse"): - scheme, host, port, path = client._parse(url) - else: -- from twisted.web.client import _URI -- uri = _URI.fromBytes(url) -+ try: -+ from twisted.web.client import _URI as URI -+ except ImportError: -+ from twisted.web.client import URI -+ -+ uri = URI.fromBytes(url) - scheme = uri.scheme - host = uri.host - port = uri.port - path = uri.path -- -+ - factory = HTTPDownloader(url, filename, callback, headers, force_filename, allow_compression) - if scheme == "https": - from twisted.internet import ssl --- -cgit v0.9.2 diff --git a/deluge.spec b/deluge.spec index 4afc501..0a59569 100644 --- a/deluge.spec +++ b/deluge.spec @@ -1,6 +1,6 @@ Name: deluge Version: 1.3.12 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A GTK+ BitTorrent client with support for DHT, UPnP, and PEX Group: Applications/Internet License: GPLv3 with exceptions @@ -10,6 +10,10 @@ Source1: deluge-daemon.service Source2: deluge-web.service # Prevent crashes in Create Torrent dialog for non-English languages Patch1: deluge-createtorrentdialog.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1219582 +Patch2: deluge-gtk-column-types.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1223058 +Patch3: deluge-gtk-invalid-magnet.patch BuildArch: noarch BuildRequires: desktop-file-utils @@ -112,6 +116,8 @@ Files for the Deluge daemon %prep %setup -q %patch1 -p1 -b .createtorrentdialog +%patch2 -p1 -b .gtk-column-types +%patch3 -p1 -b .gtk-invalid-magnet # remove bundled copy of python-rencode # http://dev.deluge-torrent.org/ticket/2326 @@ -276,6 +282,9 @@ fi gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %changelog +* Mon Apr 11 2016 Michael Cronenworth - 1.3.12-3 +- Fix GTK UI bugs (rhbz#1219582 and rhbz#1223058) + * Wed Feb 03 2016 Fedora Release Engineering - 1.3.12-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild