summaryrefslogtreecommitdiff
path: root/indra/llinventory/llinventory.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2010-04-05 15:02:36 -0400
committerLoren Shih <seraph@lindenlab.com>2010-04-05 15:02:36 -0400
commit2eba9819df8c473137b0f45d5873794362b14562 (patch)
tree000a2951c8f2724d17deb2beb6f8db9e76891b78 /indra/llinventory/llinventory.cpp
parent9bfc1c3b1060f15990bba218795a1ef6009d1535 (diff)
EXT-6703 : LLInventory.h cleanup and create new LLInventoryDefines
Took out enums and flags from LLInventory into LLInventoryDefines Did a bunch of header file reformatting for LLInventory.h Change made to simulator files as well.
Diffstat (limited to 'indra/llinventory/llinventory.cpp')
-rw-r--r--indra/llinventory/llinventory.cpp40
1 files changed, 16 insertions, 24 deletions
diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp
index d665deb605..e123d255c4 100644
--- a/indra/llinventory/llinventory.cpp
+++ b/indra/llinventory/llinventory.cpp
@@ -31,10 +31,10 @@
*/
#include "linden_common.h"
-
#include "llinventory.h"
#include "lldbstrings.h"
+#include "llinventorydefines.h"
#include "llxorcipher.h"
#include "llsd.h"
#include "message.h"
@@ -43,9 +43,8 @@
#include "llsdutil.h"
///----------------------------------------------------------------------------
-/// exported functions
+/// Exported functions
///----------------------------------------------------------------------------
-
static const std::string INV_ITEM_ID_LABEL("item_id");
static const std::string INV_FOLDER_ID_LABEL("folder_id");
static const std::string INV_PARENT_ID_LABEL("parent_id");
@@ -64,15 +63,14 @@ static const std::string INV_CREATION_DATE_LABEL("created_at");
// key used by agent-inventory-service
static const std::string INV_ASSET_TYPE_LABEL_WS("type_default");
static const std::string INV_FOLDER_ID_LABEL_WS("category_id");
+
///----------------------------------------------------------------------------
/// Local function declarations, constants, enums, and typedefs
///----------------------------------------------------------------------------
-
const U8 TASK_INVENTORY_ITEM_KEY = 0;
const U8 TASK_INVENTORY_ASSET_KEY = 1;
const LLUUID MAGIC_ID("3c115e51-04f4-523c-9fa6-98aff1034730");
-
///----------------------------------------------------------------------------
/// Class LLInventoryObject
@@ -99,7 +97,7 @@ LLInventoryObject::LLInventoryObject() :
{
}
-LLInventoryObject::~LLInventoryObject( void )
+LLInventoryObject::~LLInventoryObject()
{
}
@@ -458,11 +456,18 @@ void LLInventoryItem::setCreationDate(time_t creation_date_utc)
mCreationDate = creation_date_utc;
}
+// Currently only used in the Viewer to handle calling cards
+// where the creator is actually used to store the target.
+void LLInventoryItem::setCreator(const LLUUID& creator)
+{
+ mPermissions.setCreator(creator);
+}
+
void LLInventoryItem::accumulatePermissionSlamBits(const LLInventoryItem& old_item)
{
// Remove any pre-existing II_FLAGS_PERM_OVERWRITE_MASK flags
// because we now detect when they should be set.
- setFlags( old_item.getFlags() | (getFlags() & ~(LLInventoryItem::II_FLAGS_PERM_OVERWRITE_MASK)) );
+ setFlags( old_item.getFlags() | (getFlags() & ~(LLInventoryItemFlags::II_FLAGS_PERM_OVERWRITE_MASK)) );
// Enforce the PERM_OVERWRITE flags for any masks that are different
// but only for AT_OBJECT's since that is the only asset type that can
@@ -473,20 +478,20 @@ void LLInventoryItem::accumulatePermissionSlamBits(const LLInventoryItem& old_it
U32 flags_to_be_set = 0;
if(old_permissions.getMaskNextOwner() != getPermissions().getMaskNextOwner())
{
- flags_to_be_set |= LLInventoryItem::II_FLAGS_OBJECT_SLAM_PERM;
+ flags_to_be_set |= LLInventoryItemFlags::II_FLAGS_OBJECT_SLAM_PERM;
}
if(old_permissions.getMaskEveryone() != getPermissions().getMaskEveryone())
{
- flags_to_be_set |= LLInventoryItem::II_FLAGS_OBJECT_PERM_OVERWRITE_EVERYONE;
+ flags_to_be_set |= LLInventoryItemFlags::II_FLAGS_OBJECT_PERM_OVERWRITE_EVERYONE;
}
if(old_permissions.getMaskGroup() != getPermissions().getMaskGroup())
{
- flags_to_be_set |= LLInventoryItem::II_FLAGS_OBJECT_PERM_OVERWRITE_GROUP;
+ flags_to_be_set |= LLInventoryItemFlags::II_FLAGS_OBJECT_PERM_OVERWRITE_GROUP;
}
LLSaleInfo old_sale_info = old_item.getSaleInfo();
if(old_sale_info != getSaleInfo())
{
- flags_to_be_set |= LLInventoryItem::II_FLAGS_OBJECT_SLAM_SALE;
+ flags_to_be_set |= LLInventoryItemFlags::II_FLAGS_OBJECT_SLAM_SALE;
}
setFlags(getFlags() | flags_to_be_set);
}
@@ -1304,19 +1309,6 @@ void LLInventoryItem::unpackBinaryBucket(U8* bin_bucket, S32 bin_bucket_size)
setCreationDate(now);
}
-// returns TRUE if a should appear before b
-BOOL item_dictionary_sort( LLInventoryItem* a, LLInventoryItem* b )
-{
- return (LLStringUtil::compareDict( a->getName().c_str(), b->getName().c_str() ) < 0);
-}
-
-// returns TRUE if a should appear before b
-BOOL item_date_sort( LLInventoryItem* a, LLInventoryItem* b )
-{
- return a->getCreationDate() < b->getCreationDate();
-}
-
-
///----------------------------------------------------------------------------
/// Class LLInventoryCategory
///----------------------------------------------------------------------------