2012-05-25 09:25:44 +02:00
|
|
|
--- src/ime-core/imi_options.cpp~ 2012-05-13 22:55:19.000000000 -0500
|
|
|
|
+++ src/ime-core/imi_options.cpp 2012-05-13 23:08:27.566965023 -0500
|
|
|
|
@@ -73,12 +73,15 @@ CSimplifiedChinesePolicy::loadResources(
|
2011-11-11 16:38:55 +01:00
|
|
|
|
|
|
|
if (!m_user_data_dir.size()) {
|
|
|
|
char path[256];
|
2012-05-25 09:25:44 +02:00
|
|
|
- const char *home = getenv("HOME");
|
|
|
|
- snprintf(path,
|
|
|
|
- sizeof(path),
|
|
|
|
- "%s/%s",
|
|
|
|
- home,
|
|
|
|
- SUNPINYIN_USERDATA_DIR_PREFIX);
|
|
|
|
+ const char *home = getenv("XDG_CONFIG_HOME");
|
|
|
|
+ if (home == NULL)
|
|
|
|
+ snprintf(path, sizeof(path),
|
|
|
|
+ "%s/.config/%s", getenv("HOME"),
|
|
|
|
+ SUNPINYIN_USERDATA_DIR_PREFIX);
|
2011-11-11 16:38:55 +01:00
|
|
|
+ else
|
2012-05-25 09:25:44 +02:00
|
|
|
+ snprintf(path, sizeof(path),
|
|
|
|
+ "%s/%s", home,
|
|
|
|
+ SUNPINYIN_USERDATA_DIR_PREFIX);
|
2011-11-11 16:38:55 +01:00
|
|
|
m_user_data_dir = path;
|
|
|
|
}
|
|
|
|
|
|
|
|
diff -uNr src/ime-core/imi_options.h src/ime-core/imi_options.h
|
|
|
|
--- src/ime-core/imi_options.h 2010-09-22 13:14:35.883000000 +0800
|
|
|
|
+++ src/ime-core/imi_options.h 2010-09-22 13:15:20.760000002 +0800
|
|
|
|
@@ -50,7 +50,7 @@
|
|
|
|
#include "pinyin/shuangpin_seg.h"
|
|
|
|
|
|
|
|
#ifndef SUNPINYIN_USERDATA_DIR_PREFIX
|
|
|
|
-#define SUNPINYIN_USERDATA_DIR_PREFIX ".sunpinyin"
|
|
|
|
+#define SUNPINYIN_USERDATA_DIR_PREFIX "sunpinyin"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct CSimplifiedChinesePolicy : public IConfigurable
|
2012-05-25 09:25:44 +02:00
|
|
|
|