Permalink
Browse files

Media filter C++11 changes.

  • Loading branch information...
1 parent b7edebf commit b26bd2932504501b6612d86a5fe5b8dd484e3428 @Lirusaito Lirusaito committed Jul 16, 2016
Showing with 10 additions and 10 deletions.
  1. +4 −4 indra/newview/llfloatermediafilter.cpp
  2. +6 −6 indra/newview/llmediafilter.cpp
@@ -77,11 +77,11 @@ void LLFloaterMediaFilter::updateLists(LLMediaFilter::EMediaList list_type)
const LLMediaFilter::string_list_t& list = white ? inst.getWhiteList() : inst.getBlackList();
LLScrollListCtrl* scroll(white ? mWhitelist : mBlacklist);
scroll->clearRows();
- for (LLMediaFilter::string_list_t::const_iterator itr = list.begin(); itr != list.end(); ++itr)
+ for (const auto& value : list)
{
LLSD element;
element["columns"][0]["column"] = "list";
- element["columns"][0]["value"] = (*itr);
+ element["columns"][0]["value"] = value;
scroll->addElement(element);
}
enableButton(getChildView(white ? "remove_whitelist" : "remove_blacklist"), scroll);
@@ -103,9 +103,9 @@ void LLFloaterMediaFilter::onRemoveFromList(bool white)
{
std::vector<LLScrollListItem*> selected = (white ? mWhitelist : mBlacklist)->getAllSelected();
LLMediaFilter::string_vec_t domains;
- for (std::vector<LLScrollListItem*>::iterator itr = selected.begin(); itr != selected.end(); ++itr)
+ for (auto* item : selected)
{
- domains.push_back((*itr)->getColumn(0)->getValue().asString());
+ domains.push_back(item->getColumn(0)->getValue().asString());
}
LLMediaFilter::getInstance()->removeFromMediaList(domains, white ? LLMediaFilter::WHITELIST : LLMediaFilter::BLACKLIST);
}
@@ -161,9 +161,9 @@ void LLMediaFilter::addToMediaList(const std::string& in_url, EMediaList list, b
string_list_t& p_list(list == WHITELIST ? mWhiteList : mBlackList);
// Check for duplicates
- for (string_list_t::const_iterator itr = p_list.begin(); itr != p_list.end(); ++itr)
+ for (const auto& p : p_list)
{
- if (url == *itr)
+ if (url == p)
{
LL_INFOS("MediaFilter") << "URL " << url << " already in list!" << LL_ENDL;
return;
@@ -177,8 +177,8 @@ void LLMediaFilter::addToMediaList(const std::string& in_url, EMediaList list, b
void LLMediaFilter::removeFromMediaList(string_vec_t domains, EMediaList list)
{
if (domains.empty()) return;
- for (string_vec_t::const_iterator itr = domains.begin(); itr != domains.end(); ++itr)
- (list == WHITELIST ? mWhiteList : mBlackList).remove(*itr);
+ for (const auto& domain : domains)
+ (list == WHITELIST ? mWhiteList : mBlackList).remove(domain);
mMediaListUpdate(list);
saveMediaFilterToDisk();
}
@@ -221,10 +221,10 @@ void LLMediaFilter::loadMediaFilterFromDisk()
void medialist_to_llsd(const LLMediaFilter::string_list_t& list, LLSD& list_llsd, const LLSD& action)
{
- for (LLMediaFilter::string_list_t::const_iterator itr = list.begin(); itr != list.end(); ++itr)
+ for (const auto& domain : list)
{
LLSD item;
- item["domain"] = *itr;
+ item["domain"] = domain;
item["action"] = action;
list_llsd.append(item);
}

0 comments on commit b26bd29

Please sign in to comment.