From cdbdb1168694bcbfc58208f2941f513b556a0d6e Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 6 Apr 2010 14:47:20 -0400 Subject: EXT-4151 : Immediately check if a fetchObserver filter is done, else add to observer list automatically FetchObservers now take in a list of IDs to check against. Made some naming changes. --- indra/newview/llinventoryobserver.h | 78 +++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 38 deletions(-) (limited to 'indra/newview/llinventoryobserver.h') diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index ba70552ebc..03f9e9c553 100644 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -73,68 +73,46 @@ public: }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLInventoryCompletionObserver -// -// Base class for doing something when when all observed items are locally -// complete. Implements the changed() method of LLInventoryObserver -// and declares a new method named done() which is called when all watched items -// have complete information in the inventory model. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -class LLInventoryCompletionObserver : public LLInventoryObserver -{ -public: - LLInventoryCompletionObserver() {} - virtual void changed(U32 mask); - - void watchItem(const LLUUID& id); - -protected: - virtual void done() = 0; - - uuid_vec_t mComplete; - uuid_vec_t mIncomplete; -}; - - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLInventoryFetchObserver +// Class LLInventoryFetchItemsObserver // -// This class is much like the LLInventoryCompletionObserver, except -// that it handles all the the fetching necessary. Override the done() -// method to do the thing you want. +// Fetches inventory items, calls done() when all inventory has arrived. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLInventoryFetchObserver : public LLInventoryObserver +class LLInventoryFetchItemsObserver : public LLInventoryObserver { public: - LLInventoryFetchObserver(bool retry_if_missing = false); + LLInventoryFetchItemsObserver(bool retry_if_missing = false); + LLInventoryFetchItemsObserver(const uuid_vec_t& ids, bool retry_if_missing = false); virtual void changed(U32 mask); bool isEverythingComplete() const; - void fetch(const uuid_vec_t& ids); + void setItems(const uuid_vec_t& ids) { mIDs = ids; } + void startFetch(); + virtual void done() {}; protected: bool mRetryIfMissing; uuid_vec_t mComplete; uuid_vec_t mIncomplete; + uuid_vec_t mIDs; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLInventoryFetchDescendentsObserver // -// This class is much like the LLInventoryCompletionObserver, except -// that it handles fetching based on category. Override the done() -// method to do the thing you want. +// Fetches children of a category/folder, calls done() when all +// inventory has arrived. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class LLInventoryFetchDescendentsObserver : public LLInventoryObserver { public: - LLInventoryFetchDescendentsObserver() {} + LLInventoryFetchDescendentsObserver(); + LLInventoryFetchDescendentsObserver(const uuid_vec_t& ids); virtual void changed(U32 mask); - void fetch(const uuid_vec_t& ids); + void setFolders(const uuid_vec_t& ids) { mIDs = ids; } + void startFetch(); bool isEverythingComplete() const; virtual void done() = 0; @@ -142,6 +120,7 @@ protected: bool isComplete(LLViewerInventoryCategory* cat); uuid_vec_t mIncomplete; uuid_vec_t mComplete; + uuid_vec_t mIDs; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -158,7 +137,7 @@ public: LLInventoryFetchComboObserver() : mDone(false) {} virtual void changed(U32 mask); - void fetch(const uuid_vec_t& folder_ids, const uuid_vec_t& item_ids); + void startFetch(const uuid_vec_t& folder_ids, const uuid_vec_t& item_ids); virtual void done() = 0; @@ -237,6 +216,29 @@ protected: LLTransactionID mTransactionID; }; +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLInventoryCompletionObserver +// +// Base class for doing something when when all observed items are locally +// complete. Implements the changed() method of LLInventoryObserver +// and declares a new method named done() which is called when all watched items +// have complete information in the inventory model. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +class LLInventoryCompletionObserver : public LLInventoryObserver +{ +public: + LLInventoryCompletionObserver() {} + virtual void changed(U32 mask); + + void watchItem(const LLUUID& id); + +protected: + virtual void done() = 0; + + uuid_vec_t mComplete; + uuid_vec_t mIncomplete; +}; #endif // LL_LLINVENTORYOBSERVERS_H -- cgit v1.2.3 From c3d9316dff568d5265d856a708e3909deae09f18 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 6 Apr 2010 17:30:23 -0400 Subject: EXT-6727 : Allow LLInventoryObservers to target a single item (instead of a vector of items) Added new constructors to LLInventoryFetch types to allow passing in a single item. --- indra/newview/llinventoryobserver.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'indra/newview/llinventoryobserver.h') diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index 03f9e9c553..420afdfadc 100644 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -81,8 +81,9 @@ public: class LLInventoryFetchItemsObserver : public LLInventoryObserver { public: - LLInventoryFetchItemsObserver(bool retry_if_missing = false); - LLInventoryFetchItemsObserver(const uuid_vec_t& ids, bool retry_if_missing = false); + LLInventoryFetchItemsObserver(bool retry_if_missing = false); // deprecated + LLInventoryFetchItemsObserver(const LLUUID& item_id, bool retry_if_missing = false); // single item + LLInventoryFetchItemsObserver(const uuid_vec_t& item_ids, bool retry_if_missing = false); // multiple items virtual void changed(U32 mask); bool isEverythingComplete() const; @@ -108,10 +109,12 @@ class LLInventoryFetchDescendentsObserver : public LLInventoryObserver { public: LLInventoryFetchDescendentsObserver(); - LLInventoryFetchDescendentsObserver(const uuid_vec_t& ids); + LLInventoryFetchDescendentsObserver(const LLUUID& cat_id); + LLInventoryFetchDescendentsObserver(const uuid_vec_t& cat_ids); virtual void changed(U32 mask); - void setFolders(const uuid_vec_t& ids) { mIDs = ids; } + void setFolders(const uuid_vec_t& cat_ids) { mIDs = cat_ids; } + void setFolders(const LLUUID& cat_id) { mIDs.clear(); mIDs.push_back(cat_id); } void startFetch(); bool isEverythingComplete() const; virtual void done() = 0; -- cgit v1.2.3 From f096f02278f3b8c8fdd962c85b237492defa93ec Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 6 Apr 2010 18:58:26 -0400 Subject: EXT-6728 : Have LLInventoryFetchItems/DescendentsObserver inherit from a base abstract LLInventoryFetchObserver class Added a new abstract class LLInventoryFetchObserver from which LLInventoryFetchItems and LLInventoryFetchDescendents inherit. Also changed isEverythingComplete to isFinished and made some other minor superficial changes. --- indra/newview/llinventoryobserver.h | 69 ++++++++++++++++++++++--------------- 1 file changed, 41 insertions(+), 28 deletions(-) (limited to 'indra/newview/llinventoryobserver.h') diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index 420afdfadc..7480b7e7af 100644 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -73,57 +73,70 @@ public: }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLInventoryFetchItemsObserver +// Class LLInventoryFetchObserver // -// Fetches inventory items, calls done() when all inventory has arrived. +// Abstract class to handle fetching items, folders, etc. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -class LLInventoryFetchItemsObserver : public LLInventoryObserver +class LLInventoryFetchObserver : public LLInventoryObserver { public: - LLInventoryFetchItemsObserver(bool retry_if_missing = false); // deprecated - LLInventoryFetchItemsObserver(const LLUUID& item_id, bool retry_if_missing = false); // single item - LLInventoryFetchItemsObserver(const uuid_vec_t& item_ids, bool retry_if_missing = false); // multiple items - virtual void changed(U32 mask); + LLInventoryFetchObserver(const LLUUID& id = LLUUID::null); // single item + LLInventoryFetchObserver(const uuid_vec_t& ids); // multiple items + void setFetchID(const LLUUID& id); + void setFetchIDs(const uuid_vec_t& ids); - bool isEverythingComplete() const; - void setItems(const uuid_vec_t& ids) { mIDs = ids; } - void startFetch(); + BOOL isFinished() const; - virtual void done() {}; + virtual void startFetch() = 0; + virtual void done() = 0; + virtual void changed(U32 mask) = 0; protected: - bool mRetryIfMissing; uuid_vec_t mComplete; uuid_vec_t mIncomplete; uuid_vec_t mIDs; }; + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLInventoryFetchItemsObserver +// +// Fetches inventory items, calls done() when all inventory has arrived. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +class LLInventoryFetchItemsObserver : public LLInventoryFetchObserver +{ +public: + // LLInventoryFetchItemsObserver(BOOL retry_if_missing = FALSE); + LLInventoryFetchItemsObserver(const LLUUID& item_id = LLUUID::null, + BOOL retry_if_missing = FALSE); + LLInventoryFetchItemsObserver(const uuid_vec_t& item_ids, + BOOL retry_if_missing = FALSE); + + /*virtual*/ void startFetch(); + /*virtual*/ void changed(U32 mask); + /*virtual*/ void done(); + +protected: + BOOL mRetryIfMissing; +}; + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLInventoryFetchDescendentsObserver // // Fetches children of a category/folder, calls done() when all // inventory has arrived. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLInventoryFetchDescendentsObserver : public LLInventoryObserver +class LLInventoryFetchDescendentsObserver : public LLInventoryFetchObserver { public: - LLInventoryFetchDescendentsObserver(); - LLInventoryFetchDescendentsObserver(const LLUUID& cat_id); + // LLInventoryFetchDescendentsObserver(); + LLInventoryFetchDescendentsObserver(const LLUUID& cat_id = LLUUID::null); LLInventoryFetchDescendentsObserver(const uuid_vec_t& cat_ids); - virtual void changed(U32 mask); - - void setFolders(const uuid_vec_t& cat_ids) { mIDs = cat_ids; } - void setFolders(const LLUUID& cat_id) { mIDs.clear(); mIDs.push_back(cat_id); } - void startFetch(); - bool isEverythingComplete() const; - virtual void done() = 0; + /*virtual*/ void startFetch(); + /*virtual*/ void changed(U32 mask); protected: - bool isComplete(LLViewerInventoryCategory* cat); - uuid_vec_t mIncomplete; - uuid_vec_t mComplete; - uuid_vec_t mIDs; + BOOL isCategoryComplete(const LLViewerInventoryCategory* cat) const; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -137,7 +150,7 @@ protected: class LLInventoryFetchComboObserver : public LLInventoryObserver { public: - LLInventoryFetchComboObserver() : mDone(false) {} + LLInventoryFetchComboObserver() : mDone(FALSE) {} virtual void changed(U32 mask); void startFetch(const uuid_vec_t& folder_ids, const uuid_vec_t& item_ids); -- cgit v1.2.3 From e9f06764412af37023f45c4d83b2b97c48d2a13e Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 7 Apr 2010 11:15:27 -0400 Subject: EXT-6728 : Have LLInventoryFetchItems/DescendentsObserver inherit from a base abstract LLInventoryFetchObserver class Minor cleanup of LLInventoryFetchComboObserver --- indra/newview/llinventoryobserver.h | 59 +++++++++++++++---------------------- 1 file changed, 23 insertions(+), 36 deletions(-) (limited to 'indra/newview/llinventoryobserver.h') diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index 7480b7e7af..e4ae9097bd 100644 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -97,7 +97,6 @@ protected: uuid_vec_t mIDs; }; - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLInventoryFetchItemsObserver // @@ -106,7 +105,6 @@ protected: class LLInventoryFetchItemsObserver : public LLInventoryFetchObserver { public: - // LLInventoryFetchItemsObserver(BOOL retry_if_missing = FALSE); LLInventoryFetchItemsObserver(const LLUUID& item_id = LLUUID::null, BOOL retry_if_missing = FALSE); LLInventoryFetchItemsObserver(const uuid_vec_t& item_ids, @@ -129,7 +127,6 @@ protected: class LLInventoryFetchDescendentsObserver : public LLInventoryFetchObserver { public: - // LLInventoryFetchDescendentsObserver(); LLInventoryFetchDescendentsObserver(const LLUUID& cat_id = LLUUID::null); LLInventoryFetchDescendentsObserver(const uuid_vec_t& cat_ids); @@ -142,46 +139,44 @@ protected: //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLInventoryFetchComboObserver // -// This class does an appropriate combination of fetch descendents and -// item fetches based on completion of categories and items. Much like -// the fetch and fetch descendents, this will call done() when everything -// has arrived. +// Does an appropriate combination of fetch descendents and +// item fetches based on completion of categories and items. Much like +// the fetch and fetch descendents, this will call done() when everything +// has arrived. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class LLInventoryFetchComboObserver : public LLInventoryObserver { public: - LLInventoryFetchComboObserver() : mDone(FALSE) {} - virtual void changed(U32 mask); - - void startFetch(const uuid_vec_t& folder_ids, const uuid_vec_t& item_ids); + LLInventoryFetchComboObserver(const uuid_vec_t& folder_ids, + const uuid_vec_t& item_ids); + /*virtual*/ void changed(U32 mask); + void startFetch(); virtual void done() = 0; - protected: - bool mDone; + BOOL mDone; uuid_vec_t mCompleteFolders; uuid_vec_t mIncompleteFolders; uuid_vec_t mCompleteItems; uuid_vec_t mIncompleteItems; + + uuid_vec_t mItemIDs; + uuid_vec_t mFolderIDs; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLInventoryExistenceObserver // -// This class is used as a base class for doing somethign when all the -// observed item ids exist in the inventory somewhere. You can derive -// a class from this class and implement the done() method to do -// something useful. +// Used as a base class for doing something when all the +// observed item ids exist in the inventory somewhere. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - class LLInventoryExistenceObserver : public LLInventoryObserver { public: LLInventoryExistenceObserver() {} - virtual void changed(U32 mask); + /*virtual*/ void changed(U32 mask); void watchItem(const LLUUID& id); - protected: virtual void done() = 0; uuid_vec_t mExist; @@ -191,18 +186,14 @@ protected: //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLInventoryAddedObserver // -// This class is used as a base class for doing something when -// a new item arrives in inventory. -// It does not watch for a certain UUID, rather it acts when anything is added -// Derive a class from this class and implement the done() method to do -// something useful. +// Base class for doing something when a new item arrives in inventory. +// It does not watch for a certain UUID, rather it acts when anything is added //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - class LLInventoryAddedObserver : public LLInventoryObserver { public: LLInventoryAddedObserver() : mAdded() {} - virtual void changed(U32 mask); + /*virtual*/ void changed(U32 mask); protected: virtual void done() = 0; @@ -213,18 +204,15 @@ protected: //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLInventoryTransactionObserver // -// Class which can be used as a base class for doing something when an -// inventory transaction completes. -// -// *NOTE: This class is not quite complete. Avoid using unless you fix up it's -// functionality gaps. +// Base class for doing something when an inventory transaction completes. +// NOTE: This class is not quite complete. Avoid using unless you fix up its +// functionality gaps. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - class LLInventoryTransactionObserver : public LLInventoryObserver { public: LLInventoryTransactionObserver(const LLTransactionID& transaction_id); - virtual void changed(U32 mask); + /*virtual*/ void changed(U32 mask); protected: virtual void done(const uuid_vec_t& folders, const uuid_vec_t& items) = 0; @@ -240,12 +228,11 @@ protected: // and declares a new method named done() which is called when all watched items // have complete information in the inventory model. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - class LLInventoryCompletionObserver : public LLInventoryObserver { public: LLInventoryCompletionObserver() {} - virtual void changed(U32 mask); + /*virtual*/ void changed(U32 mask); void watchItem(const LLUUID& id); -- cgit v1.2.3 From 5d3de2ea03ff500690acec13fd4b403dc8a72088 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 7 Apr 2010 13:30:21 -0400 Subject: EXT-6745 : Refactor LLFetchComboObserver to use LLFetchItems and LLFetchDescedents instead of code duplication Took out a bunch of code duplication from the FetchComboObserver and am using the LLFetchItems/DescendentsObservers instead. Also added some comments and made some minor superficial cleanup to LLInventoryObserver done(). --- indra/newview/llinventoryobserver.h | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'indra/newview/llinventoryobserver.h') diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index e4ae9097bd..7b4d3dfe7b 100644 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -45,7 +45,6 @@ class LLViewerInventoryCategory; // A simple abstract base class that can relay messages when the inventory // changes. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - class LLInventoryObserver { public: @@ -60,7 +59,7 @@ public: ADD = 4, // Something added REMOVE = 8, // Something deleted STRUCTURE = 16, // Structural change (e.g. item or folder moved) - CALLING_CARD = 32, // Calling card change (e.g. online, grant status, cancel) + CALLING_CARD = 32, // Calling card change (e.g. online, grant status, cancel) GESTURE = 64, REBUILD = 128, // Item UI changed (e.g. item type different) SORT = 256, // Folder needs to be resorted. @@ -88,9 +87,8 @@ public: BOOL isFinished() const; virtual void startFetch() = 0; - virtual void done() = 0; virtual void changed(U32 mask) = 0; - + virtual void done() {}; protected: uuid_vec_t mComplete; uuid_vec_t mIncomplete; @@ -112,8 +110,6 @@ public: /*virtual*/ void startFetch(); /*virtual*/ void changed(U32 mask); - /*virtual*/ void done(); - protected: BOOL mRetryIfMissing; }; @@ -140,28 +136,23 @@ protected: // Class LLInventoryFetchComboObserver // // Does an appropriate combination of fetch descendents and -// item fetches based on completion of categories and items. Much like -// the fetch and fetch descendents, this will call done() when everything -// has arrived. +// item fetches based on completion of categories and items. This is optimized +// to not fetch item_ids that are descendents of any of the folder_ids. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class LLInventoryFetchComboObserver : public LLInventoryObserver { public: LLInventoryFetchComboObserver(const uuid_vec_t& folder_ids, const uuid_vec_t& item_ids); + ~LLInventoryFetchComboObserver(); /*virtual*/ void changed(U32 mask); void startFetch(); virtual void done() = 0; protected: BOOL mDone; - uuid_vec_t mCompleteFolders; - uuid_vec_t mIncompleteFolders; - uuid_vec_t mCompleteItems; - uuid_vec_t mIncompleteItems; - - uuid_vec_t mItemIDs; - uuid_vec_t mFolderIDs; + LLInventoryFetchItemsObserver *mFetchItems; + LLInventoryFetchDescendentsObserver *mFetchDescendents; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- cgit v1.2.3 From 516ec63f52245a777725d29efe3c35e4e4e72936 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 7 Apr 2010 14:40:36 -0400 Subject: EXT-6749 : Have all observers persist/retry when items are missing after notifications Added mNumTries and took out mRetryIfMissing --- indra/newview/llinventoryobserver.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'indra/newview/llinventoryobserver.h') diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index 7b4d3dfe7b..ac2eca3477 100644 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -103,15 +103,13 @@ protected: class LLInventoryFetchItemsObserver : public LLInventoryFetchObserver { public: - LLInventoryFetchItemsObserver(const LLUUID& item_id = LLUUID::null, - BOOL retry_if_missing = FALSE); - LLInventoryFetchItemsObserver(const uuid_vec_t& item_ids, - BOOL retry_if_missing = FALSE); + LLInventoryFetchItemsObserver(const LLUUID& item_id = LLUUID::null); + LLInventoryFetchItemsObserver(const uuid_vec_t& item_ids); /*virtual*/ void startFetch(); /*virtual*/ void changed(U32 mask); -protected: - BOOL mRetryIfMissing; +private: + S8 mNumTries; // Number of times changed() was called without success }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- cgit v1.2.3 From 00462c243116e2720acf51ee1f777e69e8189f33 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Thu, 8 Apr 2010 12:07:58 +0300 Subject: Fixed normal bug EXT-4347 (Moving object contents to inventory opens files, changes menu) Implementation details: * Added new LLViewerInventoryMoveFromWorldObserver to watch moved items via their Asses UUIDs. It is instantiated only once due to drop events are sent separately for each item while multi-dragging. * Existent LLOpenTaskOffer observer uses it to exclude watched by LLViewerInventoryMoveFromWorldObserver items from own processing. * Removed dependancy on LLPanelPlaces in open_inventory_offer(). Openning of offered LM via group notice moved into an appropriate section (processed by LLOpenTaskGroupOffer) Known Issues: * If Script item is among the dragged items from object to inventory it will be the only selected item in the inventory panel. Reason: it does not have its own Asset UUID and processed via LLOpenTaskOffer when should not. Reviewed by Leyla and Richard at https://codereview.productengine.com/secondlife/r/116/ --HG-- branch : product-engine --- indra/newview/llinventoryobserver.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'indra/newview/llinventoryobserver.h') diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index ba70552ebc..b710a9d326 100644 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -193,6 +193,36 @@ protected: uuid_vec_t mMIA; }; +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLInventoryMovedObserver +// +// This class is used as a base class for doing something when all the +// item for observed asset ids were added into the inventory. +// Derive a class from this class and implement the done() method to do +// something useful. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +class LLInventoryMoveFromWorldObserver : public LLInventoryObserver +{ +public: + LLInventoryMoveFromWorldObserver() : mIsDirty(false) {} + virtual void changed(U32 mask); + + void watchAsset(const LLUUID& asset_id); + bool isAssetWatched(const LLUUID& asset_id); + +protected: + virtual void onAssetAdded(const LLUUID& asset_id) {} + virtual void done() = 0; + + typedef std::vector item_ref_t; + item_ref_t mAddedItems; + item_ref_t mWatchedAssets; + +private: + bool mIsDirty; +}; + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLInventoryAddedObserver // -- cgit v1.2.3