Commit 0d3bddc5 authored by Alexandre Julliard's avatar Alexandre Julliard

Updated paths of ShowDirSymlinks, ShowDotFiles and Version options.

parent 6e764fce
......@@ -40,7 +40,7 @@ static void update_comboboxes(HWND dialog)
char *winver;
/* retrieve the registry values */
winver = get_reg_key(keypath("Version"), "Windows", "");
winver = get_reg_key(keypath(""), "Version", "");
/* empty winver means use automatic mode (ie the builtin dll linkage heuristics) */
WINE_TRACE("winver is %s\n", *winver != '\0' ? winver : "null (automatic mode)");
......@@ -296,12 +296,12 @@ static void on_winver_change(HWND dialog)
if (selection == 0)
{
WINE_TRACE("automatic/default selected so removing current setting\n");
set_reg_key(keypath("Version"), "Windows", NULL);
set_reg_key(keypath(""), "Version", NULL);
}
else
{
WINE_TRACE("setting Version\\Windows key to value '%s'\n", ver[selection - 1].szVersion);
set_reg_key(keypath("Version"), "Windows", ver[selection - 1].szVersion);
WINE_TRACE("setting Version key to value '%s'\n", ver[selection - 1].szVersion);
set_reg_key(keypath(""), "Version", ver[selection - 1].szVersion);
}
/* enable the apply button */
......
......@@ -310,14 +310,14 @@ static int fill_drives_list(HWND dialog)
static void on_options_click(HWND dialog)
{
if (IsDlgButtonChecked(dialog, IDC_SHOW_DIRSYM_LINK) == BST_CHECKED)
set_reg_key("wine", "ShowDirSymLinks", "Y");
set_reg_key("", "ShowDirSymLinks", "Y");
else
set_reg_key("wine", "ShowDIrSymLinks", "N");
set_reg_key("", "ShowDirSymLinks", "N");
if (IsDlgButtonChecked(dialog, IDC_SHOW_DOT_FILES) == BST_CHECKED)
set_reg_key("wine", "ShowDotFiles", "Y");
set_reg_key("", "ShowDotFiles", "Y");
else
set_reg_key("wine", "ShowDotFiles", "N");
set_reg_key("", "ShowDotFiles", "N");
}
static void on_add_click(HWND dialog)
......@@ -684,10 +684,10 @@ static void init_listview_columns(HWND dialog)
static void load_drive_options(HWND dialog)
{
if (!strcmp(get_reg_key("wine", "ShowDirSymLinks", "N"), "Y"))
if (!strcmp(get_reg_key("", "ShowDirSymLinks", "N"), "Y"))
CheckDlgButton(dialog, IDC_SHOW_DIRSYM_LINK, BST_CHECKED);
if (!strcmp(get_reg_key("wine", "ShowDotFiles", "N"), "Y"))
if (!strcmp(get_reg_key("", "ShowDotFiles", "N"), "Y"))
CheckDlgButton(dialog, IDC_SHOW_DOT_FILES, BST_CHECKED);
}
......
......@@ -123,7 +123,7 @@ static char *get_config_key (const char *subkey, const char *name, const char *d
WINE_TRACE("buffer=%s\n", buffer);
end:
if (hSubKey) RegCloseKey(hSubKey);
if (hSubKey && hSubKey != config_key) RegCloseKey(hSubKey);
return (char*)buffer;
}
......@@ -147,8 +147,12 @@ static int set_config_key(const char *subkey, const char *name, const char *valu
assert( subkey != NULL );
res = RegCreateKey(config_key, subkey, &key);
if (res != ERROR_SUCCESS) goto end;
if (subkey[0])
{
res = RegCreateKey(config_key, subkey, &key);
if (res != ERROR_SUCCESS) goto end;
}
else key = config_key;
if (name == NULL || value == NULL) goto end;
res = RegSetValueEx(key, name, 0, REG_SZ, value, strlen(value) + 1);
......@@ -156,7 +160,7 @@ static int set_config_key(const char *subkey, const char *name, const char *valu
res = 0;
end:
if (key) RegCloseKey(key);
if (key && key != config_key) RegCloseKey(key);
if (res != 0) WINE_ERR("Unable to set configuration key %s in section %s to %s, res=%ld\n", name, subkey, value, res);
return res;
}
......@@ -496,7 +500,8 @@ char *keypath(const char *section)
if (current_app)
{
result = HeapAlloc(GetProcessHeap(), 0, strlen("AppDefaults\\") + strlen(current_app) + 2 /* \\ */ + strlen(section) + 1 /* terminator */);
sprintf(result, "AppDefaults\\%s\\%s", current_app, section);
sprintf(result, "AppDefaults\\%s", current_app);
if (section[0]) sprintf( result + strlen(result), "\\%s", section );
}
else
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment