void EmeraldDicDownloader::completedRaw(U32 status, const std::string& reason, const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer) { if (status < 200 || status >= 300) { return; } LLBufferStream istr(channels, buffer.get()); std::string dicpath(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "dictionaries", name.c_str())); llofstream ostr(dicpath, std::ios::binary); while (istr.good() && ostr.good()) { ostr << istr.rdbuf(); } ostr.close(); if (panel) { if (panel->empanel) { panel->empanel->refresh(); } else { llinfos << "completedRaw(): No empanel to refresh()!" << llendl; } panel->close(); } }
void lggHunSpell_Wrapper::addDictionary(std::string additionalDictionary) { if(!myHunspell)return; if(additionalDictionary=="")return; //expecting a full name here std::string dicpath( gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "dictionaries", std::string(fullName2DictName(additionalDictionary)+".dic") ).c_str()); if(gDirUtilp->fileExists(dicpath)) { llinfos << "Adding additional dictionary -> " << dicpath.c_str() << llendl; myHunspell->add_dic(dicpath.c_str()); } }