summaryrefslogtreecommitdiff
path: root/indra/llinventory
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2009-07-23 23:41:12 +0000
committerLoren Shih <seraph@lindenlab.com>2009-07-23 23:41:12 +0000
commit363de6c3bc231183224aed8ba287efe450adb00b (patch)
treea75bd8d0449ab119f25db4b0024989cba0b71697 /indra/llinventory
parent80deb2a5358e5e912455a781b0d4aa5f29080e30 (diff)
svn merge -r 127683:128178 svn+ssh://svn.lindenlab.com/svn/linden/branches/avatar-pipeline/folder-links__merge__viewer-2.0.0.3-r127634 into svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-2.0.0-3
For DEV-36425 : Viewer merge for Folder Links and Types [VIEWER] Test plans - EXTERNAL * [ Test against a 1.30 server ] * Test various inventory operations -- move, copy, paste-as-link, etc. on both folders and inventory items. * Test ability to change user-created folder types. Test inventory operations on these folder types. Test plans - INTERNAL * Test against any inventory smoke tests. * See test plan in QAR-1643 for full FolderLinks&Types test plan.
Diffstat (limited to 'indra/llinventory')
-rw-r--r--indra/llinventory/llinventory.cpp2
-rw-r--r--indra/llinventory/llinventorytype.cpp77
-rw-r--r--indra/llinventory/llinventorytype.h7
3 files changed, 64 insertions, 22 deletions
diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp
index 597e19e7ea..2d507bd560 100644
--- a/indra/llinventory/llinventory.cpp
+++ b/indra/llinventory/llinventory.cpp
@@ -1624,7 +1624,7 @@ LLSD ll_create_sd_from_inventory_category(LLPointer<LLInventoryCategory> cat)
rv[INV_PARENT_ID_LABEL] = cat->getParentUUID();
rv[INV_NAME_LABEL] = cat->getName();
rv[INV_ASSET_TYPE_LABEL] = LLAssetType::lookup(cat->getType());
- if(LLAssetType::AT_NONE != cat->getPreferredType())
+ if(LLAssetType::lookupIsProtectedCategoryType(cat->getPreferredType()))
{
rv[INV_PREFERRED_TYPE_LABEL] =
LLAssetType::lookup(cat->getPreferredType());
diff --git a/indra/llinventory/llinventorytype.cpp b/indra/llinventory/llinventorytype.cpp
index 2dc229226f..a445466b26 100644
--- a/indra/llinventory/llinventorytype.cpp
+++ b/indra/llinventory/llinventorytype.cpp
@@ -44,9 +44,23 @@ static const std::string empty_string;
///----------------------------------------------------------------------------
struct InventoryEntry : public LLDictionaryEntry
{
- InventoryEntry(const std::string &name,
- const std::string &human_name,
- int num_asset_types = 0, ...);
+ InventoryEntry(const std::string &name, // unlike asset type names, not limited to 8 characters; need not match asset type names
+ const std::string &human_name, // for decoding to human readable form; put any and as many printable characters you want in each one.
+ int num_asset_types = 0, ...)
+ :
+ LLDictionaryEntry(name),
+ mHumanName(human_name)
+ {
+ va_list argp;
+ va_start(argp, num_asset_types);
+ // Read in local textures
+ for (U8 i=0; i < num_asset_types; i++)
+ {
+ LLAssetType::EType t = (LLAssetType::EType)va_arg(argp,int);
+ mAssetTypes.push_back(t);
+ }
+ }
+
const std::string mHumanName;
typedef std::vector<LLAssetType::EType> asset_vec_t;
asset_vec_t mAssetTypes;
@@ -115,25 +129,35 @@ DEFAULT_ASSET_FOR_INV_TYPE[LLAssetType::AT_COUNT] =
LLInventoryType::IT_GESTURE, // AT_GESTURE
LLInventoryType::IT_NONE, // AT_SIMSTATE
LLInventoryType::IT_FAVORITE, // AT_FAVORITE
+
LLInventoryType::IT_NONE, // AT_LINK
LLInventoryType::IT_NONE, // AT_LINK_FOLDER
-};
-InventoryEntry::InventoryEntry(const std::string &name,
- const std::string &human_name,
- int num_asset_types, ...) :
- LLDictionaryEntry(name),
- mHumanName(human_name)
-{
- va_list argp;
- va_start(argp, num_asset_types);
- // Read in local textures
- for (U8 i=0; i < num_asset_types; i++)
- {
- LLAssetType::EType t = (LLAssetType::EType)va_arg(argp,int);
- mAssetTypes.push_back(t);
- }
-}
+ LLInventoryType::IT_CATEGORY, // AT_ENSEMBLE
+ LLInventoryType::IT_CATEGORY, // AT_ENSEMBLE
+ LLInventoryType::IT_CATEGORY, // AT_ENSEMBLE
+ LLInventoryType::IT_CATEGORY, // AT_ENSEMBLE
+ LLInventoryType::IT_CATEGORY, // AT_ENSEMBLE
+ LLInventoryType::IT_CATEGORY, // AT_ENSEMBLE
+ LLInventoryType::IT_CATEGORY, // AT_ENSEMBLE
+ LLInventoryType::IT_CATEGORY, // AT_ENSEMBLE
+ LLInventoryType::IT_CATEGORY, // AT_ENSEMBLE
+ LLInventoryType::IT_CATEGORY, // AT_ENSEMBLE
+ LLInventoryType::IT_CATEGORY, // AT_ENSEMBLE
+ LLInventoryType::IT_CATEGORY, // AT_ENSEMBLE
+ LLInventoryType::IT_CATEGORY, // AT_ENSEMBLE
+ LLInventoryType::IT_CATEGORY, // AT_ENSEMBLE
+ LLInventoryType::IT_CATEGORY, // AT_ENSEMBLE
+ LLInventoryType::IT_CATEGORY, // AT_ENSEMBLE
+ LLInventoryType::IT_CATEGORY, // AT_ENSEMBLE
+ LLInventoryType::IT_CATEGORY, // AT_ENSEMBLE
+ LLInventoryType::IT_CATEGORY, // AT_ENSEMBLE
+ LLInventoryType::IT_CATEGORY, // AT_ENSEMBLE
+
+ LLInventoryType::IT_CATEGORY, // AT_CURRENT_OUTFIT
+ LLInventoryType::IT_CATEGORY, // AT_OUTFIT
+ LLInventoryType::IT_CATEGORY, // AT_MY_OUTFITS
+};
// static
const std::string &LLInventoryType::lookup(EType type)
@@ -173,6 +197,21 @@ LLInventoryType::EType LLInventoryType::defaultForAssetType(LLAssetType::EType a
}
}
+
+// add any types that we don't want the user to be able to change permissions on.
+// static
+bool LLInventoryType::cannotRestrictPermissions(LLInventoryType::EType type)
+{
+ switch(type)
+ {
+ case IT_CALLINGCARD:
+ case IT_LANDMARK:
+ return true;
+ default:
+ return false;
+ }
+}
+
bool inventory_and_asset_types_match(LLInventoryType::EType inventory_type,
LLAssetType::EType asset_type)
{
diff --git a/indra/llinventory/llinventorytype.h b/indra/llinventory/llinventorytype.h
index 1aad90d51b..14b28bfe4b 100644
--- a/indra/llinventory/llinventorytype.h
+++ b/indra/llinventory/llinventorytype.h
@@ -83,10 +83,13 @@ public:
// return the default inventory for the given asset type.
static EType defaultForAssetType(LLAssetType::EType asset_type);
+ // true if this type cannot have restricted permissions.
+ static bool cannotRestrictPermissions(EType type);
+
private:
// don't instantiate or derive one of these objects
- LLInventoryType() {}
- ~LLInventoryType() {}
+ LLInventoryType( void );
+ ~LLInventoryType( void );
};
// helper function that returns true if inventory type and asset type