summaryrefslogtreecommitdiff
path: root/indra/llui/llnotifications.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/llnotifications.cpp')
-rw-r--r--indra/llui/llnotifications.cpp33
1 files changed, 17 insertions, 16 deletions
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index bee7d5bb3f..cd80e7f63f 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -266,7 +266,7 @@ LLSD LLNotificationForm::asLLSD() const
return mFormData;
}
-LLSD LLNotificationForm::getElement(const std::string& element_name)
+LLSD LLNotificationForm::getElement(std::string_view element_name)
{
for (LLSD::array_const_iterator it = mFormData.beginArray();
it != mFormData.endArray();
@@ -278,7 +278,7 @@ LLSD LLNotificationForm::getElement(const std::string& element_name)
}
-bool LLNotificationForm::hasElement(const std::string& element_name) const
+bool LLNotificationForm::hasElement(std::string_view element_name) const
{
for (LLSD::array_const_iterator it = mFormData.beginArray();
it != mFormData.endArray();
@@ -301,7 +301,7 @@ void LLNotificationForm::getElements(LLSD& elements, S32 offset)
}
}
-bool LLNotificationForm::getElementEnabled(const std::string& element_name) const
+bool LLNotificationForm::getElementEnabled(std::string_view element_name) const
{
for (LLSD::array_const_iterator it = mFormData.beginArray();
it != mFormData.endArray();
@@ -316,7 +316,7 @@ bool LLNotificationForm::getElementEnabled(const std::string& element_name) cons
return false;
}
-void LLNotificationForm::setElementEnabled(const std::string& element_name, bool enabled)
+void LLNotificationForm::setElementEnabled(std::string_view element_name, bool enabled)
{
for (LLSD::array_iterator it = mFormData.beginArray();
it != mFormData.endArray();
@@ -439,7 +439,7 @@ LLNotificationTemplate::LLNotificationTemplate(const LLNotificationTemplate::Par
mSoundName("")
{
if (p.sound.isProvided()
- && LLUI::getInstance()->mSettingGroups["config"]->controlExists(p.sound))
+ && LLUI::getInstance()->mSettingGroups["config"]->controlExists(p.sound()))
{
mSoundName = p.sound;
}
@@ -769,7 +769,7 @@ bool LLNotification::hasUniquenessConstraints() const
return (mTemplatep ? mTemplatep->mUnique : false);
}
-bool LLNotification::matchesTag(const std::string& tag)
+bool LLNotification::matchesTag(std::string_view tag)
{
bool result = false;
@@ -861,7 +861,7 @@ void LLNotification::init(const std::string& template_name, const LLSD& form_ele
for (LLStringUtil::format_map_t::const_iterator iter = default_args.begin();
iter != default_args.end(); ++iter)
{
- mSubstitutions[iter->first] = iter->second;
+ mSubstitutions[std::string(iter->first)] = iter->second;
}
mSubstitutions["_URL"] = getURL();
mSubstitutions["_NAME"] = template_name;
@@ -1443,11 +1443,12 @@ void LLNotifications::createDefaultChannels()
}
-LLNotificationTemplatePtr LLNotifications::getTemplate(const std::string& name)
+LLNotificationTemplatePtr LLNotifications::getTemplate(std::string_view name)
{
- if (mTemplates.count(name))
+ auto it = mTemplates.find(name);
+ if (it != mTemplates.end())
{
- return mTemplates[name];
+ return it->second;
}
else
{
@@ -1455,7 +1456,7 @@ LLNotificationTemplatePtr LLNotifications::getTemplate(const std::string& name)
}
}
-bool LLNotifications::templateExists(const std::string& name)
+bool LLNotifications::templateExists(std::string_view name)
{
return (mTemplates.count(name) != 0);
}
@@ -1740,7 +1741,7 @@ void LLNotifications::cancel(LLNotificationPtr pNotif)
}
}
-void LLNotifications::cancelByName(const std::string& name)
+void LLNotifications::cancelByName(std::string_view name)
{
LLMutexLock lock(&mItemsMutex);
std::vector<LLNotificationPtr> notifs_to_cancel;
@@ -1815,7 +1816,7 @@ LLNotificationPtr LLNotifications::find(LLUUID uuid)
}
}
-std::string LLNotifications::getGlobalString(const std::string& key) const
+std::string LLNotifications::getGlobalString(std::string_view key) const
{
GlobalStringMap::const_iterator it = mGlobalStrings.find(key);
if (it != mGlobalStrings.end())
@@ -1826,7 +1827,7 @@ std::string LLNotifications::getGlobalString(const std::string& key) const
{
// if we don't have the key as a global, return the key itself so that the error
// is self-diagnosing.
- return key;
+ return std::string(key);
}
}
@@ -1839,13 +1840,13 @@ bool LLNotifications::getIgnoreAllNotifications()
return mIgnoreAllNotifications;
}
-void LLNotifications::setIgnored(const std::string& name, bool ignored)
+void LLNotifications::setIgnored(std::string_view name, bool ignored)
{
LLNotificationTemplatePtr templatep = getTemplate(name);
templatep->mForm->setIgnored(ignored);
}
-bool LLNotifications::getIgnored(const std::string& name)
+bool LLNotifications::getIgnored(std::string_view name)
{
LLNotificationTemplatePtr templatep = getTemplate(name);
return (mIgnoreAllNotifications) || ( (templatep->mForm->getIgnoreType() != LLNotificationForm::IGNORE_NO) && (templatep->mForm->getIgnored()) );