diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-10-06 08:09:26 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-10-06 08:09:26 +0000 |
commit | 69501c1a570997de5597a7d297cc8167b986812c (patch) | |
tree | b87d0228b213d6b929cb8c483a998ef120463c14 | |
parent | 8f444056099876aa36382824e637ad2084dc9c4c (diff) |
win32: environmental variable fix.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@624 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | ChangeLog.ja | 8 | ||||
-rw-r--r-- | libsylph/prefs.c | 8 | ||||
-rw-r--r-- | libsylph/utils.c | 15 | ||||
-rw-r--r-- | src/prefs_ui.c | 4 |
5 files changed, 39 insertions, 4 deletions
@@ -1,5 +1,13 @@ 2005-10-06 + * libsylph/utils.c: get_rc_dir(): win32: use environmental variable + APPDATA. + * libsylph/prefs.c: prefs_set_default() + src/prefs_ui.c: prefs_set_dialog_to_default(): win32: don't convert + the encoding of environmental variable. Expand '~' to rc dir. + +2005-10-06 + * src/main.c: win32: include startup directory into %PATH% for GSpawn. 2005-10-05 diff --git a/ChangeLog.ja b/ChangeLog.ja index c0b3638a..1414ecc1 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,5 +1,13 @@ 2005-10-06 + * libsylph/utils.c: get_rc_dir(): win32: 環境変数 APPDATA を使用する + ようにした。 + * libsylph/prefs.c: prefs_set_default() + src/prefs_ui.c: prefs_set_dialog_to_default(): win32: 環境変数の + エンコーディングを変換しないようにした。 '~' を rc dir に展開。 + +2005-10-06 + * src/main.c: win32: GSpawn のために起動時のディレクトリを %PATH% に 含めるようにした。 diff --git a/libsylph/prefs.c b/libsylph/prefs.c index 190f5837..030cc746 100644 --- a/libsylph/prefs.c +++ b/libsylph/prefs.c @@ -425,6 +425,9 @@ void prefs_set_default(PrefParam *param) gchar *tmp = NULL; envstr = g_getenv(param[i].defval + 4); +#ifdef G_OS_WIN32 + tmp = g_strdup(envstr); +#else if (envstr) { tmp = conv_codeset_strdup (envstr, @@ -435,10 +438,15 @@ void prefs_set_default(PrefParam *param) tmp = g_strdup(envstr); } } +#endif *((gchar **)param[i].data) = tmp; } else if (param[i].defval[0] == '~') *((gchar **)param[i].data) = +#ifdef G_OS_WIN32 + g_strconcat(get_rc_dir(), +#else g_strconcat(get_home_dir(), +#endif param[i].defval + 1, NULL); else if (param[i].defval[0] != '\0') diff --git a/libsylph/utils.c b/libsylph/utils.c index 1058b83e..c8e3395b 100644 --- a/libsylph/utils.c +++ b/libsylph/utils.c @@ -1648,15 +1648,22 @@ const gchar *get_rc_dir(void) { static gchar *rc_dir = NULL; - if (!rc_dir) + if (!rc_dir) { #ifdef G_OS_WIN32 - rc_dir = g_strconcat(get_home_dir(), G_DIR_SEPARATOR_S, - "Application Data", G_DIR_SEPARATOR_S, - RC_DIR, NULL); + const gchar *appdata; + + appdata = g_getenv("APPDATA"); + if (appdata) + rc_dir = g_strconcat(appdata, G_DIR_SEPARATOR_S, + RC_DIR, NULL); + else + rc_dir = g_strconcat(get_home_dir(), G_DIR_SEPARATOR_S, + RC_DIR, NULL); #else rc_dir = g_strconcat(get_home_dir(), G_DIR_SEPARATOR_S, RC_DIR, NULL); #endif + } return rc_dir; } diff --git a/src/prefs_ui.c b/src/prefs_ui.c index 6ddc9ade..2cd45249 100644 --- a/src/prefs_ui.c +++ b/src/prefs_ui.c @@ -175,7 +175,11 @@ void prefs_set_dialog_to_default(PrefParam *param) break; } else if (tmpparam.defval[0] == '~') { str_data = +#ifdef G_OS_WIN32 + g_strconcat(get_rc_dir(), +#else g_strconcat(get_home_dir(), +#endif param[i].defval + 1, NULL); tmpparam.data = &str_data; |