Commit ff662f0e authored by Cinder's avatar Cinder
Browse files

Const some methods

parent a6298e17
......@@ -151,7 +151,7 @@ void LLAvatarTracker::setTrackedCoarseLocation(const LLVector3d& global_pos)
}
}
bool LLAvatarTracker::haveTrackingInfo()
bool LLAvatarTracker::haveTrackingInfo() const
{
if(mTrackingData)
{
......@@ -160,7 +160,7 @@ bool LLAvatarTracker::haveTrackingInfo()
return false;
}
LLVector3d LLAvatarTracker::getGlobalPos()
LLVector3d LLAvatarTracker::getGlobalPos() const
{
if(!mTrackedAgentValid || !mTrackingData) return LLVector3d();
LLVector3d global_pos;
......@@ -186,7 +186,7 @@ LLVector3d LLAvatarTracker::getGlobalPos()
void LLAvatarTracker::getDegreesAndDist(F32& rot,
F64& horiz_dist,
F64& vert_dist)
F64& vert_dist) const
{
if(!mTrackingData) return;
......@@ -236,7 +236,7 @@ S32 LLAvatarTracker::addBuddyList(const buddy_map_t& buds)
LLAvatarNameCache::get(agent_id, &av_name);
addChangedMask(LLFriendObserver::ADD, agent_id);
LL_DEBUGS() << "Added buddy " << agent_id
LL_INFOS() << "Added buddy " << agent_id
<< ", " << (mBuddyInfo[agent_id]->isOnline() ? "Online" : "Offline")
<< ", TO: " << mBuddyInfo[agent_id]->getRightsGrantedTo()
<< ", FROM: " << mBuddyInfo[agent_id]->getRightsGrantedFrom()
......
......@@ -89,9 +89,9 @@ public:
void setTrackedCoarseLocation(const LLVector3d& global_pos);
// dealing with the tracked agent location
bool haveTrackingInfo();
void getDegreesAndDist(F32& rot, F64& horiz_dist, F64& vert_dist);
LLVector3d getGlobalPos();
bool haveTrackingInfo() const;
void getDegreesAndDist(F32& rot, F64& horiz_dist, F64& vert_dist) const;
LLVector3d getGlobalPos() const;
// Get the name passed in, returns null string if uninitialized.
const std::string& getName() const;
......
......@@ -202,7 +202,7 @@ const LLUUID LLFriendCardsManager::extractAvatarID(const LLUUID& avatarID)
return rv;
}
bool LLFriendCardsManager::isItemInAnyFriendsList(const LLViewerInventoryItem* item)
bool LLFriendCardsManager::isItemInAnyFriendsList(const LLViewerInventoryItem* item) const
{
if (item->getType() != LLAssetType::AT_CALLINGCARD)
return false;
......@@ -346,13 +346,13 @@ const LLUUID& LLFriendCardsManager::findFriendAllSubfolderUUIDImpl() const
return findChildFolderUUID(friendFolderUUID, friendAllSubfolderName);
}
const LLUUID& LLFriendCardsManager::findChildFolderUUID(const LLUUID& parentFolderUUID, const std::string& nonLocalizedName) const
const LLUUID& LLFriendCardsManager::findChildFolderUUID(const LLUUID& parentFolderUUID, const std::string& nonLocalizedName)
{
LLNameCategoryCollector matchFolderFunctor(nonLocalizedName);
return get_folder_uuid(parentFolderUUID, matchFolderFunctor);
}
const LLUUID& LLFriendCardsManager::findFriendCardInventoryUUIDImpl(const LLUUID& avatarID)
const LLUUID& LLFriendCardsManager::findFriendCardInventoryUUIDImpl(const LLUUID& avatarID) const
{
LLUUID friendAllSubfolderUUID = findFriendAllSubfolderUUIDImpl();
LLInventoryModel::cat_array_t cats;
......@@ -395,7 +395,7 @@ void LLFriendCardsManager::findMatchedFriendCards(const LLUUID& avatarID, LLInve
}
}
void LLFriendCardsManager::fetchAndCheckFolderDescendents(const LLUUID& folder_id, callback_t cb)
void LLFriendCardsManager::fetchAndCheckFolderDescendents(const LLUUID& folder_id, callback_t cb) const
{
// This instance will be deleted in LLInitialFriendCardsFetch::done().
LLInitialFriendCardsFetch* fetch = new LLInitialFriendCardsFetch(folder_id, cb);
......@@ -600,11 +600,9 @@ void LLFriendCardsManager::onFriendListUpdate(U32 changed_mask)
// Try to add cards into inventory.
// If cards already exist they won't be created.
const std::set<LLUUID>& changed_items = at.getChangedIDs();
std::set<LLUUID>::const_iterator id_it = changed_items.cbegin();
std::set<LLUUID>::const_iterator id_end = changed_items.cend();
for (; id_it != id_end; ++id_it)
for (const auto card : changed_items)
{
cards_manager.addFriendCardToInventory(*id_it);
cards_manager.addFriendCardToInventory(card);
}
}
else
......@@ -623,11 +621,9 @@ void LLFriendCardsManager::onFriendListUpdate(U32 changed_mask)
case LLFriendObserver::REMOVE:
{
const std::set<LLUUID>& changed_items = at.getChangedIDs();
std::set<LLUUID>::const_iterator id_it = changed_items.cbegin();
std::set<LLUUID>::const_iterator id_end = changed_items.cend();
for (;id_it != id_end; ++id_it)
for (const auto card : changed_items)
{
LLFriendCardsManager::instance().removeFriendCardFromInventory(*id_it);
LLFriendCardsManager::instance().removeFriendCardFromInventory(card);
}
}
......
......@@ -64,7 +64,7 @@ public:
* Determines if specified Inventory Calling Card exists in any of lists
* in the Calling Card/Friends/ folder (Default, or Custom)
*/
bool isItemInAnyFriendsList(const LLViewerInventoryItem* item);
bool isItemInAnyFriendsList(const LLViewerInventoryItem* item) const;
/**
* Checks if specified category is contained in the Calling Card/Friends folder and
......@@ -115,13 +115,13 @@ private:
return (mBuddyIDSet.end() != mBuddyIDSet.find(avatarID));
}
const LLUUID& findChildFolderUUID(const LLUUID& parentFolderUUID, const std::string& nonLocalizedName) const;
static const LLUUID& findChildFolderUUID(const LLUUID& parentFolderUUID, const std::string& nonLocalizedName);
const LLUUID& findFriendFolderUUIDImpl() const;
const LLUUID& findFriendAllSubfolderUUIDImpl() const;
const LLUUID& findFriendCardInventoryUUIDImpl(const LLUUID& avatarID);
const LLUUID& findFriendCardInventoryUUIDImpl(const LLUUID& avatarID) const;
void findMatchedFriendCards(const LLUUID& avatarID, LLInventoryModel::item_array_t& items) const;
void fetchAndCheckFolderDescendents(const LLUUID& folder_id, callback_t cb);
void fetchAndCheckFolderDescendents(const LLUUID& folder_id, callback_t cb) const;
/**
* Checks whether "Calling Cards/Friends" folder exists. If not, creates it with "All"
......
......@@ -319,7 +319,7 @@ public:
LLAvatarTracker::instance().removeObserver(this);
}
/*virtual*/ void changed(U32 mask) override
void changed(U32 mask) override
{
if (mIsActive)
{
......@@ -333,7 +333,7 @@ public:
}
/*virtual*/ BOOL tick() override
BOOL tick() override
{
if (!mIsActive) return FALSE;
......@@ -349,7 +349,6 @@ public:
return FALSE;
}
// virtual
void setActive(bool active) override
{
mIsActive = active;
......@@ -379,7 +378,6 @@ private:
friend class LLFriendListUpdater;
private:
LLInventoryFriendCardObserver(LLFriendListUpdater* updater) : mUpdater(updater)
{
gInventory.addObserver(this);
......@@ -388,7 +386,7 @@ private:
{
gInventory.removeObserver(this);
}
/*virtual*/ void changed(U32 mask) override
void changed(U32 mask) override
{
LL_DEBUGS() << "Inventory changed: " << mask << LL_ENDL;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment