Do not use the stored config_location value because it should only be used if the --config option is

set.
This commit is contained in:
Andrew Resch 2008-12-27 21:24:50 +00:00
parent e1c5f69d54
commit 6359c5d4af
7 changed files with 16 additions and 11 deletions

View File

@ -40,6 +40,7 @@ import deluge.ui.gtkui.common as common
from deluge.ui.common import get_localhost_auth_uri
from deluge.ui.client import aclient as client
from deluge.configmanager import ConfigManager
import deluge.configmanager
from deluge.log import LOG as log
DEFAULT_URI = "http://127.0.0.1:58846"
@ -480,7 +481,7 @@ class ConnectionManager(component.Component):
win32api.WinExec("deluged -p %s" % port)
else:
subprocess.call(["deluged", "--port=%s" % port,
"--config=%s" % self.gtkui_config["config_location"]])
"--config=%s" % deluge.configmanager.get_config_dir()])
def on_button_close_clicked(self, widget):
log.debug("on_button_close_clicked")

View File

@ -32,6 +32,7 @@ import cPickle
from deluge.ui.gtkui.torrentdetails import Tab
from deluge.ui.client import aclient as client
from deluge.configmanager import ConfigManager
import deluge.configmanager
import deluge.component as component
import deluge.common
@ -221,7 +222,7 @@ class FilesTab(Tab):
}
# Get the config location for saving the state file
config_location = ConfigManager("gtkui.conf")["config_location"]
config_location = deluge.configmanager.get_config_dir()
try:
log.debug("Saving FilesTab state file: %s", filename)
@ -234,7 +235,7 @@ class FilesTab(Tab):
def load_state(self):
filename = "files_tab.state"
# Get the config location for loading the state file
config_location = ConfigManager("gtkui.conf")["config_location"]
config_location = deluge.configmanager.get_config_dir()
state = None
try:

View File

@ -60,7 +60,6 @@ import deluge.configmanager
import deluge.common
DEFAULT_PREFS = {
"config_location": deluge.configmanager.get_config_dir(),
"classic_mode": True,
"interactive_add": True,
"focus_add_dialog": True,

View File

@ -33,6 +33,7 @@ import gtk
import gettext
from deluge.configmanager import ConfigManager
import deluge.configmanager
import deluge.common
from deluge.log import LOG as log
@ -204,7 +205,7 @@ class ListView:
counter += 1
# Get the config location for saving the state file
config_location = ConfigManager("gtkui.conf")["config_location"]
config_location = deluge.configmanager.get_config_dir()
try:
log.debug("Saving ListView state file: %s", filename)
@ -217,7 +218,7 @@ class ListView:
def load_state(self, filename):
"""Load the listview state from filename."""
# Get the config location for loading the state file
config_location = ConfigManager("gtkui.conf")["config_location"]
config_location = deluge.configmanager.get_config_dir()
state = None
try:

View File

@ -32,6 +32,7 @@ from itertools import izip
from deluge.ui.client import aclient as client
from deluge.configmanager import ConfigManager
import deluge.configmanager
import deluge.component as component
import deluge.common
import deluge.ui.gtkui.common as common
@ -175,7 +176,7 @@ class PeersTab(Tab):
}
# Get the config location for saving the state file
config_location = ConfigManager("gtkui.conf")["config_location"]
config_location = deluge.configmanager.get_config_dir()
try:
log.debug("Saving FilesTab state file: %s", filename)
@ -188,7 +189,7 @@ class PeersTab(Tab):
def load_state(self):
filename = "peers_tab.state"
# Get the config location for loading the state file
config_location = ConfigManager("gtkui.conf")["config_location"]
config_location = deluge.configmanager.get_config_dir()
state = None
try:

View File

@ -35,6 +35,7 @@ import deluge.common
import deluge.error
import deluge.ui.gtkui.common as common
from deluge.configmanager import ConfigManager
import deluge.configmanager
class Preferences(component.Component):
def __init__(self):
@ -855,7 +856,7 @@ class Preferences(component.Component):
filename = os.path.split(filepath)[1]
shutil.copyfile(
filepath,
os.path.join(self.gtkui_config["config_location"], "plugins", filename))
os.path.join(deluge.configmanager.get_config_dir(), "plugins", filename))
component.get("PluginManager").scan_for_plugins()

View File

@ -33,6 +33,7 @@ import cPickle
import deluge.component as component
from deluge.ui.client import aclient as client
from deluge.configmanager import ConfigManager
import deluge.configmanager
from deluge.log import LOG as log
@ -371,7 +372,7 @@ class TorrentDetails(component.Component):
state = [(n, v) for w, n, v in state]
# Get the config location for saving the state file
config_location = ConfigManager("gtkui.conf")["config_location"]
config_location = deluge.configmanager.get_config_dir()
try:
log.debug("Saving TorrentDetails state file: %s", filename)
@ -384,7 +385,7 @@ class TorrentDetails(component.Component):
def load_state(self):
filename = "tabs.state"
# Get the config location for loading the state file
config_location = ConfigManager("gtkui.conf")["config_location"]
config_location = deluge.configmanager.get_config_dir()
state = None
try: