From 68b99ea2d3cf42fffe216aeef3be97cf6bbf0de4 Mon Sep 17 00:00:00 2001 From: hiro Date: Thu, 17 Nov 2005 10:45:25 +0000 Subject: win32: fixed startup directory. add sylpheed-mailto-protocol.reg to EXTRA_DIST. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@760 ee746299-78ed-0310-b773-934348b2243d --- ChangeLog | 6 ++++++ ChangeLog.ja | 6 ++++++ Makefile.am | 3 ++- libsylph/utils.c | 15 +++++++++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 46a1957c..4964835b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-11-17 + + * libsylph/utils.c: set_startup_dir(): win32: always set the startup + directory to the same directory as the location of executable file + (fixes untranslated messages when launched by other apps). + 2005-11-17 * src/prefs_common_dialog.c: fixed crash when quote colors dialog was diff --git a/ChangeLog.ja b/ChangeLog.ja index 853abb7c..bf269576 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,3 +1,9 @@ +2005-11-17 + + * libsylph/utils.c: set_startup_dir(): win32: スタートアップディレ + クトリを常に実行ファイルの場所と同じディレクトリにセットするように + した(他アプリから起動した場合にメッセージが翻訳されないのを修正)。 + 2005-11-17 * src/prefs_common_dialog.c: 引用色ダイアログをウィンドウのクローズ diff --git a/Makefile.am b/Makefile.am index a66438c0..d1545f26 100644 --- a/Makefile.am +++ b/Makefile.am @@ -18,7 +18,8 @@ EXTRA_DIST = config.rpath \ sylpheed-64x64.png \ autogen.sh \ makewin32.sh \ - mime.types + mime.types \ + sylpheed-mailto-protocol.reg BZIP2_ENV = diff --git a/libsylph/utils.c b/libsylph/utils.c index 0cb484f0..2d441163 100644 --- a/libsylph/utils.c +++ b/libsylph/utils.c @@ -1685,8 +1685,23 @@ static gchar *rc_dir = NULL; void set_startup_dir(void) { +#ifdef G_OS_WIN32 + if (!startup_dir) { + startup_dir = g_win32_get_package_installation_directory + (NULL, NULL); + if (startup_dir) { + if (g_chdir(startup_dir) < 0) { + FILE_OP_ERROR(startup_dir, "chdir"); + g_free(startup_dir); + startup_dir = g_get_current_dir(); + } + } else + startup_dir = g_get_current_dir(); + } +#else if (!startup_dir) startup_dir = g_get_current_dir(); +#endif } void set_rc_dir(const gchar *dir) -- cgit v1.2.3