From 568d6ed229e6d8a32d761482e06828ccc61209a4 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 2 Apr 2010 15:19:44 -0400 Subject: EXT-5940 : INFRASTRUCTURE: Typedef all vector's Fixed some more typedefs that I missed in first checkin. --- indra/newview/llagentwearablesfetch.cpp | 8 ++++---- indra/newview/llappearancemgr.h | 2 +- indra/newview/llavatarlist.cpp | 7 ++++--- indra/newview/llavatarlist.h | 6 ++---- indra/newview/llcallfloater.cpp | 4 ++-- indra/newview/llgesturemgr.cpp | 2 +- indra/newview/llinventorybridge.cpp | 2 +- indra/newview/llinventoryobserver.cpp | 12 ++++++++---- indra/newview/llinventoryobserver.h | 16 ++++++---------- indra/newview/llpanelpeople.cpp | 6 +++--- indra/newview/llparticipantlist.cpp | 6 +++--- indra/newview/llsidepanelappearance.cpp | 2 +- indra/newview/lltooldraganddrop.cpp | 10 +++++----- indra/newview/llviewermenu.cpp | 2 +- indra/newview/llviewermessage.cpp | 6 +++--- 15 files changed, 45 insertions(+), 46 deletions(-) (limited to 'indra') diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp index 7a9ecd1c7f..1f22ba040d 100644 --- a/indra/newview/llagentwearablesfetch.cpp +++ b/indra/newview/llagentwearablesfetch.cpp @@ -89,7 +89,7 @@ void LLInitialWearablesFetch::processContents() class LLFetchAndLinkObserver: public LLInventoryFetchObserver { public: - LLFetchAndLinkObserver(LLInventoryFetchObserver::item_ref_t& ids): + LLFetchAndLinkObserver(uuid_vec_t& ids): m_ids(ids), LLInventoryFetchObserver(true) // retry for missing items { @@ -103,7 +103,7 @@ public: // Link to all fetched items in COF. LLPointer link_waiter = new LLUpdateAppearanceOnDestroy; - for (LLInventoryFetchObserver::item_ref_t::iterator it = m_ids.begin(); + for (uuid_vec_t::iterator it = m_ids.begin(); it != m_ids.end(); ++it) { @@ -124,7 +124,7 @@ public: } } private: - LLInventoryFetchObserver::item_ref_t m_ids; + uuid_vec_t m_ids; }; void LLInitialWearablesFetch::processWearablesMessage() @@ -132,7 +132,7 @@ void LLInitialWearablesFetch::processWearablesMessage() if (!mAgentInitialWearables.empty()) // We have an empty current outfit folder, use the message data instead. { const LLUUID current_outfit_id = LLAppearanceMgr::instance().getCOF(); - LLInventoryFetchObserver::item_ref_t ids; + uuid_vec_t ids; for (U8 i = 0; i < mAgentInitialWearables.size(); ++i) { // Populate the current outfit folder with links to the wearables passed in the message diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 5a499026e8..423d9bde69 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -298,7 +298,7 @@ public: } CallAfterCategoryFetchStage2 *stage2 = new CallAfterCategoryFetchStage2(mCallable); - LLInventoryFetchObserver::item_ref_t ids; + uuid_vec_t ids; for(S32 i = 0; i < count; ++i) { ids.push_back(item_array.get(i)->getUUID()); diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 6ec62a61a0..407c5b6153 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -39,6 +39,7 @@ #include "llcallingcard.h" // for LLAvatarTracker #include "llcachename.h" #include "llrecentpeople.h" +#include "lluuid.h" #include "llvoiceclient.h" #include "llviewercontrol.h" // for gSavedSettings @@ -53,7 +54,7 @@ static const unsigned ADD_LIMIT = 50; bool LLAvatarList::contains(const LLUUID& id) { - const uuid_vector_t& ids = getIDs(); + const uuid_vec_t& ids = getIDs(); return std::find(ids.begin(), ids.end(), id) != ids.end(); } @@ -303,9 +304,9 @@ void LLAvatarList::refresh() bool LLAvatarList::filterHasMatches() { - uuid_vector_t values = getIDs(); + uuid_vec_t values = getIDs(); - for (uuid_vector_t::const_iterator it=values.begin(); it != values.end(); it++) + for (uuid_vec_t::const_iterator it=values.begin(); it != values.end(); it++) { std::string name; const LLUUID& buddy_id = *it; diff --git a/indra/newview/llavatarlist.h b/indra/newview/llavatarlist.h index 5a55975413..0203617867 100644 --- a/indra/newview/llavatarlist.h +++ b/indra/newview/llavatarlist.h @@ -53,8 +53,6 @@ class LLAvatarList : public LLFlatListView { LOG_CLASS(LLAvatarList); public: - typedef uuid_vec_t uuid_vector_t; - struct Params : public LLInitParam::Block { Optional ignore_online_status, // show all items as online @@ -74,7 +72,7 @@ public: void setNameFilter(const std::string& filter); void setDirty(bool val = true, bool force_refresh = false); - uuid_vector_t& getIDs() { return mIDs; } + uuid_vec_t& getIDs() { return mIDs; } bool contains(const LLUUID& id); void setContextMenu(LLAvatarListItem::ContextMenu* menu) { mContextMenu = menu; } @@ -122,7 +120,7 @@ private: LLTimer* mLITUpdateTimer; // last interaction time update timer std::string mIconParamName; std::string mNameFilter; - uuid_vector_t mIDs; + uuid_vec_t mIDs; LLUUID mSessionID; LLAvatarListItem::ContextMenu* mContextMenu; diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 132e4f0933..df3fe522b5 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -660,8 +660,8 @@ void LLCallFloater::setVoiceRemoveTimer(const LLUUID& voice_speaker_id) bool LLCallFloater::removeVoiceLeftParticipant(const LLUUID& voice_speaker_id) { - LLAvatarList::uuid_vector_t& speaker_uuids = mAvatarList->getIDs(); - LLAvatarList::uuid_vector_t::iterator pos = std::find(speaker_uuids.begin(), speaker_uuids.end(), voice_speaker_id); + uuid_vec_t& speaker_uuids = mAvatarList->getIDs(); + uuid_vec_t::iterator pos = std::find(speaker_uuids.begin(), speaker_uuids.end(), voice_speaker_id); if(pos != speaker_uuids.end()) { speaker_uuids.erase(pos); diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index fbacbd704f..c13ebba923 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -1031,7 +1031,7 @@ void LLGestureMgr::onLoadComplete(LLVFS *vfs, else { // Watch this item and set gesture name when item exists in inventory - item_ref_t ids; + uuid_vec_t ids; ids.push_back(item_id); self.fetchItems(ids); } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 10a3713c1e..47d0837ba1 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2007,7 +2007,7 @@ void LLRightClickInventoryFetchDescendentsObserver::done() LLRightClickInventoryFetchObserver* outfit; outfit = new LLRightClickInventoryFetchObserver(mCompleteFolders.front(), mCopyItems); - LLInventoryFetchObserver::item_ref_t ids; + uuid_vec_t ids; for(S32 i = 0; i < count; ++i) { ids.push_back(item_array.get(i)->getUUID()); diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index 9913be2e88..128f16ecf5 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -108,6 +108,10 @@ void LLInventoryCompletionObserver::watchItem(const LLUUID& id) } } +LLInventoryFetchObserver::LLInventoryFetchObserver(bool retry_if_missing) : + mRetryIfMissing(retry_if_missing) +{ +} void LLInventoryFetchObserver::changed(U32 mask) { @@ -115,7 +119,7 @@ void LLInventoryFetchObserver::changed(U32 mask) // appropriate. if(!mIncomplete.empty()) { - for(item_ref_t::iterator it = mIncomplete.begin(); it < mIncomplete.end(); ) + for(uuid_vec_t::iterator it = mIncomplete.begin(); it < mIncomplete.end(); ) { LLViewerInventoryItem* item = gInventory.getItem(*it); if(!item) @@ -220,11 +224,11 @@ void fetch_items_from_llsd(const LLSD& items_llsd) } void LLInventoryFetchObserver::fetchItems( - const LLInventoryFetchObserver::item_ref_t& ids) + const uuid_vec_t& ids) { LLUUID owner_id; LLSD items_llsd; - for(item_ref_t::const_iterator it = ids.begin(); it < ids.end(); ++it) + for(uuid_vec_t::const_iterator it = ids.begin(); it < ids.end(); ++it) { LLViewerInventoryItem* item = gInventory.getItem(*it); if(item) @@ -475,7 +479,7 @@ void LLInventoryExistenceObserver::changed(U32 mask) // appropriate. if(!mMIA.empty()) { - for(item_ref_t::iterator it = mMIA.begin(); it < mMIA.end(); ) + for(uuid_vec_t::iterator it = mMIA.begin(); it < mMIA.end(); ) { LLViewerInventoryItem* item = gInventory.getItem(*it); if(!item) diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index e1c8bd3faf..14948f4e49 100644 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -109,19 +109,17 @@ protected: class LLInventoryFetchObserver : public LLInventoryObserver { public: - LLInventoryFetchObserver(bool retry_if_missing = false): mRetryIfMissing(retry_if_missing) {} + LLInventoryFetchObserver(bool retry_if_missing = false); virtual void changed(U32 mask); - typedef uuid_vec_t item_ref_t; - bool isEverythingComplete() const; - void fetchItems(const item_ref_t& ids); + void fetchItems(const uuid_vec_t& ids); virtual void done() {}; protected: bool mRetryIfMissing; - item_ref_t mComplete; - item_ref_t mIncomplete; + uuid_vec_t mComplete; + uuid_vec_t mIncomplete; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -192,10 +190,8 @@ public: protected: virtual void done() = 0; - - typedef uuid_vec_t item_ref_t; - item_ref_t mExist; - item_ref_t mMIA; + uuid_vec_t mExist; + uuid_vec_t mMIA; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 7f5e63adee..4c24670f47 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -652,8 +652,8 @@ void LLPanelPeople::updateFriendList() av_tracker.copyBuddyList(all_buddies); // save them to the online and all friends vectors - LLAvatarList::uuid_vector_t& online_friendsp = mOnlineFriendList->getIDs(); - LLAvatarList::uuid_vector_t& all_friendsp = mAllFriendList->getIDs(); + uuid_vec_t& online_friendsp = mOnlineFriendList->getIDs(); + uuid_vec_t& all_friendsp = mAllFriendList->getIDs(); all_friendsp.clear(); online_friendsp.clear(); @@ -746,7 +746,7 @@ void LLPanelPeople::buttonSetAction(const std::string& btn_name, const commit_si bool LLPanelPeople::isFriendOnline(const LLUUID& id) { - LLAvatarList::uuid_vector_t ids = mOnlineFriendList->getIDs(); + uuid_vec_t ids = mOnlineFriendList->getIDs(); return std::find(ids.begin(), ids.end(), id) != ids.end(); } diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index 268738d88c..79a6d80716 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -248,8 +248,8 @@ bool LLParticipantList::onAddItemEvent(LLPointer event, co bool LLParticipantList::onRemoveItemEvent(LLPointer event, const LLSD& userdata) { - LLAvatarList::uuid_vector_t& group_members = mAvatarList->getIDs(); - LLAvatarList::uuid_vector_t::iterator pos = std::find(group_members.begin(), group_members.end(), event->getValue().asUUID()); + uuid_vec_t& group_members = mAvatarList->getIDs(); + uuid_vec_t::iterator pos = std::find(group_members.begin(), group_members.end(), event->getValue().asUUID()); if(pos != group_members.end()) { group_members.erase(pos); @@ -260,7 +260,7 @@ bool LLParticipantList::onRemoveItemEvent(LLPointer event, bool LLParticipantList::onClearListEvent(LLPointer event, const LLSD& userdata) { - LLAvatarList::uuid_vector_t& group_members = mAvatarList->getIDs(); + uuid_vec_t& group_members = mAvatarList->getIDs(); group_members.clear(); mAvatarList->setDirty(); return true; diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 6d53f9c049..89c60fed34 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -354,7 +354,7 @@ void LLSidepanelAppearance::fetchInventory() { mNewOutfitBtn->setEnabled(false); - LLInventoryFetchObserver::item_ref_t ids; + uuid_vec_t ids; LLUUID item_id; for(S32 type = (S32)WT_SHAPE; type < (S32)WT_COUNT; ++type) { diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index f37efd778f..617518ab57 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -267,8 +267,8 @@ void LLCategoryDropObserver::done() { // *FIX: coalesce these... LLInventoryItem* item = NULL; - item_ref_t::iterator it = mComplete.begin(); - item_ref_t::iterator end = mComplete.end(); + uuid_vec_t::iterator it = mComplete.begin(); + uuid_vec_t::iterator end = mComplete.end(); for(; it < end; ++it) { item = gInventory.getItem(*it); @@ -326,8 +326,8 @@ void LLCategoryDropDescendentsObserver::done() { unique_ids.insert(items.get(i)->getUUID()); } - LLInventoryFetchObserver::item_ref_t ids; - std::back_insert_iterator copier(ids); + uuid_vec_t ids; + std::back_insert_iterator copier(ids); std::copy(unique_ids.begin(), unique_ids.end(), copier); LLCategoryDropObserver* dropper; dropper = new LLCategoryDropObserver(mObjectID, mSource); @@ -2567,7 +2567,7 @@ EAcceptance LLToolDragAndDrop::dad3dUpdateInventoryCategory( // If every item is accepted, send it on if (drop && (ACCEPT_YES_COPY_SINGLE <= rv)) { - LLInventoryFetchObserver::item_ref_t ids; + uuid_vec_t ids; for (LLInventoryModel::item_array_t::const_iterator item_iter = items.begin(); item_iter != items.end(); ++item_iter) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index a8b1257cf6..0277005a89 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -6153,7 +6153,7 @@ class LLAttachmentEnableDrop : public view_listener_t // if a fetch is already out there (being sent from a slow sim) // we refetch and there are 2 fetches LLWornItemFetchedObserver* wornItemFetched = new LLWornItemFetchedObserver(); - LLInventoryFetchObserver::item_ref_t items; //add item to the inventory item to be fetched + uuid_vec_t items; //add item to the inventory item to be fetched items.push_back((*attachment_iter)->getItemID()); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 7346b2a76e..9b39cbfdf1 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1203,7 +1203,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& // This is an offer from an agent. In this case, the back // end has already copied the items into your inventory, // so we can fetch it out of our inventory. - LLInventoryFetchObserver::item_ref_t items; + uuid_vec_t items; items.push_back(mObjectID); LLOpenAgentOffer* open_agent_offer = new LLOpenAgentOffer(from_string); open_agent_offer->fetchItems(items); @@ -1601,7 +1601,7 @@ void inventory_offer_handler(LLOfferInfo* info) p.name = "UserGiveItem"; // Prefetch the item into your local inventory. - LLInventoryFetchObserver::item_ref_t items; + uuid_vec_t items; items.push_back(info->mObjectID); LLInventoryFetchObserver* fetch_item = new LLInventoryFetchObserver(); fetch_item->fetchItems(items); @@ -2120,7 +2120,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) if (is_muted) { // Prefetch the offered item so that it can be discarded by the appropriate observer. (EXT-4331) - LLInventoryFetchObserver::item_ref_t items; + uuid_vec_t items; items.push_back(info->mObjectID); LLInventoryFetchObserver* fetch_item = new LLInventoryFetchObserver(); fetch_item->fetchItems(items); -- cgit v1.2.3 From 9007cf3a535bc6028ca700855745130cd4baaff3 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 2 Apr 2010 17:12:13 -0400 Subject: EXT-6696 : Make Library inventory items somehow distinguishable at first glance from My Inventory items Library items are now set to Emphasis Color. This can be easily changed. Also fixed an issue where the "(Loading...)" string was overlapping with folder inventory strings. --- indra/newview/llfolderviewitem.cpp | 16 +++++++++------- indra/newview/skins/default/colors.xml | 3 +++ 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 0a2a33d220..3208218302 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -834,13 +834,17 @@ void LLFolderViewItem::draw() static LLUIColor sFocusOutlineColor = LLUIColorTable::instance().getColor("InventoryFocusOutlineColor", DEFAULT_WHITE); static LLUIColor sFilterBGColor = LLUIColorTable::instance().getColor("FilterBackgroundColor", DEFAULT_WHITE); static LLUIColor sFilterTextColor = LLUIColorTable::instance().getColor("FilterTextColor", DEFAULT_WHITE); - static LLUIColor sSuffixColor = LLUIColorTable::instance().getColor("InventoryItemSuffixColor", DEFAULT_WHITE); + static LLUIColor sSuffixColor = LLUIColorTable::instance().getColor("InventoryItemColor", DEFAULT_WHITE); + static LLUIColor sLibraryColor = LLUIColorTable::instance().getColor("InventoryItemLibraryColor", DEFAULT_WHITE); static LLUIColor sSearchStatusColor = LLUIColorTable::instance().getColor("InventorySearchStatusColor", DEFAULT_WHITE); + const Params& default_params = LLUICtrlFactory::getDefaultParams(); const S32 TOP_PAD = default_params.item_top_pad; const S32 FOCUS_LEFT = 1; const LLFontGL* font = getLabelFontForStyle(mLabelStyle); + const BOOL in_inventory = getListener() && gInventory.isObjectDescendentOf(getListener()->getUUID(), gInventory.getRootFolderID()); + const BOOL in_library = getListener() && gInventory.isObjectDescendentOf(getListener()->getUUID(), gInventory.getLibraryRootFolderID()); //--------------------------------------------------------------------------------// // Draw open folder arrow @@ -961,6 +965,8 @@ void LLFolderViewItem::draw() } LLColor4 color = (mIsSelected && filled) ? sHighlightFgColor : sFgColor; + if (in_library) color = sLibraryColor; + F32 right_x = 0; F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)TEXT_PAD - (F32)TOP_PAD; F32 text_left = (F32)(ARROW_SIZE + TEXT_PAD + ICON_WIDTH + ICON_PAD + mIndentation); @@ -982,8 +988,6 @@ void LLFolderViewItem::draw() S32_MAX, S32_MAX, &right_x, FALSE ); text_left = right_x; } - - //--------------------------------------------------------------------------------// // Draw the actual label text // @@ -995,13 +999,11 @@ void LLFolderViewItem::draw() // Draw "Loading..." text // bool root_is_loading = false; - if (getListener() && gInventory.isObjectDescendentOf(getListener()->getUUID(), - gInventory.getRootFolderID())) // Descendent of my inventory + if (in_inventory) { root_is_loading = LLInventoryModelBackgroundFetch::instance().inventoryFetchInProgress(); } - if (getListener() && gInventory.isObjectDescendentOf(getListener()->getUUID(), - gInventory.getLibraryRootFolderID())) // Descendent of library + if (in_library) { root_is_loading = LLInventoryModelBackgroundFetch::instance().libraryFetchInProgress(); } diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index 0a906a8063..b067e07c81 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -420,6 +420,9 @@ + -- cgit v1.2.3 From 7187f08e89ca1d10fb872070dc6381a0a926f57d Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 6 Apr 2010 15:13:15 +0100 Subject: wtf-fix for using \\ instead of // as a comment. --- indra/newview/tests/llviewernetwork_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/tests/llviewernetwork_test.cpp b/indra/newview/tests/llviewernetwork_test.cpp index f9f42cfc86..e0c7c83f4b 100644 --- a/indra/newview/tests/llviewernetwork_test.cpp +++ b/indra/newview/tests/llviewernetwork_test.cpp @@ -216,10 +216,10 @@ namespace tut #ifndef LL_RELEASE_FOR_DOWNLOAD ensure_equals("Agni grid label was not modified by grid file", grid[GRID_LABEL_VALUE].asString(), std::string("Agni")); -#else \\ LL_RELEASE_FOR_DOWNLOAD +#else // LL_RELEASE_FOR_DOWNLOAD ensure_equals("Agni grid label was not modified by grid file", grid[GRID_LABEL_VALUE].asString(), std::string("Secondlife.com")); -#endif \\ LL_RELEASE_FOR_DOWNLOAD +#endif // LL_RELEASE_FOR_DOWNLOAD ensure_equals("Agni name wasn't modified by grid file", grid[GRID_VALUE].asString(), std::string("util.agni.lindenlab.com")); -- cgit v1.2.3