diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-10-17 16:56:21 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-17 16:56:21 +0300 |
commit | 0ef7a9b39cf72da1211039ab22bdf8f9f6a2c984 (patch) | |
tree | 6f51ef179497265b5bff2a355471ae5dc9643ad2 /indra/newview/llviewerinventory.cpp | |
parent | 9e24b300d02e5627ea0d304d412cb683ec2de3a4 (diff) | |
parent | d3d349ae0f17a72481f30b9354b9367b1cd3b639 (diff) |
Merge pull request #2856 from secondlife/marchcat/c-develop
Develop → Maint C sync
Diffstat (limited to 'indra/newview/llviewerinventory.cpp')
-rw-r--r-- | indra/newview/llviewerinventory.cpp | 83 |
1 files changed, 43 insertions, 40 deletions
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 425fc17aa9..01b97a6154 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -71,6 +71,9 @@ #include "llclipboard.h" #include "llhttpretrypolicy.h" #include "llsettingsvo.h" +#include "llinventorylistener.h" + +LLInventoryListener sInventoryListener; // do-nothing ops for use in callbacks. void no_op_inventory_func(const LLUUID&) {} @@ -298,7 +301,7 @@ public: return false; } LLUUID inventory_id; - if (!inventory_id.set(params[0], FALSE)) + if (!inventory_id.set(params[0], false)) { return false; } @@ -334,7 +337,7 @@ LLViewerInventoryItem::LLViewerInventoryItem(const LLUUID& uuid, U32 flags, time_t creation_date_utc) : LLInventoryItem(uuid, parent_uuid, perm, asset_uuid, type, inv_type, - name, desc, sale_info, flags, creation_date_utc), + name, desc, sale_info, flags, (S32)creation_date_utc), mIsComplete(true) { } @@ -406,7 +409,7 @@ void LLViewerInventoryItem::cloneViewerItem(LLPointer<LLViewerInventoryItem>& ne } } -void LLViewerInventoryItem::updateServer(BOOL is_new) const +void LLViewerInventoryItem::updateServer(bool is_new) const { if(!mIsComplete) { @@ -494,24 +497,24 @@ void LLViewerInventoryItem::fetchFromServer(void) const } // virtual -BOOL LLViewerInventoryItem::unpackMessage(const LLSD& item) +bool LLViewerInventoryItem::unpackMessage(const LLSD& item) { - BOOL rv = LLInventoryItem::fromLLSD(item); + bool rv = LLInventoryItem::fromLLSD(item); LLLocalizedInventoryItemsDictionary::getInstance()->localizeInventoryObjectName(mName); - mIsComplete = TRUE; + mIsComplete = true; return rv; } // virtual -BOOL LLViewerInventoryItem::unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num) +bool LLViewerInventoryItem::unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num) { - BOOL rv = LLInventoryItem::unpackMessage(msg, block, block_num); + bool rv = LLInventoryItem::unpackMessage(msg, block, block_num); LLLocalizedInventoryItemsDictionary::getInstance()->localizeInventoryObjectName(mName); - mIsComplete = TRUE; + mIsComplete = true; return rv; } @@ -534,20 +537,20 @@ void LLViewerInventoryItem::packMessage(LLMessageSystem* msg) const mSaleInfo.packMessage(msg); msg->addStringFast(_PREHASH_Name, mName); msg->addStringFast(_PREHASH_Description, mDescription); - msg->addS32Fast(_PREHASH_CreationDate, mCreationDate); + msg->addS32Fast(_PREHASH_CreationDate, (S32)mCreationDate); U32 crc = getCRC32(); msg->addU32Fast(_PREHASH_CRC, crc); } // virtual -BOOL LLViewerInventoryItem::importLegacyStream(std::istream& input_stream) +bool LLViewerInventoryItem::importLegacyStream(std::istream& input_stream) { - BOOL rv = LLInventoryItem::importLegacyStream(input_stream); - mIsComplete = TRUE; + bool rv = LLInventoryItem::importLegacyStream(input_stream); + mIsComplete = true; return rv; } -void LLViewerInventoryItem::updateParentOnServer(BOOL restamp) const +void LLViewerInventoryItem::updateParentOnServer(bool restamp) const { LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_MoveInventoryItem); @@ -628,7 +631,7 @@ void LLViewerInventoryCategory::packMessage(LLMessageSystem* msg) const msg->addStringFast(_PREHASH_Name, mName); } -void LLViewerInventoryCategory::updateParentOnServer(BOOL restamp) const +void LLViewerInventoryCategory::updateParentOnServer(bool restamp) const { LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_MoveInventoryFolder); @@ -643,7 +646,7 @@ void LLViewerInventoryCategory::updateParentOnServer(BOOL restamp) const gAgent.sendReliableMessage(); } -void LLViewerInventoryCategory::updateServer(BOOL is_new) const +void LLViewerInventoryCategory::updateServer(bool is_new) const { // communicate that change with the server. @@ -675,7 +678,7 @@ bool LLViewerInventoryCategory::fetch(S32 expiry_seconds) { LL_DEBUGS(LOG_INV) << "Fetching category children: " << mName << ", UUID: " << mUUID << LL_ENDL; mDescendentsRequested.reset(); - mDescendentsRequested.setTimerExpirySec(expiry_seconds); + mDescendentsRequested.setTimerExpirySec((F32)expiry_seconds); std::string url; if (gAgent.getRegion()) @@ -721,7 +724,7 @@ void LLViewerInventoryCategory::setFetching(LLViewerInventoryCategory::EFetchTyp mDescendentsRequested.reset(); if (AISAPI::isAvailable()) { - mDescendentsRequested.setTimerExpirySec(AISAPI::HTTP_TIMEOUT); + mDescendentsRequested.setTimerExpirySec((F32)AISAPI::HTTP_TIMEOUT); } else { @@ -746,7 +749,7 @@ S32 LLViewerInventoryCategory::getViewerDescendentCount() const S32 descendents_actual = 0; if(cats && items) { - descendents_actual = cats->size() + items->size(); + descendents_actual = static_cast<S32>(cats->size() + items->size()); } return descendents_actual; } @@ -807,7 +810,7 @@ bool LLViewerInventoryCategory::acceptItem(LLInventoryItem* inv_item) void LLViewerInventoryCategory::determineFolderType() { /* Do NOT uncomment this code. This is for future 2.1 support of ensembles. - llassert(FALSE); + llassert(false); LLFolderType::EType original_type = getPreferredType(); if (LLFolderType::lookupIsProtectedType(original_type)) return; @@ -816,7 +819,7 @@ void LLViewerInventoryCategory::determineFolderType() U64 folder_invalid = 0; LLInventoryModel::cat_array_t category_array; LLInventoryModel::item_array_t item_array; - gInventory.collectDescendents(getUUID(),category_array,item_array,FALSE); + gInventory.collectDescendents(getUUID(),category_array,item_array,false); // For ensembles if (category_array.empty()) @@ -851,7 +854,7 @@ void LLViewerInventoryCategory::determineFolderType() { changeType(LLFolderType::FT_NONE); } - llassert(FALSE); + llassert(false); */ } @@ -882,9 +885,9 @@ void LLViewerInventoryCategory::localizeName() } // virtual -BOOL LLViewerInventoryCategory::unpackMessage(const LLSD& category) +bool LLViewerInventoryCategory::unpackMessage(const LLSD& category) { - BOOL rv = LLInventoryCategory::fromLLSD(category); + bool rv = LLInventoryCategory::fromLLSD(category); localizeName(); return rv; } @@ -1003,7 +1006,7 @@ void set_default_permissions(LLViewerInventoryItem* item, std::string perm_type) item->setPermissions(perm); - item->updateServer(FALSE); + item->updateServer(false); } } @@ -1039,7 +1042,7 @@ void create_gesture_cb(const LLUUID& inv_item) LLPreviewGesture* preview = LLPreviewGesture::show(inv_item, LLUUID::null); // Force to be entirely onscreen. - gFloaterView->adjustToFitScreen(preview, FALSE); + gFloaterView->adjustToFitScreen(preview, false); } } } @@ -1375,7 +1378,7 @@ void move_inventory_item( msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, agent_id); msg->addUUIDFast(_PREHASH_SessionID, session_id); - msg->addBOOLFast(_PREHASH_Stamp, FALSE); + msg->addBOOLFast(_PREHASH_Stamp, false); msg->nextBlockFast(_PREHASH_InventoryData); msg->addUUIDFast(_PREHASH_ItemID, item_id); msg->addUUIDFast(_PREHASH_FolderID, parent_id); @@ -1595,7 +1598,7 @@ void purge_descendents_of(const LLUUID& id, LLPointer<LLInventoryCallback> cb) // Remove items from clipboard or it will remain active even if there is nothing to paste/copy LLInventoryModel::cat_array_t categories; LLInventoryModel::item_array_t items; - gInventory.collectDescendents(id, categories, items, TRUE); + gInventory.collectDescendents(id, categories, items, true); for (LLInventoryModel::cat_array_t::const_iterator it = categories.begin(); it != categories.end(); ++it) { @@ -1838,7 +1841,7 @@ void menu_create_inventory_item(LLInventoryPanel* panel, LLUUID dest_id, const L LLInventoryPanel* panel = static_cast<LLInventoryPanel*>(handle.get()); if (panel) { - panel->setSelectionByID(new_category_id, TRUE); + panel->setSelectionByID(new_category_id, true); } LL_DEBUGS(LOG_INV) << "Done creating inventory: " << new_category_id << LL_ENDL; }; @@ -1935,7 +1938,7 @@ void menu_create_inventory_item(LLInventoryPanel* panel, LLUUID dest_id, const L } if(panel) { - panel->getRootFolder()->setNeedsAutoRename(TRUE); + panel->getRootFolder()->setNeedsAutoRename(true); } } @@ -2147,7 +2150,7 @@ U32 LLViewerInventoryItem::getCRC32() const // *TODO: mantipov: should be removed with LMSortPrefix patch in llinventorymodel.cpp, EXT-3985 static char getSeparator() { return '@'; } -BOOL LLViewerInventoryItem::extractSortFieldAndDisplayName(const std::string& name, S32* sortField, std::string* displayName) +bool LLViewerInventoryItem::extractSortFieldAndDisplayName(const std::string& name, S32* sortField, std::string* displayName) { using std::string; using std::stringstream; @@ -2155,7 +2158,7 @@ BOOL LLViewerInventoryItem::extractSortFieldAndDisplayName(const std::string& na const char separator = getSeparator(); const string::size_type separatorPos = name.find(separator, 0); - BOOL result = FALSE; + bool result = false; if (separatorPos < string::npos) { @@ -2176,7 +2179,7 @@ BOOL LLViewerInventoryItem::extractSortFieldAndDisplayName(const std::string& na *displayName = name.substr(separatorPos + 1, string::npos); } - result = TRUE; + result = true; } return result; @@ -2241,9 +2244,9 @@ PermissionMask LLViewerInventoryItem::getPermissionMask() const { const LLPermissions& permissions = getPermissions(); - BOOL copy = permissions.allowCopyBy(gAgent.getID()); - BOOL mod = permissions.allowModifyBy(gAgent.getID()); - BOOL xfer = permissions.allowOperationBy(PERM_TRANSFER, gAgent.getID()); + bool copy = permissions.allowCopyBy(gAgent.getID()); + bool mod = permissions.allowModifyBy(gAgent.getID()); + bool xfer = permissions.allowOperationBy(PERM_TRANSFER, gAgent.getID()); PermissionMask perm_mask = 0; if (copy) perm_mask |= PERM_COPY; if (mod) perm_mask |= PERM_MODIFY; @@ -2306,11 +2309,11 @@ LLUUID find_possible_item_for_regeneration(const LLViewerInventoryItem *target_i // This currently dosen't work, because the sim does not allow us // to change an item's assetID. -BOOL LLViewerInventoryItem::regenerateLink() +bool LLViewerInventoryItem::regenerateLink() { const LLUUID target_item_id = find_possible_item_for_regeneration(this); if (target_item_id.isNull()) - return FALSE; + return false; LLViewerInventoryCategory::cat_array_t cats; LLViewerInventoryItem::item_array_t items; LLAssetIDMatches asset_id_matches(getAssetUUID()); @@ -2325,9 +2328,9 @@ BOOL LLViewerInventoryItem::regenerateLink() { LLViewerInventoryItem *item = (*item_iter); item->setAssetUUID(target_item_id); - item->updateServer(FALSE); + item->updateServer(false); gInventory.addChangedMask(LLInventoryObserver::REBUILD, item->getUUID()); } gInventory.notifyObservers(); - return TRUE; + return true; } |