[#3055|GTKUI] Fix unable to auto-start localhost daemon

This commit is contained in:
Calum Lind 2017-06-12 21:36:52 +01:00
parent 131b9f86a9
commit d372be9b65
2 changed files with 3 additions and 4 deletions

View File

@ -23,7 +23,7 @@ from deluge.error import AuthenticationRequired, BadLoginError, IncompatibleClie
from deluge.ui.client import Client, client from deluge.ui.client import Client, client
from deluge.ui.gtkui.common import get_clipboard_text from deluge.ui.gtkui.common import get_clipboard_text
from deluge.ui.gtkui.dialogs import AuthenticationDialog, ErrorDialog from deluge.ui.gtkui.dialogs import AuthenticationDialog, ErrorDialog
from deluge.ui.hostlist import DEFAULT_PORT, HostList from deluge.ui.hostlist import DEFAULT_PORT, LOCALHOST, HostList
try: try:
from urllib.parse import urlparse from urllib.parse import urlparse
@ -41,8 +41,6 @@ HOSTLIST_COL_PASS = 4
HOSTLIST_COL_STATUS = 5 HOSTLIST_COL_STATUS = 5
HOSTLIST_COL_VERSION = 6 HOSTLIST_COL_VERSION = 6
LOCALHOST = ('127.0.0.1', 'localhost')
HOSTLIST_PIXBUFS = [ HOSTLIST_PIXBUFS = [
# This is populated in ConnectionManager.show # This is populated in ConnectionManager.show
] ]

View File

@ -40,6 +40,7 @@ from deluge.common import fsize, fspeed, get_default_download_dir, osx_check, wi
from deluge.configmanager import ConfigManager, get_config_dir from deluge.configmanager import ConfigManager, get_config_dir
from deluge.error import DaemonRunningError from deluge.error import DaemonRunningError
from deluge.ui.client import client from deluge.ui.client import client
from deluge.ui.hostlist import LOCALHOST
from deluge.ui.gtkui.addtorrentdialog import AddTorrentDialog from deluge.ui.gtkui.addtorrentdialog import AddTorrentDialog
from deluge.ui.gtkui.common import associate_magnet_links from deluge.ui.gtkui.common import associate_magnet_links
from deluge.ui.gtkui.connectionmanager import ConnectionManager from deluge.ui.gtkui.connectionmanager import ConnectionManager
@ -340,7 +341,7 @@ class GtkUI(object):
if self.config['autostart_localhost']: if self.config['autostart_localhost']:
port = 0 port = 0
for host_config in self.connectionmanager.hostlist.config['hosts']: for host_config in self.connectionmanager.hostlist.config['hosts']:
if host_config[1] in self.connectionmanager.LOCALHOST: if host_config[1] in LOCALHOST:
port = host_config[2] port = host_config[2]
log.debug('Autostarting localhost: %s', host_config[0:3]) log.debug('Autostarting localhost: %s', host_config[0:3])