head	1.2;
access;
symbols
	RELEASE_8_3_0:1.1
	RELEASE_9_0_0:1.1;
locks; strict;
comment	@# @;


1.2
date	2012.05.25.07.25.44;	author wen;	state Exp;
branches;
next	1.1;

1.1
date	2011.11.11.15.38.55;	author clsung;	state Exp;
branches;
next	;


desc
@@


1.2
log
@- Update to 2.0.4rc1

PR:		167863
Submitted by:	Zhihao Yuan <lichray@@gmail.com>
@
text
@--- 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(
 
     if (!m_user_data_dir.size()) {
         char path[256];
-        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);
+        else
+            snprintf(path, sizeof(path),
+                     "%s/%s", home,
+                     SUNPINYIN_USERDATA_DIR_PREFIX);
         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

@


1.1
log
@- bump PORTREVISION
- Make chinese/sunpinyin 2.0.4-compatible, XDG-compatible, etc.
1. patch-2.0.4-compatible
sunpinyin-2.0.4 is not released, but I'm porting a front-end which uses several changes from the newer version. This patch is enough.

2. patch-xdg
Change the config dir from .sunpinyin to .config/sunpinyin. It's safe because we have no front-ends in ports tree, so no one has these configured :)

3. patch-src...
Remove the unneeded and repeated message on terminal.

PR:		ports/162465
Submitted by:	maintainer (Zhihao Yuan)
Feature safe:	yes
@
text
@d1 3
a3 4
diff -uNr src/ime-core/imi_options.cpp src/ime-core/imi_options.cpp
--- src/ime-core/imi_options.cpp	2010-09-22 13:14:32.876000000 +0800
+++ src/ime-core/imi_options.cpp	2010-09-22 13:21:48.181000000 +0800
@@@@ -73,8 +73,11 @@@@
d7 11
a17 5
-        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);
d19 3
a21 1
+            snprintf (path, sizeof(path), "%s/%s", home, SUNPINYIN_USERDATA_DIR_PREFIX);
d37 1
@

