summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2013-01-23 11:39:33 -0800
committerGilbert Gonzales <gilbert@lindenlab.com>2013-01-23 11:39:33 -0800
commit0911dafd81b8360235eb6f6b85fac7153a5d4a02 (patch)
tree44d487a071d6a55d14111336887d82a169e5e7c5
parent5733f7090460ea2591bf1af961409c1a77cc916e (diff)
CHUI-687: post code review changes. Now upon deletion of an item, DND mode must be enabled in order to remove a notification from the DND history.
-rw-r--r--indra/newview/lldonotdisturbnotificationstorage.cpp2
-rw-r--r--indra/newview/llinventoryfunctions.cpp27
2 files changed, 17 insertions, 12 deletions
diff --git a/indra/newview/lldonotdisturbnotificationstorage.cpp b/indra/newview/lldonotdisturbnotificationstorage.cpp
index abceb5c10d..15c42e8285 100644
--- a/indra/newview/lldonotdisturbnotificationstorage.cpp
+++ b/indra/newview/lldonotdisturbnotificationstorage.cpp
@@ -260,7 +260,7 @@ void LLDoNotDisturbNotificationStorage::removeNotification(const char * name, co
notificationObjectID = payload[payloadVariable].asUUID();
notificationName = notification->getName();
- if(notificationName == name
+ if((notificationName == name)
&& id == notificationObjectID)
{
itemsToRemove.push_back(it);
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 7f9474ae70..ad0a730dd1 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -1135,20 +1135,23 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root
void LLInventoryAction::removeItemFromDND(LLFolderView* root)
{
- //Get selected items
- LLFolderView::selected_items_t selectedItems = root->getSelectedItems();
- LLFolderViewModelItemInventory * viewModel = NULL;
-
- //If user is in DND and deletes item, make sure the notification is not displayed by removing the notification
- //from DND history and .xml file. Once this is done, upon exit of DND mode the item deleted will not show a notification.
- for(LLFolderView::selected_items_t::iterator it = selectedItems.begin(); it != selectedItems.end(); ++it)
+ if(gAgent.isDoNotDisturb())
{
- viewModel = dynamic_cast<LLFolderViewModelItemInventory *>((*it)->getViewModelItem());
+ //Get selected items
+ LLFolderView::selected_items_t selectedItems = root->getSelectedItems();
+ LLFolderViewModelItemInventory * viewModel = NULL;
- if(viewModel && viewModel->getUUID().notNull())
+ //If user is in DND and deletes item, make sure the notification is not displayed by removing the notification
+ //from DND history and .xml file. Once this is done, upon exit of DND mode the item deleted will not show a notification.
+ for(LLFolderView::selected_items_t::iterator it = selectedItems.begin(); it != selectedItems.end(); ++it)
{
- //Will remove the item offer notification
- LLDoNotDisturbNotificationStorage::instance().removeNotification(LLDoNotDisturbNotificationStorage::offerName, viewModel->getUUID());
+ viewModel = dynamic_cast<LLFolderViewModelItemInventory *>((*it)->getViewModelItem());
+
+ if(viewModel && viewModel->getUUID().notNull())
+ {
+ //Will remove the item offer notification
+ LLDoNotDisturbNotificationStorage::instance().removeNotification(LLDoNotDisturbNotificationStorage::offerName, viewModel->getUUID());
+ }
}
}
}
@@ -1158,6 +1161,8 @@ void LLInventoryAction::onItemsRemovalConfirmation( const LLSD& notification, co
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (option == 0)
{
+ //Need to remove item from DND before item is removed from root folder view
+ //because once removed from root folder view the item is no longer a selected item
removeItemFromDND(root);
root->removeSelectedItems();
}