summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2012-12-12 10:53:13 -0500
committerOz Linden <oz@lindenlab.com>2012-12-12 10:53:13 -0500
commit773c4abc8159cbff9ff0347a25baa56657f73cc2 (patch)
tree67bb91e0ab9e1fc1d4f02b387f2f6627561a8a74 /indra
parent66fee67397d17f03ac5492a903735e2e6eef9f1f (diff)
MAINT-2082: fix deletion of an autoreplace list
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfloaterautoreplacesettings.cpp29
1 files changed, 21 insertions, 8 deletions
diff --git a/indra/newview/llfloaterautoreplacesettings.cpp b/indra/newview/llfloaterautoreplacesettings.cpp
index 5dcdded744..6e56e929df 100644
--- a/indra/newview/llfloaterautoreplacesettings.cpp
+++ b/indra/newview/llfloaterautoreplacesettings.cpp
@@ -514,14 +514,27 @@ bool LLFloaterAutoReplaceSettings::callbackListNameConflict(const LLSD& notifica
void LLFloaterAutoReplaceSettings::onDeleteList()
{
- std::string listName= mListNames->getFirstSelected()->getColumn(0)->getValue().asString();
- mSettings.removeReplacementList(listName); // remove from the copy of settings
- mReplacementsList->deleteSelectedItems(); // remove from the scrolling list
-
- mSelectedListName.clear();
- updateListNames();
- updateListNamesControls();
- updateReplacementsList();
+ std::string listName = mListNames->getSelectedValue().asString();
+ if ( ! listName.empty() )
+ {
+ if ( mSettings.removeReplacementList(listName) )
+ {
+ LL_INFOS("AutoReplace")<<"deleted list '"<<listName<<"'"<<LL_ENDL;
+ mReplacementsList->deleteSelectedItems(); // remove from the scrolling list
+ mSelectedListName.clear();
+ updateListNames();
+ updateListNamesControls();
+ updateReplacementsList();
+ }
+ else
+ {
+ LL_WARNS("AutoReplace")<<"failed to delete list '"<<listName<<"'"<<LL_ENDL;
+ }
+ }
+ else
+ {
+ LL_DEBUGS("AutoReplace")<<"no list selected for delete"<<LL_ENDL;
+ }
}
void LLFloaterAutoReplaceSettings::onExportList()