Description: Cadencii: modified: #26362 patch has been accepted
 Fix user config file paths under Unix
Author: MGDesigner <mgdesigner@users.sourceforge.jp>
        kbinani <kbinani@users.sourceforge.jp>
Bug: http://sourceforge.jp/ticket/browse.php?group_id=4193&tid=26362
Origin: upstream, http://sourceforge.jp/projects/cadencii/scm/svn/commits/1744
Last-Update: 2012-06-27
Index: cadencii-3.3.9+svn20110818.r1732/Cadencii/Utility.cs
===================================================================
--- cadencii-3.3.9+svn20110818.r1732.orig/Cadencii/Utility.cs	2012-06-27 21:08:44.179054214 +0800
+++ cadencii-3.3.9+svn20110818.r1732/Cadencii/Utility.cs	2012-06-27 21:08:46.579009701 +0800
@@ -1389,8 +1389,15 @@
                 }
             } else {
                 String home = System.getenv( "HOME" );
-                if ( home != null ) {
-                    appdata = fsys.combine( fsys.combine( home, "Library" ), "Preferences" );
+                if ( home != null && osname != null ) {
+                    if ( osname.indexOf( "nix") >= 0 || osname.indexOf( "nux" ) >= 0 ) {
+                        // for Unix-like system which have desktop
+                        // based on freedesktop.org spec
+                        appdata = fsys.combine( fsys.combine( home, ".local" ), "share" );
+                    } else {
+                        // for MacOSX
+                        appdata = fsys.combine( fsys.combine( home, "Library" ), "Preferences" );
+                    }
                 }
             }
             String dir = fsys.combine( appdata, "Boare" );
@@ -1400,10 +1407,13 @@
             if ( !fsys.isDirectoryExists( dir ) ) {
                 PortUtil.createDirectory( dir );
             }
+
             String dir2 = fsys.combine( dir, CONFIG_DIR_NAME );
             if ( !fsys.isDirectoryExists( dir2 ) ) {
                 PortUtil.createDirectory( dir2 );
             }
+            sout.println( "Cadencii accesses ApplicationData at" + dir2 + "\n" );//Keep this line for debuging.
+	    
             return dir2;
         }
 
