From aa916288b1fb6cce42dda0e61a7d04117117d306 Mon Sep 17 00:00:00 2001 From: "maxim@mnikolenko" Date: Tue, 20 Aug 2013 12:07:54 +0300 Subject: MAINT-3005 FIXED Set max persistent notifications to reduce log-in time --- indra/newview/llpersistentnotificationstorage.cpp | 27 +++++++++++++++++------ 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'indra/newview/llpersistentnotificationstorage.cpp') diff --git a/indra/newview/llpersistentnotificationstorage.cpp b/indra/newview/llpersistentnotificationstorage.cpp index 666f10df96..c5104d54f2 100755 --- a/indra/newview/llpersistentnotificationstorage.cpp +++ b/indra/newview/llpersistentnotificationstorage.cpp @@ -76,6 +76,14 @@ void LLPersistentNotificationStorage::saveNotifications() } data.append(notification->asLLSD(true)); + if (data.size() >= gSavedSettings.getS32("MaxPersistentNotifications")) + { + llwarns << "Too many persistent notifications." + << " Saved " << gSavedSettings.getS32("MaxPersistentNotifications") << " of " << history_channel->size() + << " persistent notifications." << llendl; + break; + } + } writeNotifications(output); @@ -89,9 +97,6 @@ void LLPersistentNotificationStorage::loadNotifications() LL_INFOS("LLPersistentNotificationStorage") << "start loading notifications" << LL_ENDL; - LLNotifications::instance().getChannel("Persistent")-> - connectChanged(boost::bind(&LLPersistentNotificationStorage::onPersistentChannelChanged, this, _1)); - LLSD input; if (!readNotifications(input) ||input.isUndefined()) { @@ -109,9 +114,9 @@ void LLPersistentNotificationStorage::loadNotifications() findChannelByID(LLUUID(gSavedSettings.getString("NotificationChannelUUID")))); LLNotifications& instance = LLNotifications::instance(); - - for (LLSD::array_const_iterator notification_it = data.beginArray(); - notification_it != data.endArray(); + S32 processed_notifications = 0; + for (LLSD::reverse_array_iterator notification_it = data.rbeginArray(); + notification_it != data.rendArray(); ++notification_it) { LLSD notification_params = *notification_it; @@ -130,8 +135,16 @@ void LLPersistentNotificationStorage::loadNotifications() // hide saved toasts so they don't confuse the user notification_channel->hideToast(notification->getID()); } + ++processed_notifications; + if (processed_notifications >= gSavedSettings.getS32("MaxPersistentNotifications")) + { + llwarns << "Too many persistent notifications." + << " Processed " << gSavedSettings.getS32("MaxPersistentNotifications") << " of " << data.size() << " persistent notifications." << llendl; + break; + } } - + LLNotifications::instance().getChannel("Persistent")-> + connectChanged(boost::bind(&LLPersistentNotificationStorage::onPersistentChannelChanged, this, _1)); LL_INFOS("LLPersistentNotificationStorage") << "finished loading notifications" << LL_ENDL; } -- cgit v1.2.3 From 970ee73e9a9cd1c94c295c9decb4d632886c19e6 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 25 Oct 2013 11:48:43 -0700 Subject: Fix release merge issues (included upstream changes not yet in release from bear) --- indra/newview/llpersistentnotificationstorage.cpp | 25 +++++------------------ 1 file changed, 5 insertions(+), 20 deletions(-) (limited to 'indra/newview/llpersistentnotificationstorage.cpp') diff --git a/indra/newview/llpersistentnotificationstorage.cpp b/indra/newview/llpersistentnotificationstorage.cpp index d8fc2bee32..076c3e0235 100755 --- a/indra/newview/llpersistentnotificationstorage.cpp +++ b/indra/newview/llpersistentnotificationstorage.cpp @@ -77,14 +77,6 @@ void LLPersistentNotificationStorage::saveNotifications() } data.append(notification->asLLSD(true)); - if (data.size() >= gSavedSettings.getS32("MaxPersistentNotifications")) - { - llwarns << "Too many persistent notifications." - << " Saved " << gSavedSettings.getS32("MaxPersistentNotifications") << " of " << history_channel->size() - << " persistent notifications." << llendl; - break; - } - } writeNotifications(output); @@ -105,6 +97,7 @@ void LLPersistentNotificationStorage::loadNotifications() } mLoaded = true; + LLSD input; if (!readNotifications(input) ||input.isUndefined()) { @@ -122,9 +115,9 @@ void LLPersistentNotificationStorage::loadNotifications() findChannelByID(LLUUID(gSavedSettings.getString("NotificationChannelUUID")))); LLNotifications& instance = LLNotifications::instance(); - S32 processed_notifications = 0; - for (LLSD::reverse_array_iterator notification_it = data.rbeginArray(); - notification_it != data.rendArray(); + + for (LLSD::array_const_iterator notification_it = data.beginArray(); + notification_it != data.endArray(); ++notification_it) { LLSD notification_params = *notification_it; @@ -143,16 +136,8 @@ void LLPersistentNotificationStorage::loadNotifications() // hide saved toasts so they don't confuse the user notification_channel->hideToast(notification->getID()); } - ++processed_notifications; - if (processed_notifications >= gSavedSettings.getS32("MaxPersistentNotifications")) - { - llwarns << "Too many persistent notifications." - << " Processed " << gSavedSettings.getS32("MaxPersistentNotifications") << " of " << data.size() << " persistent notifications." << llendl; - break; - } } - LLNotifications::instance().getChannel("Persistent")-> - connectChanged(boost::bind(&LLPersistentNotificationStorage::onPersistentChannelChanged, this, _1)); + LL_INFOS("LLPersistentNotificationStorage") << "finished loading notifications" << LL_ENDL; } -- cgit v1.2.3