summaryrefslogtreecommitdiff
path: root/indra/llui/llnotifications.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2014-05-13 10:02:26 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2014-05-13 10:02:26 -0400
commit7b9708a2e3aede6faef04bd546c497dc68264f58 (patch)
treec49b3779d7a1f2e94fa1d33396c882e3351a4797 /indra/llui/llnotifications.cpp
parentd0eb9658f2698b9c200991e84c1a60be48788e2c (diff)
parentd0ef02c23a7a37c8c9bfe3a86bae88bb811fc9fe (diff)
sunshine-external merge WIP
Diffstat (limited to 'indra/llui/llnotifications.cpp')
-rwxr-xr-xindra/llui/llnotifications.cpp47
1 files changed, 25 insertions, 22 deletions
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 5c288c3f03..025cd81d92 100755
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -246,7 +246,7 @@ LLNotificationForm::LLNotificationForm(const LLSD& sd)
}
else
{
- llwarns << "Invalid form data " << sd << llendl;
+ LL_WARNS() << "Invalid form data " << sd << LL_ENDL;
mFormData = LLSD::emptyArray();
}
}
@@ -438,11 +438,11 @@ LLNotificationTemplate::LLNotificationTemplate(const LLNotificationTemplate::Par
mUniqueContext.push_back(context.value);
}
- lldebugs << "notification \"" << mName << "\": tag count is " << p.tags.size() << llendl;
+ LL_DEBUGS() << "notification \"" << mName << "\": tag count is " << p.tags.size() << LL_ENDL;
BOOST_FOREACH(const LLNotificationTemplate::Tag& tag, p.tags)
{
- lldebugs << " tag \"" << std::string(tag.value) << "\"" << llendl;
+ LL_DEBUGS() << " tag \"" << std::string(tag.value) << "\"" << LL_ENDL;
mTags.push_back(tag.value);
}
@@ -516,7 +516,7 @@ LLNotification::LLNotification(const LLSDParamAdapter<Params>& p) :
LLSD LLNotification::asLLSD(bool excludeTemplateElements)
-{
+{
LLParamSDParser parser;
Params p;
@@ -544,12 +544,12 @@ LLSD LLNotification::asLLSD(bool excludeTemplateElements)
mForm->getElements(dynamicElements, templateForm->getNumElements());
p.form_elements = dynamicElements;
}
-
+
if(mResponder)
{
p.functor.responder_sd = mResponder->asLLSD();
}
-
+
if(!mResponseFunctorName.empty())
{
p.functor.name = mResponseFunctorName;
@@ -1208,6 +1208,9 @@ LLNotifications::LLNotifications()
{
mListener.reset(new LLNotificationsListener(*this));
LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Notification.Show", boost::bind(&LLNotifications::addFromCallback, this, _2));
+
+ // touch the instance tracker for notification channels, so that it will still be around in our destructor
+ LLInstanceTracker<LLNotificationChannel, std::string>::instanceCount();
}
void LLNotifications::clear()
@@ -1407,7 +1410,7 @@ void LLNotifications::forceResponse(const LLNotification::Params& params, S32 op
if (selected_item.isUndefined())
{
- llwarns << "Invalid option" << option << " for notification " << (std::string)params.name << llendl;
+ LL_WARNS() << "Invalid option" << option << " for notification " << (std::string)params.name << LL_ENDL;
return;
}
response[selected_item["name"].asString()] = true;
@@ -1441,12 +1444,12 @@ void replaceSubstitutionStrings(LLXMLNodePtr node, StringMap& replacements)
if (found != replacements.end())
{
replacement = found->second;
- lldebugs << "replaceSubstitutionStrings: value: \"" << value << "\" repl: \"" << replacement << "\"." << llendl;
+ LL_DEBUGS() << "replaceSubstitutionStrings: value: \"" << value << "\" repl: \"" << replacement << "\"." << LL_ENDL;
it->second->setValue(replacement);
}
else
{
- llwarns << "replaceSubstitutionStrings FAILURE: could not find replacement \"" << value << "\"." << llendl;
+ LL_WARNS() << "replaceSubstitutionStrings FAILURE: could not find replacement \"" << value << "\"." << LL_ENDL;
}
}
}
@@ -1485,7 +1488,7 @@ void addPathIfExists(const std::string& new_path, std::vector<std::string>& path
bool LLNotifications::loadTemplates()
{
- llinfos << "Reading notifications template" << llendl;
+ LL_INFOS() << "Reading notifications template" << LL_ENDL;
// Passing findSkinnedFilenames(constraint=LLDir::ALL_SKINS) makes it
// output all relevant pathnames instead of just the ones from the most
// specific skin.
@@ -1498,7 +1501,7 @@ bool LLNotifications::loadTemplates()
if (!success || root.isNull() || !root->hasName( "notifications" ))
{
- llerrs << "Problem reading XML from UI Notifications file: " << base_filename << llendl;
+ LL_ERRS() << "Problem reading XML from UI Notifications file: " << base_filename << LL_ENDL;
return false;
}
@@ -1508,7 +1511,7 @@ bool LLNotifications::loadTemplates()
if(!params.validateBlock())
{
- llerrs << "Problem reading XUI from UI Notifications file: " << base_filename << llendl;
+ LL_ERRS() << "Problem reading XUI from UI Notifications file: " << base_filename << LL_ENDL;
return false;
}
@@ -1556,7 +1559,7 @@ bool LLNotifications::loadTemplates()
mTemplates[notification.name] = LLNotificationTemplatePtr(new LLNotificationTemplate(notification));
}
- llinfos << "...done" << llendl;
+ LL_INFOS() << "...done" << LL_ENDL;
return true;
}
@@ -1574,7 +1577,7 @@ bool LLNotifications::loadVisibilityRules()
if(!params.validateBlock())
{
- llerrs << "Problem reading UI Notification Visibility Rules file: " << full_filename << llendl;
+ LL_ERRS() << "Problem reading UI Notification Visibility Rules file: " << full_filename << LL_ENDL;
return false;
}
@@ -1639,7 +1642,7 @@ void LLNotifications::add(const LLNotificationPtr pNotif)
LLNotificationSet::iterator it=mItems.find(pNotif);
if (it != mItems.end())
{
- llerrs << "Notification added a second time to the master notification channel." << llendl;
+ LL_ERRS() << "Notification added a second time to the master notification channel." << LL_ENDL;
}
updateItem(LLSD().with("sigtype", "add").with("id", pNotif->id()), pNotif);
@@ -1697,7 +1700,7 @@ LLNotificationPtr LLNotifications::find(LLUUID uuid)
LLNotificationSet::iterator it=mItems.find(target);
if (it == mItems.end())
{
- LL_DEBUGS("Notifications") << "Tried to dereference uuid '" << uuid << "' as a notification key but didn't find it." << llendl;
+ LL_DEBUGS("Notifications") << "Tried to dereference uuid '" << uuid << "' as a notification key but didn't find it." << LL_ENDL;
return LLNotificationPtr((LLNotification*)NULL);
}
else
@@ -1748,13 +1751,13 @@ bool LLNotifications::isVisibleByRules(LLNotificationPtr n)
for(it = mVisibilityRules.begin(); it != mVisibilityRules.end(); it++)
{
// An empty type/tag/name string will match any notification, so only do the comparison when the string is non-empty in the rule.
- lldebugs
+ LL_DEBUGS()
<< "notification \"" << n->getName() << "\" "
<< "testing against " << ((*it)->mVisible?"show":"hide") << " rule, "
<< "name = \"" << (*it)->mName << "\" "
<< "tag = \"" << (*it)->mTag << "\" "
<< "type = \"" << (*it)->mType << "\" "
- << llendl;
+ << LL_ENDL;
if(!(*it)->mType.empty())
{
@@ -1793,7 +1796,7 @@ bool LLNotifications::isVisibleByRules(LLNotificationPtr n)
if((*it)->mResponse.empty())
{
// Response property is empty. Cancel this notification.
- lldebugs << "cancelling notification " << n->getName() << llendl;
+ LL_DEBUGS() << "cancelling notification " << n->getName() << LL_ENDL;
cancel(n);
}
@@ -1804,7 +1807,7 @@ bool LLNotifications::isVisibleByRules(LLNotificationPtr n)
// TODO: verify that the response template has an item with the correct name
response[(*it)->mResponse] = true;
- lldebugs << "responding to notification " << n->getName() << " with response = " << response << llendl;
+ LL_DEBUGS() << "responding to notification " << n->getName() << " with response = " << response << LL_ENDL;
n->respond(response);
}
@@ -1816,7 +1819,7 @@ bool LLNotifications::isVisibleByRules(LLNotificationPtr n)
break;
}
- lldebugs << "allowing notification " << n->getName() << llendl;
+ LL_DEBUGS() << "allowing notification " << n->getName() << LL_ENDL;
return true;
}
@@ -1877,7 +1880,7 @@ void LLPostponedNotification::onAvatarNameCache(const LLUUID& agent_id,
// from PE merge - we should figure out if this is the right thing to do
if (name.empty())
{
- llwarns << "Empty name received for Id: " << agent_id << llendl;
+ LL_WARNS() << "Empty name received for Id: " << agent_id << LL_ENDL;
name = SYSTEM_FROM;
}