Skip to content

Commit 78fd72f

Browse files
flound1129claude
andcommitted
chore: remove dead GConf (GNOME 2) magnet URI registration code
GConf was replaced by GSettings in GNOME 3 and is unavailable on modern desktops. Remove the entire gconf magnet handler branch from associate_magnet_links() — only the Windows registry path remains. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3420cd4 commit 78fd72f

File tree

2 files changed

+2
-34
lines changed

2 files changed

+2
-34
lines changed

deluge/ui/gtk3/common.py

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
SortType,
2828
)
2929

30-
from deluge.common import get_pixmap, is_ip, osx_check, windows_check
30+
from deluge.common import get_pixmap, is_ip, windows_check
3131

3232
log = logging.getLogger(__name__)
3333

@@ -274,38 +274,6 @@ def associate_magnet_links(overwrite=False):
274274
)
275275
winreg.CloseKey(magnet_key)
276276

277-
# Don't try associate magnet on OSX see: #2420
278-
elif not osx_check():
279-
# gconf method is only available in a GNOME environment
280-
try:
281-
import gi
282-
283-
gi.require_version('GConf', '2.0')
284-
from gi.repository import GConf
285-
except ValueError:
286-
log.debug(
287-
'gconf not available, so will not attempt to register magnet URI handler'
288-
)
289-
return False
290-
else:
291-
key = '/desktop/gnome/url-handlers/magnet/command'
292-
gconf_client = GConf.Client.get_default()
293-
if (gconf_client.get(key) and overwrite) or not gconf_client.get(key):
294-
# We are either going to overwrite the key, or do it if it hasn't been set yet
295-
if gconf_client.set_string(key, 'deluge "%s"'):
296-
gconf_client.set_bool(
297-
'/desktop/gnome/url-handlers/magnet/needs_terminal', False
298-
)
299-
gconf_client.set_bool(
300-
'/desktop/gnome/url-handlers/magnet/enabled', True
301-
)
302-
log.info('Deluge registered as default magnet URI handler!')
303-
return True
304-
else:
305-
log.error(
306-
'Unable to register Deluge as default magnet URI handler.'
307-
)
308-
return False
309277
return False
310278

311279

deluge/ui/gtk3/gtkui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def on_die(*args):
168168
# Set process name again to fix gtk issue
169169
setproctitle(getproctitle())
170170

171-
# Attempt to register a magnet URI handler with gconf, but do not overwrite
171+
# Attempt to register a magnet URI handler, but do not overwrite
172172
# if already set by another program.
173173
associate_magnet_links(False)
174174

0 commit comments

Comments
 (0)