diff options
Diffstat (limited to 'linden/indra/newview/llinventorymodel.h')
-rw-r--r-- | linden/indra/newview/llinventorymodel.h | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/linden/indra/newview/llinventorymodel.h b/linden/indra/newview/llinventorymodel.h index b03be24..8017410 100644 --- a/linden/indra/newview/llinventorymodel.h +++ b/linden/indra/newview/llinventorymodel.h | |||
@@ -162,7 +162,13 @@ public: | |||
162 | void getDirectDescendentsOf(const LLUUID& cat_id, | 162 | void getDirectDescendentsOf(const LLUUID& cat_id, |
163 | cat_array_t*& categories, | 163 | cat_array_t*& categories, |
164 | item_array_t*& items) const; | 164 | item_array_t*& items) const; |
165 | 165 | ||
166 | // SJB: Added version to lock the arrays to catch potential logic bugs | ||
167 | void lockDirectDescendentArrays(const LLUUID& cat_id, | ||
168 | cat_array_t*& categories, | ||
169 | item_array_t*& items); | ||
170 | void unlockDirectDescendentArrays(const LLUUID& cat_id); | ||
171 | |||
166 | // Starting with the object specified, add it's descendents to the | 172 | // Starting with the object specified, add it's descendents to the |
167 | // array provided, but do not add the inventory object specified | 173 | // array provided, but do not add the inventory object specified |
168 | // by id. There is no guaranteed order. Neither array will be | 174 | // by id. There is no guaranteed order. Neither array will be |
@@ -292,7 +298,7 @@ public: | |||
292 | 298 | ||
293 | // Generates a string containing the path to the item specified by | 299 | // Generates a string containing the path to the item specified by |
294 | // item_id. | 300 | // item_id. |
295 | void appendPath(const LLUUID& id, LLString& path); | 301 | void appendPath(const LLUUID& id, std::string& path); |
296 | 302 | ||
297 | // message handling functionality | 303 | // message handling functionality |
298 | static void registerCallbacks(LLMessageSystem* msg); | 304 | static void registerCallbacks(LLMessageSystem* msg); |
@@ -305,7 +311,7 @@ public: | |||
305 | // pass in a NULL to the 'name parameter. | 311 | // pass in a NULL to the 'name parameter. |
306 | LLUUID createNewCategory(const LLUUID& parent_id, | 312 | LLUUID createNewCategory(const LLUUID& parent_id, |
307 | LLAssetType::EType preferred_type, | 313 | LLAssetType::EType preferred_type, |
308 | const LLString& name); | 314 | const std::string& name); |
309 | 315 | ||
310 | // methods to load up inventory skeleton & meat. These are used | 316 | // methods to load up inventory skeleton & meat. These are used |
311 | // during authentication. return true if everything parsed. | 317 | // during authentication. return true if everything parsed. |
@@ -392,14 +398,12 @@ protected: | |||
392 | //void recalculateCloneInformation(); | 398 | //void recalculateCloneInformation(); |
393 | 399 | ||
394 | // file import/export. | 400 | // file import/export. |
395 | static bool loadFromFile( | 401 | static bool loadFromFile(const std::string& filename, |
396 | const char* filename, | 402 | cat_array_t& categories, |
397 | cat_array_t& categories, | 403 | item_array_t& items); |
398 | item_array_t& items); | 404 | static bool saveToFile(const std::string& filename, |
399 | static bool saveToFile( | 405 | const cat_array_t& categories, |
400 | const char* filename, | 406 | const item_array_t& items); |
401 | const cat_array_t& categories, | ||
402 | const item_array_t& items); | ||
403 | 407 | ||
404 | // message handling functionality | 408 | // message handling functionality |
405 | //static void processUseCachedInventory(LLMessageSystem* msg, void**); | 409 | //static void processUseCachedInventory(LLMessageSystem* msg, void**); |
@@ -420,6 +424,10 @@ protected: | |||
420 | bool messageUpdateCore(LLMessageSystem* msg, bool do_accounting); | 424 | bool messageUpdateCore(LLMessageSystem* msg, bool do_accounting); |
421 | 425 | ||
422 | protected: | 426 | protected: |
427 | cat_array_t* getUnlockedCatArray(const LLUUID& id); | ||
428 | item_array_t* getUnlockedItemArray(const LLUUID& id); | ||
429 | |||
430 | protected: | ||
423 | // Varaibles used to track what has changed since the last notify. | 431 | // Varaibles used to track what has changed since the last notify. |
424 | U32 mModifyMask; | 432 | U32 mModifyMask; |
425 | typedef std::set<LLUUID> changed_items_t; | 433 | typedef std::set<LLUUID> changed_items_t; |
@@ -436,6 +444,9 @@ protected: | |||
436 | cat_map_t mCategoryMap; | 444 | cat_map_t mCategoryMap; |
437 | item_map_t mItemMap; | 445 | item_map_t mItemMap; |
438 | 446 | ||
447 | std::map<LLUUID, bool> mCategoryLock; | ||
448 | std::map<LLUUID, bool> mItemLock; | ||
449 | |||
439 | // cache recent lookups | 450 | // cache recent lookups |
440 | mutable LLPointer<LLViewerInventoryItem> mLastItem; | 451 | mutable LLPointer<LLViewerInventoryItem> mLastItem; |
441 | 452 | ||
@@ -486,6 +497,8 @@ class LLInventoryCollectFunctor | |||
486 | public: | 497 | public: |
487 | virtual ~LLInventoryCollectFunctor(){}; | 498 | virtual ~LLInventoryCollectFunctor(){}; |
488 | virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) = 0; | 499 | virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) = 0; |
500 | |||
501 | static bool itemTransferCommonlyAllowed(LLInventoryItem* item); | ||
489 | }; | 502 | }; |
490 | 503 | ||
491 | 504 | ||
@@ -645,7 +658,7 @@ protected: | |||
645 | class LLNameCategoryCollector : public LLInventoryCollectFunctor | 658 | class LLNameCategoryCollector : public LLInventoryCollectFunctor |
646 | { | 659 | { |
647 | public: | 660 | public: |
648 | LLNameCategoryCollector(const char* name) : mName(name) {} | 661 | LLNameCategoryCollector(const std::string& name) : mName(name) {} |
649 | virtual ~LLNameCategoryCollector() {} | 662 | virtual ~LLNameCategoryCollector() {} |
650 | virtual bool operator()(LLInventoryCategory* cat, | 663 | virtual bool operator()(LLInventoryCategory* cat, |
651 | LLInventoryItem* item); | 664 | LLInventoryItem* item); |