void CMimAPI::InitPaths() { m_szProfilePath[0] = 0; m_szSkinsPath[0] = 0; m_szSavedAvatarsPath[0] = 0; const TCHAR *szUserdataDir = getUserDir(); mir_sntprintf(m_szProfilePath, MAX_PATH, _T("%stabSRMM"), szUserdataDir); if (ServiceExists(MS_FOLDERS_REGISTER_PATH)) { lstrcpyn(m_szChatLogsPath, _T("%miranda_logpath%"), MAX_PATH); lstrcpyn(m_szSkinsPath, _T("%miranda_path%\\Skins\\TabSRMM"), MAX_PATH); } else { lstrcpyn(m_szChatLogsPath, VARST(_T("%miranda_logpath%")), MAX_PATH); lstrcpyn(m_szSkinsPath, VARST(_T("%miranda_path%\\Skins\\TabSRMM")), MAX_PATH); } Utils::ensureTralingBackslash(m_szChatLogsPath); replaceStrT(g_Settings.pszLogDir, m_szChatLogsPath); Utils::ensureTralingBackslash(m_szSkinsPath); mir_sntprintf(m_szSavedAvatarsPath, MAX_PATH, _T("%s\\Saved Contact Pictures"), m_szProfilePath); }
std::string PathRegistry::getDataDir() { std::stringstream ss; ss << getUserDir() << "/data"; return ss.str(); }
bool LLWaterParamManager::removeParamSet(const std::string& name, bool delete_from_disk) { // remove from param list preset_map_t::iterator it = mParamList.find(name); if (it == mParamList.end()) { LL_WARNS("WindLight") << "No water preset named " << name << LL_ENDL; return false; } mParamList.erase(it); // remove from file system if requested if (delete_from_disk) { // <FS:Ansariel> FIRE-10861: Fix Windlight settings order //if (gDirUtilp->deleteFilesInDir(getUserDir(), LLURI::escape(name) + ".xml") < 1) if (gDirUtilp->deleteFilesInDir(getUserDir(), escapeString(name) + ".xml") < 1) // </FS:Ansariel> { LL_WARNS("WindLight") << "Error removing water preset " << name << " from disk" << LL_ENDL; } } // signal interested parties mPresetListChangeSignal(); return true; }
void LLWLParamManager::loadAllPresets() { // First, load system (coming out of the box) sky presets. loadPresetsFromDir(getSysDir()); // Then load user presets. Note that user day presets will modify any system ones already loaded. loadPresetsFromDir(getUserDir()); }
std::string PathRegistry::getSymbolFile() { std::stringstream ss; ss << getUserDir() << "/" << s_symbolFile; return ss.str(); }
std::string PathRegistry::getPreferenceFile() { std::stringstream ss; ss << getUserDir() << "/" << s_preferenceFile; return ss.str(); }
void CMimAPI::InitPaths() { m_szProfilePath[0] = 0; m_szSkinsPath[0] = 0; m_szSavedAvatarsPath[0] = 0; const TCHAR *szUserdataDir = getUserDir(); mir_sntprintf(m_szProfilePath, MAX_PATH, _T("%stabSRMM"), szUserdataDir); mir_sntprintf(m_szChatLogsPath, MAX_PATH, _T("%sLogs\\"), szUserdataDir); mir_sntprintf(m_szSkinsPath, MAX_PATH, _T("%s\\skins\\"), m_szProfilePath); mir_sntprintf(m_szSavedAvatarsPath, MAX_PATH, _T("%s\\Saved Contact Pictures"), m_szProfilePath); }
void LLWLParamManager::savePreset(LLWLParamKey key) { llassert(key.scope == LLEnvKey::SCOPE_LOCAL && !key.name.empty()); // make an empty llsd LLSD paramsData(LLSD::emptyMap()); std::string pathName(getUserDir() + LLWeb::curlEscape(key.name) + ".xml"); // fill it with LLSD windlight params paramsData = mParamList[key].getAll(); // write to file llofstream presetsXML(pathName); LLPointer<LLSDFormatter> formatter = new LLSDXMLFormatter(); formatter->format(paramsData, presetsXML, LLSDFormatter::OPTIONS_PRETTY); presetsXML.close(); propagateParameters(); }
void LLWaterParamManager::savePreset(const std::string & name) { llassert(!name.empty()); // make an empty llsd LLSD paramsData(LLSD::emptyMap()); std::string pathName(getUserDir() + LLURI::escape(name) + ".xml"); // fill it with LLSD windlight params paramsData = mParamList[name].getAll(); // write to file llofstream presetsXML(pathName.c_str()); LLPointer<LLSDFormatter> formatter = new LLSDXMLFormatter(); formatter->format(paramsData, presetsXML, LLSDFormatter::OPTIONS_PRETTY); presetsXML.close(); propagateParameters(); }
bool LLWLParamManager::removeParamSet(const LLWLParamKey& key, bool delete_from_disk) { // *NOTE: Removing a sky preset invalidates day cycles that refer to it. if (key.scope == LLEnvKey::SCOPE_REGION) { llwarns << "Removing region skies not supported" << llendl; llassert(key.scope == LLEnvKey::SCOPE_LOCAL); return false; } // remove from param list std::map<LLWLParamKey, LLWLParamSet>::iterator it = mParamList.find(key); if (it == mParamList.end()) { LL_WARNS("WindLight") << "No sky preset named " << key.name << LL_ENDL; return false; } mParamList.erase(it); mDay.removeReferencesTo(key); // remove from file system if requested if (delete_from_disk) { std::string path_name(getUserDir()); std::string escaped_name = LLWeb::curlEscape(key.name); if(gDirUtilp->deleteFilesInDir(path_name, escaped_name + ".xml") < 1) { LL_WARNS("WindLight") << "Error removing sky preset " << key.name << " from disk" << LL_ENDL; } } // signal interested parties mPresetListChangeSignal(); return true; }
// Returns the path to the cache directory. Note that subdirectories may need to be created for specific caches. QString StelFileMgr::getCacheDir() { return (QStandardPaths::standardLocations(QStandardPaths::CacheLocation) << getUserDir() + "/cache")[0]; }
w_instance NativeProperties_init(JNIEnv *env, w_instance classSystem) { w_thread thread = JNIEnv2w_thread(env); char *utf8; w_string s; w_fifo fifo; w_int i; prop_hashtable = ht_create("hashtable:native system properties", 17, ht_stringHash, ht_stringCompare, 0, 0); woempa(1, "Created prop_hashtable\n"); s = cstring2String(UNICODE_SUBSETS, strlen(UNICODE_SUBSETS)); ht_write(prop_hashtable, (w_word)cstring2String("mika.unicode.subsets", 20), (w_word)s); woempa(1, "Set %s -> %w\n", "mika.unicode.subsets", s); utf8 = getInstallationDir(); s = utf2String(utf8, strlen(utf8)); ht_write(prop_hashtable, (w_word)utf2String("java.home", 9), (w_word)s); woempa(1, "Set %s -> %w\n", "java.home", s); utf8 = getExtensionDir(); s = utf2String(utf8, strlen(utf8)); ht_write(prop_hashtable, (w_word)utf2String("java.ext.dirs", 13), (w_word)s); woempa(1, "Set %s -> %w\n", "java.ext.dirs", s); utf8 = getLibraryPath(); s = utf2String(utf8, strlen(utf8)); ht_write(prop_hashtable, (w_word)utf2String("java.library.path", 17), (w_word)s); woempa(1, "Set %s -> %w\n", "java.library.path", s); s = utf2String(VERSION_STRING, strlen(VERSION_STRING)); ht_write(prop_hashtable, (w_word)utf2String("mika.version", 12), (w_word)s); woempa(1, "Set %s -> %w\n", "mika.version", s); s = utf2String(WONKA_INFO, strlen(WONKA_INFO)); ht_write(prop_hashtable, (w_word)utf2String("mika.vm.options", 15), (w_word)s); woempa(1, "Set %s -> %w\n", "mika.vm.options", s); s = utf2String(DEFAULT_HEAP_SIZE, strlen(DEFAULT_HEAP_SIZE)); ht_write(prop_hashtable, (w_word)utf2String("mika.default.heap.size", 22), (w_word)s); woempa(1, "Set %s -> %w\n", "mika.default.heap.size", s); s = utf2String(AWT_INFO, strlen(AWT_INFO)); ht_write(prop_hashtable, (w_word)utf2String("mika.awt.options", 16), (w_word)s); woempa(1, "Set %s -> %w\n", "mika.awt.options", s); #ifdef O4P s = utf2String(O4P_INFO, strlen(O4P_INFO)); ht_write(prop_hashtable, (w_word)utf2String("mika.o4p.options", 16), (w_word)s); woempa(1, "Set %s -> %w\n", "mika.o4p.options", s); #endif #ifdef OSWALD s = utf2String(OSWALD_INFO, strlen(OSWALD_INFO)); ht_write(prop_hashtable, (w_word)utf2String("mika.oswald.options", 19), (w_word)s); woempa(1, "Set %s -> %w\n", "mika.oswald.options", s); #endif s = utf2String(BUILD_HOST, strlen(BUILD_HOST)); ht_write(prop_hashtable, (w_word)utf2String("mika.build.host", 15), (w_word)s); woempa(1, "Set %s -> %w\n", "mika.build.host", s); utf8 = __DATE__ " " __TIME__; s = utf2String(utf8, strlen(utf8)); ht_write(prop_hashtable, (w_word)utf2String("mika.build.time", 15), (w_word)s); woempa(1, "Set %s -> %w\n", "mika.build.time", s); utf8 = getOSName(); s = utf2String(utf8, strlen(utf8)); ht_write(prop_hashtable, (w_word)utf2String("os.name", 7), (w_word)s); woempa(1, "Set %s -> %w\n", "os.name", s); utf8 = getOSVersion(); s = utf2String(utf8, strlen(utf8)); ht_write(prop_hashtable, (w_word)utf2String("os.version", 10), (w_word)s); woempa(1, "Set %s -> %w\n", "os.version", s); utf8 = getOSArch(); s = utf2String(utf8, strlen(utf8)); ht_write(prop_hashtable, (w_word)utf2String("os.arch", 7), (w_word)s); woempa(1, "Set %s -> %w\n", "os.arch", s); utf8 = getUserName(); s = utf2String(utf8, strlen(utf8)); ht_write(prop_hashtable, (w_word)utf2String("user.name", 9), (w_word)s); woempa(1, "Set %s -> %w\n", "user.name", s); utf8 = getUserHome(); s = utf2String(utf8, strlen(utf8)); ht_write(prop_hashtable, (w_word)utf2String("user.home", 9), (w_word)s); woempa(1, "Set %s -> %w\n", "user.home", s); utf8 = getUserDir(); s = utf2String(utf8, strlen(utf8)); ht_write(prop_hashtable, (w_word)utf2String("user.dir", 8), (w_word)s); woempa(1, "Set %s -> %w\n", "user.dir", s); utf8 = getUserLanguage(); s = utf2String(utf8, strlen(utf8)); ht_write(prop_hashtable, (w_word)utf2String("user.language", 13), (w_word)s); woempa(1, "Set %s -> %w\n", "user.language", s); utf8 = "Mika " VERSION_STRING; s = utf2String(utf8, strlen(utf8)); ht_write(prop_hashtable, (w_word)utf2String("java.runtime.name", 17), (w_word)s); woempa(1, "Set %s -> %w\n", "java.runtime.name", s); enterUnsafeRegion(thread); keyArray = allocArrayInstance_1d(JNIEnv2w_thread(env), clazzArrayOf_String, prop_hashtable->occupancy); enterSafeRegion(thread); fifo = ht_list_keys_no_lock(prop_hashtable); i = 0; while ((s = (w_string)getFifo(fifo))) { woempa(7, "keyArray[%d] = %w\n", i, s); setArrayReferenceField(keyArray, getStringInstance(s), i); ++i; } return keyArray; }