summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorRichard Linden <none@none>2012-05-21 17:16:11 -0700
committerRichard Linden <none@none>2012-05-21 17:16:11 -0700
commit61bc25211be31ad28b8ae342c17b4ea1c32d955c (patch)
tree05f7e0fd17bda6273fdf55cda379fd5596bbcd16 /indra/newview
parent4c7142f4836da9da77ac6ff2910aaa19506a655b (diff)
CHUI-111 FIX Saved notifications are not sorted in same order after logout and relog.
sort notifications in separate list llnotification now uses param block to serialize to llsd
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llnotificationstorage.cpp18
-rw-r--r--indra/newview/lltoastnotifypanel.cpp24
2 files changed, 14 insertions, 28 deletions
diff --git a/indra/newview/llnotificationstorage.cpp b/indra/newview/llnotificationstorage.cpp
index fb1adc7ddf..a31b95811e 100644
--- a/indra/newview/llnotificationstorage.cpp
+++ b/indra/newview/llnotificationstorage.cpp
@@ -84,9 +84,11 @@ bool LLPersistentNotificationStorage::onPersistentChannelChanged(const LLSD& pay
return false;
}
+static LLFastTimer::DeclareTimer FTM_SAVE_NOTIFICATIONS("Save Notifications");
+
void LLPersistentNotificationStorage::saveNotifications()
{
- // TODO - think about save optimization.
+ LLFastTimer _(FTM_SAVE_NOTIFICATIONS);
llofstream notify_file(mFileName.c_str());
if (!notify_file.is_open())
@@ -98,10 +100,15 @@ void LLPersistentNotificationStorage::saveNotifications()
LLSD output;
LLSD& data = output["data"];
- LLNotificationChannelPtr history_channel = LLNotifications::instance().getChannel("Persistent");
- LLNotificationSet::iterator it = history_channel->begin();
+ boost::intrusive_ptr<LLPersistentNotificationChannel> history_channel = boost::dynamic_pointer_cast<LLPersistentNotificationChannel>(LLNotifications::instance().getChannel("Persistent"));
+ if (!history_channel)
+ {
+ return;
+ }
- for ( ; history_channel->end() != it; ++it)
+ for ( std::vector<LLNotificationPtr>::iterator it = history_channel->beginHistory(), end_it = history_channel->endHistory();
+ it != end_it;
+ ++it)
{
LLNotificationPtr notification = *it;
@@ -120,8 +127,11 @@ void LLPersistentNotificationStorage::saveNotifications()
formatter->format(output, notify_file, LLSDFormatter::OPTIONS_PRETTY);
}
+static LLFastTimer::DeclareTimer FTM_LOAD_NOTIFICATIONS("Load Notifications");
+
void LLPersistentNotificationStorage::loadNotifications()
{
+ LLFastTimer _(FTM_LOAD_NOTIFICATIONS);
LLResponderRegistry::registerResponders();
LLNotifications::instance().getChannel("Persistent")->
diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp
index 77a5a5d17d..884df27a18 100644
--- a/indra/newview/lltoastnotifypanel.cpp
+++ b/indra/newview/lltoastnotifypanel.cpp
@@ -60,19 +60,6 @@ LLToastNotifyPanel::LLToastNotifyPanel(const LLNotificationPtr& notification, co
LLInstanceTracker(notification->getID())
{
init(rect, show_images);
-
-
- //if(notification->isRespondedTo())
- //{
- // // User selected an option in toast, now disable required buttons in IM window
- // disableRespondedOptions(notification);
- //}
- //
- //if(notification->isReusable())
- //{
- // mButtonClickConnection = sButtonClickSignal.connect(
- // boost::bind(&LLToastNotifyPanel::disableRespondedOptions, this, notification));
- //}
}
void LLToastNotifyPanel::addDefaultButton()
{
@@ -354,17 +341,6 @@ void LLToastNotifyPanel::onClickButton(void* data)
{
response[button_name] = true;
}
-
- bool is_reusable = self->mNotification->isReusable();
- // When we call respond(), LLOfferInfo will delete itself in inventory_offer_callback(),
- // lets copy it while it's still valid.
- LLOfferInfo* old_info = static_cast<LLOfferInfo*>(self->mNotification->getResponder());
- LLOfferInfo* new_info = NULL;
- if(is_reusable && old_info)
- {
- new_info = new LLOfferInfo(*old_info);
- self->mNotification->setResponder(new_info);
- }
// disable all buttons
self->mControlPanel->setEnabled(FALSE);