aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterinspect.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llfloaterinspect.cpp57
1 files changed, 31 insertions, 26 deletions
diff --git a/linden/indra/newview/llfloaterinspect.cpp b/linden/indra/newview/llfloaterinspect.cpp
index f494251..0ce91ef 100644
--- a/linden/indra/newview/llfloaterinspect.cpp
+++ b/linden/indra/newview/llfloaterinspect.cpp
@@ -2,6 +2,8 @@
2 * @file llfloaterinspect.cpp 2 * @file llfloaterinspect.cpp
3 * @brief Floater for object inspection tool 3 * @brief Floater for object inspection tool
4 * 4 *
5 * $LicenseInfo:firstyear=2006&license=viewergpl$
6 *
5 * Copyright (c) 2006-2007, Linden Research, Inc. 7 * Copyright (c) 2006-2007, Linden Research, Inc.
6 * 8 *
7 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
@@ -24,6 +26,7 @@
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE. 28 * COMPLETENESS OR PERFORMANCE.
29 * $/LicenseInfo$
27 */ 30 */
28 31
29#include "llviewerprecompiledheaders.h" 32#include "llviewerprecompiledheaders.h"
@@ -94,27 +97,28 @@ void LLFloaterInspect::show(void* ignored)
94 97
95void LLFloaterInspect::onClickCreatorProfile(void* ctrl) 98void LLFloaterInspect::onClickCreatorProfile(void* ctrl)
96{ 99{
97 if(sInstance->mObjectList->getAllSelected().size() == 0) return; 100 if(sInstance->mObjectList->getAllSelected().size() == 0)
101 {
102 return;
103 }
98 LLScrollListItem* first_selected = 104 LLScrollListItem* first_selected =
99 sInstance->mObjectList->getFirstSelected(); 105 sInstance->mObjectList->getFirstSelected();
100 106
101 if (first_selected) 107 if (first_selected)
102 { 108 {
103 LLSelectNode* obj= sInstance->mObjectSelection->getFirstNode(); 109 struct f : public LLSelectedNodeFunctor
104 LLUUID obj_id, creator_id;
105 obj_id = first_selected->getUUID();
106 while(obj)
107 { 110 {
108 if(obj_id == obj->getObject()->getID()) 111 LLUUID obj_id;
112 f(const LLUUID& id) : obj_id(id) {}
113 virtual bool apply(LLSelectNode* node)
109 { 114 {
110 creator_id = obj->mPermissions->getCreator(); 115 return (obj_id == node->getObject()->getID());
111 break;
112 } 116 }
113 obj = sInstance->mObjectSelection->getNextNode(); 117 } func(first_selected->getUUID());
114 } 118 LLSelectNode* node = sInstance->mObjectSelection->getFirstNode(&func);
115 if(obj) 119 if(node)
116 { 120 {
117 LLFloaterAvatarInfo::showFromDirectory(creator_id); 121 LLFloaterAvatarInfo::showFromDirectory(node->mPermissions->getCreator());
118 } 122 }
119 } 123 }
120} 124}
@@ -127,20 +131,20 @@ void LLFloaterInspect::onClickOwnerProfile(void* ctrl)
127 131
128 if (first_selected) 132 if (first_selected)
129 { 133 {
130 LLSelectNode* obj= sInstance->mObjectSelection->getFirstNode(); 134 LLUUID selected_id = first_selected->getUUID();
131 LLUUID obj_id, owner_id; 135 struct f : public LLSelectedNodeFunctor
132 obj_id = first_selected->getUUID();
133 while(obj)
134 { 136 {
135 if(obj_id == obj->getObject()->getID()) 137 LLUUID obj_id;
138 f(const LLUUID& id) : obj_id(id) {}
139 virtual bool apply(LLSelectNode* node)
136 { 140 {
137 owner_id = obj->mPermissions->getOwner(); 141 return (obj_id == node->getObject()->getID());
138 break;
139 } 142 }
140 obj = sInstance->mObjectSelection->getNextNode(); 143 } func(selected_id);
141 } 144 LLSelectNode* node = sInstance->mObjectSelection->getFirstNode(&func);
142 if(obj) 145 if(node)
143 { 146 {
147 const LLUUID& owner_id = node->mPermissions->getOwner();
144 LLFloaterAvatarInfo::showFromDirectory(owner_id); 148 LLFloaterAvatarInfo::showFromDirectory(owner_id);
145 } 149 }
146 } 150 }
@@ -201,10 +205,12 @@ void LLFloaterInspect::refresh()
201 } 205 }
202 mObjectList->operateOnAll(LLScrollListCtrl::OP_DELETE); 206 mObjectList->operateOnAll(LLScrollListCtrl::OP_DELETE);
203 //List all transient objects, then all linked objects 207 //List all transient objects, then all linked objects
204 LLSelectNode* obj = mObjectSelection->getFirstNode(); 208
205 LLSD row; 209 for (LLObjectSelection::iterator iter = mObjectSelection->begin();
206 while(obj) 210 iter != mObjectSelection->end(); iter++)
207 { 211 {
212 LLSelectNode* obj = *iter;
213 LLSD row;
208 char owner_first_name[MAX_STRING], owner_last_name[MAX_STRING]; 214 char owner_first_name[MAX_STRING], owner_last_name[MAX_STRING];
209 char creator_first_name[MAX_STRING], creator_last_name[MAX_STRING]; 215 char creator_first_name[MAX_STRING], creator_last_name[MAX_STRING];
210 char time[MAX_STRING]; 216 char time[MAX_STRING];
@@ -240,7 +246,6 @@ void LLFloaterInspect::refresh()
240 row["columns"][3]["type"] = "text"; 246 row["columns"][3]["type"] = "text";
241 row["columns"][3]["value"] = time; 247 row["columns"][3]["value"] = time;
242 mObjectList->addElement(row, ADD_TOP); 248 mObjectList->addElement(row, ADD_TOP);
243 obj = mObjectSelection->getNextNode();
244 } 249 }
245 if(selected_index > -1 && mObjectList->getItemIndex(selected_uuid) == selected_index) 250 if(selected_index > -1 && mObjectList->getItemIndex(selected_uuid) == selected_index)
246 { 251 {