aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewerinventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llviewerinventory.cpp')
-rw-r--r--linden/indra/newview/llviewerinventory.cpp45
1 files changed, 17 insertions, 28 deletions
diff --git a/linden/indra/newview/llviewerinventory.cpp b/linden/indra/newview/llviewerinventory.cpp
index d7c1778..6d9d685 100644
--- a/linden/indra/newview/llviewerinventory.cpp
+++ b/linden/indra/newview/llviewerinventory.cpp
@@ -64,11 +64,11 @@ LLViewerInventoryItem::LLViewerInventoryItem(const LLUUID& uuid,
64 const LLUUID& asset_uuid, 64 const LLUUID& asset_uuid,
65 LLAssetType::EType type, 65 LLAssetType::EType type,
66 LLInventoryType::EType inv_type, 66 LLInventoryType::EType inv_type,
67 const LLString& name, 67 const std::string& name,
68 const LLString& desc, 68 const std::string& desc,
69 const LLSaleInfo& sale_info, 69 const LLSaleInfo& sale_info,
70 U32 flags, 70 U32 flags,
71 S32 creation_date_utc) : 71 time_t creation_date_utc) :
72 LLInventoryItem(uuid, parent_uuid, perm, asset_uuid, type, inv_type, 72 LLInventoryItem(uuid, parent_uuid, perm, asset_uuid, type, inv_type,
73 name, desc, sale_info, flags, creation_date_utc), 73 name, desc, sale_info, flags, creation_date_utc),
74 mIsComplete(TRUE) 74 mIsComplete(TRUE)
@@ -77,7 +77,7 @@ LLViewerInventoryItem::LLViewerInventoryItem(const LLUUID& uuid,
77 77
78LLViewerInventoryItem::LLViewerInventoryItem(const LLUUID& item_id, 78LLViewerInventoryItem::LLViewerInventoryItem(const LLUUID& item_id,
79 const LLUUID& parent_id, 79 const LLUUID& parent_id,
80 const char* name, 80 const std::string& name,
81 LLInventoryType::EType inv_type) : 81 LLInventoryType::EType inv_type) :
82 LLInventoryItem(), 82 LLInventoryItem(),
83 mIsComplete(FALSE) 83 mIsComplete(FALSE)
@@ -85,7 +85,7 @@ LLViewerInventoryItem::LLViewerInventoryItem(const LLUUID& item_id,
85 mUUID = item_id; 85 mUUID = item_id;
86 mParentUUID = parent_id; 86 mParentUUID = parent_id;
87 mInventoryType = inv_type; 87 mInventoryType = inv_type;
88 mName.assign(name); 88 mName = name;
89} 89}
90 90
91LLViewerInventoryItem::LLViewerInventoryItem() : 91LLViewerInventoryItem::LLViewerInventoryItem() :
@@ -279,18 +279,18 @@ bool LLViewerInventoryItem::importFileLocal(LLFILE* fp)
279 279
280bool LLViewerInventoryItem::exportFileLocal(LLFILE* fp) const 280bool LLViewerInventoryItem::exportFileLocal(LLFILE* fp) const
281{ 281{
282 char uuid_str[UUID_STR_LENGTH]; /* Flawfinder: ignore */ 282 std::string uuid_str;
283 fprintf(fp, "\tinv_item\t0\n\t{\n"); 283 fprintf(fp, "\tinv_item\t0\n\t{\n");
284 mUUID.toString(uuid_str); 284 mUUID.toString(uuid_str);
285 fprintf(fp, "\t\titem_id\t%s\n", uuid_str); 285 fprintf(fp, "\t\titem_id\t%s\n", uuid_str.c_str());
286 mParentUUID.toString(uuid_str); 286 mParentUUID.toString(uuid_str);
287 fprintf(fp, "\t\tparent_id\t%s\n", uuid_str); 287 fprintf(fp, "\t\tparent_id\t%s\n", uuid_str.c_str());
288 mPermissions.exportFile(fp); 288 mPermissions.exportFile(fp);
289 fprintf(fp, "\t\ttype\t%s\n", LLAssetType::lookup(mType)); 289 fprintf(fp, "\t\ttype\t%s\n", LLAssetType::lookup(mType));
290 const char* inv_type_str = LLInventoryType::lookup(mInventoryType); 290 const char* inv_type_str = LLInventoryType::lookup(mInventoryType);
291 if(inv_type_str) fprintf(fp, "\t\tinv_type\t%s\n", inv_type_str); 291 if(inv_type_str) fprintf(fp, "\t\tinv_type\t%s\n", inv_type_str);
292 fprintf(fp, "\t\tname\t%s|\n", mName.c_str()); 292 fprintf(fp, "\t\tname\t%s|\n", mName.c_str());
293 fprintf(fp, "\t\tcreation_date\t%d\n", mCreationDate); 293 fprintf(fp, "\t\tcreation_date\t%d\n", (S32) mCreationDate);
294 fprintf(fp,"\t}\n"); 294 fprintf(fp,"\t}\n");
295 return true; 295 return true;
296} 296}
@@ -327,7 +327,7 @@ void LLViewerInventoryItem::updateParentOnServer(BOOL restamp) const
327LLViewerInventoryCategory::LLViewerInventoryCategory(const LLUUID& uuid, 327LLViewerInventoryCategory::LLViewerInventoryCategory(const LLUUID& uuid,
328 const LLUUID& parent_uuid, 328 const LLUUID& parent_uuid,
329 LLAssetType::EType pref, 329 LLAssetType::EType pref,
330 const LLString& name, 330 const std::string& name,
331 const LLUUID& owner_id) : 331 const LLUUID& owner_id) :
332 LLInventoryCategory(uuid, parent_uuid, pref, name), 332 LLInventoryCategory(uuid, parent_uuid, pref, name),
333 mOwnerID(owner_id), 333 mOwnerID(owner_id),
@@ -518,8 +518,8 @@ bool LLViewerInventoryCategory::importFileLocal(LLFILE* fp)
518 sscanf( /* Flawfinder: ignore */ 518 sscanf( /* Flawfinder: ignore */
519 buffer, " %254s %254[^|]", keyword, valuestr); 519 buffer, " %254s %254[^|]", keyword, valuestr);
520 mName.assign(valuestr); 520 mName.assign(valuestr);
521 LLString::replaceNonstandardASCII(mName, ' '); 521 LLStringUtil::replaceNonstandardASCII(mName, ' ');
522 LLString::replaceChar(mName, '|', ' '); 522 LLStringUtil::replaceChar(mName, '|', ' ');
523 } 523 }
524 else if(0 == strcmp("owner_id", keyword)) 524 else if(0 == strcmp("owner_id", keyword))
525 { 525 {
@@ -540,17 +540,17 @@ bool LLViewerInventoryCategory::importFileLocal(LLFILE* fp)
540 540
541bool LLViewerInventoryCategory::exportFileLocal(LLFILE* fp) const 541bool LLViewerInventoryCategory::exportFileLocal(LLFILE* fp) const
542{ 542{
543 char uuid_str[UUID_STR_LENGTH]; /* Flawfinder: ignore */ 543 std::string uuid_str;
544 fprintf(fp, "\tinv_category\t0\n\t{\n"); 544 fprintf(fp, "\tinv_category\t0\n\t{\n");
545 mUUID.toString(uuid_str); 545 mUUID.toString(uuid_str);
546 fprintf(fp, "\t\tcat_id\t%s\n", uuid_str); 546 fprintf(fp, "\t\tcat_id\t%s\n", uuid_str.c_str());
547 mParentUUID.toString(uuid_str); 547 mParentUUID.toString(uuid_str);
548 fprintf(fp, "\t\tparent_id\t%s\n", uuid_str); 548 fprintf(fp, "\t\tparent_id\t%s\n", uuid_str.c_str());
549 fprintf(fp, "\t\ttype\t%s\n", LLAssetType::lookup(mType)); 549 fprintf(fp, "\t\ttype\t%s\n", LLAssetType::lookup(mType));
550 fprintf(fp, "\t\tpref_type\t%s\n", LLAssetType::lookup(mPreferredType)); 550 fprintf(fp, "\t\tpref_type\t%s\n", LLAssetType::lookup(mPreferredType));
551 fprintf(fp, "\t\tname\t%s|\n", mName.c_str()); 551 fprintf(fp, "\t\tname\t%s|\n", mName.c_str());
552 mOwnerID.toString(uuid_str); 552 mOwnerID.toString(uuid_str);
553 fprintf(fp, "\t\towner_id\t%s\n", uuid_str); 553 fprintf(fp, "\t\towner_id\t%s\n", uuid_str.c_str());
554 fprintf(fp, "\t\tversion\t%d\n", mVersion); 554 fprintf(fp, "\t\tversion\t%d\n", mVersion);
555 fprintf(fp,"\t}\n"); 555 fprintf(fp,"\t}\n");
556 return true; 556 return true;
@@ -560,17 +560,6 @@ bool LLViewerInventoryCategory::exportFileLocal(LLFILE* fp) const
560/// Local function definitions 560/// Local function definitions
561///---------------------------------------------------------------------------- 561///----------------------------------------------------------------------------
562 562
563/*
564void inventory_reliable_callback(void**, S32 status)
565{
566 if(0 != status)
567 {
568 char buffer[MAX_STRING];
569 sprintf(buffer, "Reliable packet failure: %d", status);
570 llwarns << buffer << llendl;
571 }
572}
573*/
574LLInventoryCallbackManager *LLInventoryCallbackManager::sInstance = NULL; 563LLInventoryCallbackManager *LLInventoryCallbackManager::sInstance = NULL;
575 564
576LLInventoryCallbackManager::LLInventoryCallbackManager() : 565LLInventoryCallbackManager::LLInventoryCallbackManager() :
@@ -677,7 +666,7 @@ void CreateGestureCallback::fire(const LLUUID& inv_item)
677 666
678 if(!LLPreview::show(inv_item,FALSE)) 667 if(!LLPreview::show(inv_item,FALSE))
679 { 668 {
680 LLPreviewGesture* preview = LLPreviewGesture::show(LLString("Gesture: ") + item->getName(), inv_item, LLUUID::null); 669 LLPreviewGesture* preview = LLPreviewGesture::show(std::string("Gesture: ") + item->getName(), inv_item, LLUUID::null);
681 // Force to be entirely onscreen. 670 // Force to be entirely onscreen.
682 gFloaterView->adjustToFitScreen(preview, FALSE); 671 gFloaterView->adjustToFitScreen(preview, FALSE);
683 } 672 }