summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterpreference.cpp
diff options
context:
space:
mode:
authorAlexander Gavriliuk <alexandrgproductengine@lindenlab.com>2024-05-06 16:52:34 +0200
committerGuru <alexandrgproductengine@lindenlab.com>2024-05-07 10:18:51 +0200
commitf9473e8afcb624cc1b101195bf15943ec372b56f (patch)
tree27a9f85fa0ca8c9dd2138a5522e7a7970a063941 /indra/newview/llfloaterpreference.cpp
parent15d4db0b5d52097de33ea036b8a1a4b7f5384e3f (diff)
secondlife/viewer#1333 BOOL to bool conversion leftovers: ternaries
Diffstat (limited to 'indra/newview/llfloaterpreference.cpp')
-rw-r--r--indra/newview/llfloaterpreference.cpp86
1 files changed, 41 insertions, 45 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index b1db7bc4f4..b503fc3630 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -1244,7 +1244,7 @@ void LLFloaterPreference::refreshEnabledState()
ctrl_pbr->setEnabled(true);
// Cannot have floater active until caps have been received
- getChild<LLButton>("default_creation_permissions")->setEnabled(LLStartUp::getStartupState() < STATE_STARTED ? false : true);
+ getChild<LLButton>("default_creation_permissions")->setEnabled(LLStartUp::getStartupState() >= STATE_STARTED);
getChildView("block_list")->setEnabled(LLLoginInstance::getInstance()->authSuccess());
}
@@ -3281,9 +3281,9 @@ void LLFloaterPreferenceProxy::onChangeSocksSettings()
// Check for invalid states for the other HTTP proxy radio
LLRadioGroup* otherHttpProxy = getChild<LLRadioGroup>("other_http_proxy_type");
if ((otherHttpProxy->getSelectedValue().asString() == "Socks" &&
- getChild<LLCheckBoxCtrl>("socks_proxy_enabled")->get() == false )||(
+ !getChild<LLCheckBoxCtrl>("socks_proxy_enabled")->get())||(
otherHttpProxy->getSelectedValue().asString() == "Web" &&
- getChild<LLCheckBoxCtrl>("web_proxy_enabled")->get() == false ) )
+ !getChild<LLCheckBoxCtrl>("web_proxy_enabled")->get()))
{
otherHttpProxy->selectFirstItem();
}
@@ -3292,10 +3292,10 @@ void LLFloaterPreferenceProxy::onChangeSocksSettings()
void LLFloaterPreference::onUpdateFilterTerm(bool force)
{
- LLWString seachValue = utf8str_to_wstring( mFilterEdit->getValue() );
- LLWStringUtil::toLower( seachValue );
+ LLWString seachValue = utf8str_to_wstring(mFilterEdit->getValue());
+ LLWStringUtil::toLower(seachValue);
- if( !mSearchData || (mSearchData->mLastFilter == seachValue && !force))
+ if (!mSearchData || (mSearchData->mLastFilter == seachValue && !force))
return;
if (mSearchDataDirty)
@@ -3306,14 +3306,13 @@ void LLFloaterPreference::onUpdateFilterTerm(bool force)
mSearchData->mLastFilter = seachValue;
- if( !mSearchData->mRootTab )
+ if (!mSearchData->mRootTab)
return;
mSearchData->mRootTab->hightlightAndHide( seachValue );
filterIgnorableNotifications();
- LLTabContainer *pRoot = getChild< LLTabContainer >( "pref core" );
- if( pRoot )
+ if (LLTabContainer* pRoot = getChild<LLTabContainer>("pref core"))
pRoot->selectFirstTab();
}
@@ -3330,72 +3329,69 @@ void LLFloaterPreference::filterIgnorableNotifications()
void collectChildren( LLView const *aView, ll::prefs::PanelDataPtr aParentPanel, ll::prefs::TabContainerDataPtr aParentTabContainer )
{
- if( !aView )
+ if (!aView)
return;
- llassert_always( aParentPanel || aParentTabContainer );
-
- LLView::child_list_const_iter_t itr = aView->beginChild();
- LLView::child_list_const_iter_t itrEnd = aView->endChild();
+ llassert_always(aParentPanel || aParentTabContainer);
- while( itr != itrEnd )
+ for (LLView* pView : *aView->getChildList())
{
- LLView *pView = *itr;
+ if (!pView)
+ continue;
+
ll::prefs::PanelDataPtr pCurPanelData = aParentPanel;
ll::prefs::TabContainerDataPtr pCurTabContainer = aParentTabContainer;
- if( !pView )
- continue;
- LLPanel const *pPanel = dynamic_cast< LLPanel const *>( pView );
- LLTabContainer const *pTabContainer = dynamic_cast< LLTabContainer const *>( pView );
- ll::ui::SearchableControl const *pSCtrl = dynamic_cast< ll::ui::SearchableControl const *>( pView );
- if( pTabContainer )
+ LLPanel const *pPanel = dynamic_cast<LLPanel const*>(pView);
+ LLTabContainer const *pTabContainer = dynamic_cast<LLTabContainer const*>(pView);
+ ll::ui::SearchableControl const *pSCtrl = dynamic_cast<ll::ui::SearchableControl const*>( pView );
+
+ if (pTabContainer)
{
pCurPanelData.reset();
- pCurTabContainer = ll::prefs::TabContainerDataPtr( new ll::prefs::TabContainerData );
- pCurTabContainer->mTabContainer = const_cast< LLTabContainer *>( pTabContainer );
+ pCurTabContainer = ll::prefs::TabContainerDataPtr(new ll::prefs::TabContainerData);
+ pCurTabContainer->mTabContainer = const_cast< LLTabContainer *>(pTabContainer);
pCurTabContainer->mLabel = pTabContainer->getLabel();
pCurTabContainer->mPanel = 0;
- if( aParentPanel )
- aParentPanel->mChildPanel.push_back( pCurTabContainer );
- if( aParentTabContainer )
- aParentTabContainer->mChildPanel.push_back( pCurTabContainer );
+ if (aParentPanel)
+ aParentPanel->mChildPanel.push_back(pCurTabContainer);
+ if (aParentTabContainer)
+ aParentTabContainer->mChildPanel.push_back(pCurTabContainer);
}
- else if( pPanel )
+ else if (pPanel)
{
pCurTabContainer.reset();
- pCurPanelData = ll::prefs::PanelDataPtr( new ll::prefs::PanelData );
+ pCurPanelData = ll::prefs::PanelDataPtr(new ll::prefs::PanelData);
pCurPanelData->mPanel = pPanel;
pCurPanelData->mLabel = pPanel->getLabel();
llassert_always( aParentPanel || aParentTabContainer );
- if( aParentTabContainer )
- aParentTabContainer->mChildPanel.push_back( pCurPanelData );
- else if( aParentPanel )
- aParentPanel->mChildPanel.push_back( pCurPanelData );
+ if (aParentTabContainer)
+ aParentTabContainer->mChildPanel.push_back(pCurPanelData);
+ else if (aParentPanel)
+ aParentPanel->mChildPanel.push_back(pCurPanelData);
}
- else if( pSCtrl && pSCtrl->getSearchText().size() )
+ else if (pSCtrl && pSCtrl->getSearchText().size())
{
- ll::prefs::SearchableItemPtr item = ll::prefs::SearchableItemPtr( new ll::prefs::SearchableItem() );
+ ll::prefs::SearchableItemPtr item = ll::prefs::SearchableItemPtr(new ll::prefs::SearchableItem());
item->mView = pView;
item->mCtrl = pSCtrl;
- item->mLabel = utf8str_to_wstring( pSCtrl->getSearchText() );
- LLWStringUtil::toLower( item->mLabel );
+ item->mLabel = utf8str_to_wstring(pSCtrl->getSearchText());
+ LLWStringUtil::toLower(item->mLabel);
- llassert_always( aParentPanel || aParentTabContainer );
+ llassert_always(aParentPanel || aParentTabContainer);
- if( aParentPanel )
- aParentPanel->mChildren.push_back( item );
- if( aParentTabContainer )
- aParentTabContainer->mChildren.push_back( item );
+ if (aParentPanel)
+ aParentPanel->mChildren.push_back(item);
+ if (aParentTabContainer)
+ aParentTabContainer->mChildren.push_back(item);
}
- collectChildren( pView, pCurPanelData, pCurTabContainer );
- ++itr;
+ collectChildren(pView, pCurPanelData, pCurTabContainer);
}
}