//static
void LLFloaterTeleportHistory::loadFile(const std::string &file_name)
{
    LLFloaterTeleportHistory *pFloaterHistory = LLFloaterTeleportHistory::findInstance();
    if(!pFloaterHistory)
        return;

    LLScrollListCtrl* pScrollList = pFloaterHistory->mPlacesList;
    if(!pScrollList)
        return;

    std::string temp_str(gDirUtilp->getLindenUserDir() + gDirUtilp->getDirDelimiter() + file_name);

    llifstream file(temp_str);

    if (file.is_open())
    {
        LL_INFOS() << "Loading "<< file_name << " file at " << temp_str << LL_ENDL;
        LLSD data;
        LLSDSerialize::fromXML(data, file);
        if (data.isUndefined())
        {
            LL_INFOS() << "file missing, ill-formed, "
                       "or simply undefined; not reading the"
                       " file" << LL_ENDL;
        }
        else
        {
            const S32 max_entries = gSavedSettings.getS32("TeleportHistoryMaxEntries");
            const S32 num_entries = llmin(max_entries,(const S32)data.size());
            pScrollList->clear();
            for(S32 i = 0; i < num_entries; i++) //Lower entry = newer
            {
                pScrollList->addElement(data[i], ADD_BOTTOM);
            }
            pScrollList->deselectAllItems(TRUE);
            pFloaterHistory->mID = pScrollList->getItemCount();
            pFloaterHistory->setButtonsEnabled(FALSE);
        }
    }
}