From 18d7026db7ed68f0d84b21653af344ff38f0b65b Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Fri, 4 Jul 2008 23:14:05 +0000 Subject: [PATCH] fix path of config in windows --- deluge/common.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/deluge/common.py b/deluge/common.py index 1dc143288..4bc08c162 100644 --- a/deluge/common.py +++ b/deluge/common.py @@ -99,10 +99,16 @@ def get_default_config_dir(filename=None): """ Returns the config path if no filename is specified Returns the config directory + filename as a path if filename is specified """ - if filename != None: - return os.path.join(xdg.BaseDirectory.save_config_path("deluge"), filename) + if windows_check(): + if filename: + return os.path.join(os.environ.get("APPDATA"), "deluge"), filename) + else: + return os.path.join(os.environ.get("APPDATA"), "deluge") else: - return xdg.BaseDirectory.save_config_path("deluge") + if filename: + return os.path.join(xdg.BaseDirectory.save_config_path("deluge"), filename) + else: + return xdg.BaseDirectory.save_config_path("deluge") def get_default_download_dir(): """Returns the default download directory"""