diff options
Diffstat (limited to 'indra/newview/llfriendcard.cpp')
-rw-r--r-- | indra/newview/llfriendcard.cpp | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/indra/newview/llfriendcard.cpp b/indra/newview/llfriendcard.cpp index ac060cef15..6f069cca17 100644 --- a/indra/newview/llfriendcard.cpp +++ b/indra/newview/llfriendcard.cpp @@ -33,6 +33,7 @@ #include "llviewerprecompiledheaders.h" #include "llinventory.h" +#include "llinventoryfunctions.h" #include "llinventoryobserver.h" #include "lltrans.h" @@ -44,24 +45,28 @@ // Constants; -static const std::string INVENTORY_STRING_FRIENDS_SUBFOLDER = "InvFolder Friends"; -static const std::string INVENTORY_STRING_FRIENDS_ALL_SUBFOLDER = "InvFolder All"; +static const std::string INVENTORY_STRING_FRIENDS_SUBFOLDER = "Friends"; +static const std::string INVENTORY_STRING_FRIENDS_ALL_SUBFOLDER = "All"; // helper functions -// NOTE: Usage of LLTrans::getString(); in next two functions to set localized -// folders' names is caused by a hack in the LLFolderViewItem::refreshFromListener() -// method for protected asset types. -// So, localized names will be got from the strings with "InvFolder LABEL_NAME" -// in the strings.xml +// NOTE: For now Friends & All folders are created as protected folders of the LLFolderType::FT_CALLINGCARD type. +// So, their names will be processed in the LLFolderViewItem::refreshFromListener() to be localized +// using "InvFolder LABEL_NAME" as LLTrans::findString argument. + +// We must use in this file their hard-coded names to ensure found them on different locales. EXT-5829. +// These hard-coded names will be stored in InventoryItems but shown localized in FolderViewItems + +// If hack in the LLFolderViewItem::refreshFromListener() to localize protected folder is removed +// or these folders are not protected these names should be localized in another place/way. inline const std::string get_friend_folder_name() { - return LLTrans::getString(INVENTORY_STRING_FRIENDS_SUBFOLDER); + return INVENTORY_STRING_FRIENDS_SUBFOLDER; } inline const std::string get_friend_all_subfolder_name() { - return LLTrans::getString(INVENTORY_STRING_FRIENDS_ALL_SUBFOLDER); + return INVENTORY_STRING_FRIENDS_ALL_SUBFOLDER; } void move_from_to_arrays(LLInventoryModel::cat_array_t& from, LLInventoryModel::cat_array_t& to) @@ -318,7 +323,7 @@ void LLFriendCardsManager::collectFriendsLists(folderid_buddies_map_t& folderBud if (NULL == items) continue; - std::vector<LLUUID> buddyUUIDs; + uuid_vec_t buddyUUIDs; for (itBuddy = items->begin(); itBuddy != items->end(); ++itBuddy) { buddyUUIDs.push_back((*itBuddy)->getCreatorUUID()); @@ -350,9 +355,9 @@ const LLUUID& LLFriendCardsManager::findFriendAllSubfolderUUIDImpl() const return findChildFolderUUID(friendFolderUUID, friendAllSubfolderName); } -const LLUUID& LLFriendCardsManager::findChildFolderUUID(const LLUUID& parentFolderUUID, const std::string& localizedName) const +const LLUUID& LLFriendCardsManager::findChildFolderUUID(const LLUUID& parentFolderUUID, const std::string& nonLocalizedName) const { - LLNameCategoryCollector matchFolderFunctor(localizedName); + LLNameCategoryCollector matchFolderFunctor(nonLocalizedName); return get_folder_uuid(parentFolderUUID, matchFolderFunctor); } @@ -405,10 +410,10 @@ void LLFriendCardsManager::fetchAndCheckFolderDescendents(const LLUUID& folder_i // This instance will be deleted in LLInitialFriendCardsFetch::done(). LLInitialFriendCardsFetch* fetch = new LLInitialFriendCardsFetch(cb); - LLInventoryFetchDescendentsObserver::folder_ref_t folders; + uuid_vec_t folders; folders.push_back(folder_id); - fetch->fetchDescendents(folders); + fetch->fetch(folders); if(fetch->isEverythingComplete()) { // everything is already here - call done. |