Skip to content
Snippets Groups Projects
Commit 0e780c9b authored by Mike Antipov's avatar Mike Antipov
Browse files

Fixed major subtask (bug) EXT-5829 (Switching language in preferences creates...

Fixed major subtask (bug) EXT-5829 (Switching language in preferences creates new calling cards folders for each language)
- Reason: Inventory folders (Friends & All) were created WITH localized names.
- Fix: create these folders with hard-coded name (like other protected Inventory Folders). They are localized in FolderView

--HG--
branch : product-engine
parent f7624035
No related branches found
No related tags found
No related merge requests found
......@@ -44,24 +44,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)
......@@ -350,9 +354,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);
}
......
......@@ -120,7 +120,7 @@ class LLFriendCardsManager
return (mBuddyIDSet.end() != mBuddyIDSet.find(avatarID));
}
const LLUUID& findChildFolderUUID(const LLUUID& parentFolderUUID, const std::string& localizedName) const;
const LLUUID& findChildFolderUUID(const LLUUID& parentFolderUUID, const std::string& nonLocalizedName) const;
const LLUUID& findFriendFolderUUIDImpl() const;
const LLUUID& findFriendAllSubfolderUUIDImpl() const;
const LLUUID& findFriendCardInventoryUUIDImpl(const LLUUID& avatarID);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment