summaryrefslogtreecommitdiff
path: root/indra/newview/llpanellandmarkinfo.cpp
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2010-03-29 16:55:22 -0700
committerJames Cook <james@lindenlab.com>2010-03-29 16:55:22 -0700
commitecc2c726502448076295254714c0bfa8c0074f25 (patch)
tree6a9434c540f7b5ea7bca326df1a420e4a0a99cc4 /indra/newview/llpanellandmarkinfo.cpp
parentd2f9e34598621f1dabad15025417efd6b81dddf0 (diff)
parentac103403160e87bb6b40ac3e032d077a3381da8e (diff)
Merge latest viewer-hotfix, approximately equal to Viewer 2.0 final
Diffstat (limited to 'indra/newview/llpanellandmarkinfo.cpp')
-rw-r--r--indra/newview/llpanellandmarkinfo.cpp35
1 files changed, 27 insertions, 8 deletions
diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp
index e376fe4c32..702d9a55ab 100644
--- a/indra/newview/llpanellandmarkinfo.cpp
+++ b/indra/newview/llpanellandmarkinfo.cpp
@@ -390,25 +390,44 @@ std::string LLPanelLandmarkInfo::getFullFolderName(const LLViewerInventoryCatego
if (cat)
{
name = cat->getName();
-
- // translate category name, if it's right below the root
- // FIXME: it can throw notification about non existent string in strings.xml
- if (cat->getParentUUID().notNull() && cat->getParentUUID() == gInventory.getRootFolderID())
- {
- LLTrans::findString(name, "InvFolder " + name);
- }
+ parent_id = cat->getParentUUID();
+ bool is_under_root_category = parent_id == gInventory.getRootFolderID();
// we don't want "My Inventory" to appear in the name
- while ((parent_id = cat->getParentUUID()).notNull() && parent_id != gInventory.getRootFolderID())
+ while ((parent_id = cat->getParentUUID()).notNull())
{
cat = gInventory.getCategory(parent_id);
llassert(cat);
if (cat)
{
+ if (is_under_root_category || cat->getParentUUID() == gInventory.getRootFolderID())
+ {
+ std::string localized_name;
+ if (is_under_root_category)
+ {
+ // translate category name, if it's right below the root
+ // FIXME: it can throw notification about non existent string in strings.xml
+ bool is_found = LLTrans::findString(localized_name, "InvFolder " + name);
+ name = is_found ? localized_name : name;
+ }
+ else
+ {
+ // FIXME: it can throw notification about non existent string in strings.xml
+ bool is_found = LLTrans::findString(localized_name, "InvFolder " + cat->getName());
+
+ // add translated category name to folder's full name
+ name = (is_found ? localized_name : cat->getName()) + "/" + name;
+ }
+
+ break;
+ }
+ else
+ {
name = cat->getName() + "/" + name;
}
}
}
+ }
return name;
}