summaryrefslogtreecommitdiff
path: root/indra/newview/llselectmgr.cpp
diff options
context:
space:
mode:
authorandreykproductengine <akleshchev@productengine.com>2015-08-18 16:42:48 +0300
committerandreykproductengine <akleshchev@productengine.com>2015-08-18 16:42:48 +0300
commit62d9b8cbf263f93143352a33d2735a36ce5112b6 (patch)
treef70ee2ecf319f810507a6c66fbd66ba3602c41b1 /indra/newview/llselectmgr.cpp
parent8d34d1a9c5ae321ce59b20f8673beed0312a41fe (diff)
parent1be63209331d509396bd7ee79302d511fe83d72e (diff)
Merge downstream code and become version 3.8.4
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rwxr-xr-xindra/newview/llselectmgr.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index ad86995b42..55bcb3dc65 100755
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -620,22 +620,14 @@ bool LLSelectMgr::linkObjects()
bool LLSelectMgr::unlinkObjects()
{
- LLViewerObject *object = mSelectedObjects->getFirstRootObject();
- if (!object) return false;
-
S32 min_objects_for_confirm = gSavedSettings.getS32("MinObjectsForUnlinkConfirm");
- for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); iter != getSelection()->root_end(); iter++)
+ S32 unlink_object_count = mSelectedObjects->getObjectCount(); // clears out nodes with NULL objects
+ if (unlink_object_count >= min_objects_for_confirm
+ && unlink_object_count > mSelectedObjects->getRootObjectCount())
{
- object = (*iter)->getObject();
- if(object)
- {
- S32 objects_in_linkset = object->numChildren() + 1;
- if(objects_in_linkset >= min_objects_for_confirm)
- {
- LLNotificationsUtil::add("ConfirmUnlink", LLSD(), LLSD(), boost::bind(&LLSelectMgr::confirmUnlinkObjects, this, _1, _2));
- return true;
- }
- }
+ // total count > root count means that there are childer inside and that there are linksets that will be unlinked
+ LLNotificationsUtil::add("ConfirmUnlink", LLSD(), LLSD(), boost::bind(&LLSelectMgr::confirmUnlinkObjects, this, _1, _2));
+ return true;
}
LLSelectMgr::getInstance()->sendDelink();