comparison src/name/blackcap/clipman/Files.kt @ 52:c8ec2d7af3fb

Correct bad APPDATA code.
author davidb
date Tue, 14 Apr 2020 15:17:45 -0700
parents 19d9da731c43
children 88056f373a94
comparison
equal deleted inserted replaced
51:e8d2a7e6f6c7 52:c8ec2d7af3fb
41 /* file names */ 41 /* file names */
42 42
43 private val SHORTNAME = "clipman" 43 private val SHORTNAME = "clipman"
44 private val LONGNAME = "name.blackcap." + SHORTNAME 44 private val LONGNAME = "name.blackcap." + SHORTNAME
45 private val HOME = System.getenv("HOME") 45 private val HOME = System.getenv("HOME")
46 private val APPDATA = System.getenv("APPDATA")
47 private val PF_DIR = when (OS.type) { 46 private val PF_DIR = when (OS.type) {
48 OS.MAC -> joinPath(HOME, "Library", "Application Support", LONGNAME) 47 OS.MAC -> joinPath(HOME, "Library", "Application Support", LONGNAME)
49 OS.WINDOWS -> joinPath(APPDATA, "Roaming", LONGNAME) 48 OS.WINDOWS -> joinPath(System.getenv("APPDATA"), LONGNAME)
50 else -> joinPath(HOME, "." + SHORTNAME) 49 else -> joinPath(HOME, "." + SHORTNAME)
51 } 50 }
52 private val LF_DIR = when (OS.type) { 51 private val LF_DIR = when (OS.type) {
53 OS.MAC -> joinPath(HOME, "Library", "Application Support", LONGNAME) 52 OS.MAC -> joinPath(HOME, "Library", "Application Support", LONGNAME)
54 OS.WINDOWS -> joinPath(APPDATA, "Local", LONGNAME) 53 OS.WINDOWS -> joinPath(System.getenv("LOCALAPPDATA"), LONGNAME)
55 else -> joinPath(HOME, "." + SHORTNAME) 54 else -> joinPath(HOME, "." + SHORTNAME)
56 } 55 }
57 val PROP_FILE = File(PF_DIR, SHORTNAME + ".properties") 56 val PROP_FILE = File(PF_DIR, SHORTNAME + ".properties")
58 val LOG_FILE = File(LF_DIR, SHORTNAME + ".log") 57 val LOG_FILE = File(LF_DIR, SHORTNAME + ".log")
59 58