From cc92525b0df952659102d2e5adcc4140fea7f371 Mon Sep 17 00:00:00 2001 From: Adam Moss Date: Mon, 4 May 2009 17:43:26 +0000 Subject: QAR-1476 Combo-merge to trunk: Viewer 1.23 RC0 and Simulator 1.26.3 svn merge -r118927:118939 svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-1.23.0-merge-2-combo-QAR-1476 this is a composite of... svn merge -r115088:118182 svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer_1-23 conflicts resolved: C doc/contributions.txt C indra/llaudio/audioengine.cpp C indra/newview/CMakeLists.txt C indra/newview/llfloaterlandholdings.cpp C indra/newview/llpaneldirbrowser.cpp C indra/newview/llpanelgrouplandmoney.cpp C indra/newview/llpreviewscript.cpp C indra/newview/llviewermenu.cpp C indra/newview/skins/default/xui/en-us/notifications.xml and... svn merge -r116937:118673 svn+ssh://svn.lindenlab.com/svn/linden/branches/server/server-1.26 minor-to-trivial conflicts resolved: C indra/llcommon/llversionserver.h C indra/newsim/llrezdata.cpp C indra/newsim/llstate.cpp C indra/upgrade/schema_version/sequence/3/index_log_paypal.sql --- indra/llui/llnotifications.cpp | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'indra/llui/llnotifications.cpp') diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 2fd1056f20..2ae96726af 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -49,7 +49,7 @@ class LLNotificationHistoryChannel : public LLNotificationChannel LOG_CLASS(LLNotificationHistoryChannel); public: LLNotificationHistoryChannel(const std::string& filename) : - LLNotificationChannel("History", "Visible", &historyFilter), + LLNotificationChannel("History", "Visible", &historyFilter, LLNotificationComparators::orderByUUID()), mFileName(filename) { connectChanged(boost::bind(&LLNotificationHistoryChannel::historyHandler, this, _1)); @@ -858,6 +858,20 @@ bool LLNotificationChannelBase::updateItem(const LLSD& payload, LLNotificationPt return abortProcessing; } +/* static */ +LLNotificationChannelPtr LLNotificationChannel::buildChannel(const std::string& name, + const std::string& parent, + LLNotificationFilter filter, + LLNotificationComparator comparator) +{ + // note: this is not a leak; notifications are self-registering. + // This factory helps to prevent excess deletions by making sure all smart + // pointers to notification channels come from the same source + new LLNotificationChannel(name, parent, filter, comparator); + return LLNotifications::instance().getChannel(name); +} + + LLNotificationChannel::LLNotificationChannel(const std::string& name, const std::string& parent, LLNotificationFilter filter, @@ -1054,21 +1068,22 @@ void LLNotifications::createDefaultChannels() { // now construct the various channels AFTER loading the notifications, // because the history channel is going to rewrite the stored notifications file - new LLNotificationChannel("Expiration", "", + LLNotificationChannel::buildChannel("Expiration", "", boost::bind(&LLNotifications::expirationFilter, this, _1)); - new LLNotificationChannel("Unexpired", "", + LLNotificationChannel::buildChannel("Unexpired", "", !boost::bind(&LLNotifications::expirationFilter, this, _1)); // use negated bind - new LLNotificationChannel("Unique", "Unexpired", + LLNotificationChannel::buildChannel("Unique", "Unexpired", boost::bind(&LLNotifications::uniqueFilter, this, _1)); - new LLNotificationChannel("Ignore", "Unique", + LLNotificationChannel::buildChannel("Ignore", "Unique", filterIgnoredNotifications); - new LLNotificationChannel("Visible", "Ignore", + LLNotificationChannel::buildChannel("Visible", "Ignore", &LLNotificationFilters::includeEverything); // create special history channel //std::string notifications_log_file = gDirUtilp->getExpandedFilename ( LL_PATH_PER_SL_ACCOUNT, "open_notifications.xml" ); // use ^^^ when done debugging notifications serialization std::string notifications_log_file = gDirUtilp->getExpandedFilename ( LL_PATH_USER_SETTINGS, "open_notifications.xml" ); + // this isn't a leak, don't worry about the empty "new" new LLNotificationHistoryChannel(notifications_log_file); // connect action methods to these channels -- cgit v1.2.3