Commits

Scott Lawrence committed 73280db

MAINT-2082: fix deletion of an autoreplace list

  • Participants
  • Parent commits 390a271
  • Tags DRTVWR-267

Comments (0)

Files changed (1)

indra/newview/llfloaterautoreplacesettings.cpp

 
 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()