Some spring cleaning.

This commit is contained in:
Shyotl
2012-03-21 02:22:27 -05:00
parent 896f7f5b9b
commit 0fdab061b9
22 changed files with 344 additions and 561 deletions

View File

@@ -28,7 +28,7 @@
#ifndef LL_LLATTACHMENTSMGR_H #ifndef LL_LLATTACHMENTSMGR_H
#define LL_LLATTACHMENTSMGR_H #define LL_LLATTACHMENTSMGR_H
#include "llmemory.h" #include "llsingleton.h"
class LLViewerInventoryItem; class LLViewerInventoryItem;

View File

@@ -2,31 +2,25 @@
* @file llflexibleobject.cpp * @file llflexibleobject.cpp
* @brief Flexible object implementation * @brief Flexible object implementation
* *
* $LicenseInfo:firstyear=2006&license=viewergpl$ * $LicenseInfo:firstyear=2006&license=viewerlgpl$
*
* Copyright (c) 2006-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code * Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab * Copyright (C) 2010, Linden Research, Inc.
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* *
* There are special exceptions to the terms and conditions of the GPL as * This library is free software; you can redistribute it and/or
* it is applied to this Source Code. View the full text of the exception * modify it under the terms of the GNU Lesser General Public
* in the file doc/FLOSS-exception.txt in this software distribution, or * License as published by the Free Software Foundation;
* online at * version 2.1 of the License only.
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* *
* By copying, modifying or distributing this software, you acknowledge * This library is distributed in the hope that it will be useful,
* that you have read and understood your obligations described above, * but WITHOUT ANY WARRANTY; without even the implied warranty of
* and agree to abide by those obligations. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* *
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * You should have received a copy of the GNU Lesser General Public
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * License along with this library; if not, write to the Free Software
* COMPLETENESS OR PERFORMANCE. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$ * $/LicenseInfo$
*/ */

View File

@@ -2134,7 +2134,6 @@ LLFolderViewFolder* LLFolderView::getFolderByID(const LLUUID& id)
static LLFastTimer::DeclareTimer FTM_AUTO_SELECT("Open and Select"); static LLFastTimer::DeclareTimer FTM_AUTO_SELECT("Open and Select");
static LLFastTimer::DeclareTimer FTM_INVENTORY("Inventory"); static LLFastTimer::DeclareTimer FTM_INVENTORY("Inventory");
extern std::set<LLFolderViewItem*> sFolderViewItems; //dumb hack
// Main idle routine // Main idle routine
void LLFolderView::doIdle() void LLFolderView::doIdle()
{ {
@@ -2174,19 +2173,7 @@ void LLFolderView::doIdle()
LLFastTimer t3(FTM_AUTO_SELECT); LLFastTimer t3(FTM_AUTO_SELECT);
// select new item only if a filtered item not currently selected // select new item only if a filtered item not currently selected
LLFolderViewItem* selected_itemp = mSelectedItems.empty() ? NULL : mSelectedItems.back(); LLFolderViewItem* selected_itemp = mSelectedItems.empty() ? NULL : mSelectedItems.back();
/*if (selected_itemp != NULL && sFolderViewItems.count(selected_itemp) == 0) if ((selected_itemp && !selected_itemp->getFiltered()) && !mAutoSelectOverride)
{
// There is a crash bug due to a race condition: when a folder view item is
// destroyed, its address may still appear in mSelectedItems a couple of doIdle()
// later, even if you explicitely clear this list and dirty the filters in the
// destructor...
// This code avoids the crash bug.
llwarns << "Invalid folder view item (" << selected_itemp << ") in selection: clearing the latter." << llendl;
dirtyFilter();
clearSelection();
requestArrange();
}
else */if ((selected_itemp && !selected_itemp->getFiltered()) && !mAutoSelectOverride)
{ {
// select first filtered item // select first filtered item
LLSelectFirstFilteredItem filter; LLSelectFirstFilteredItem filter;

View File

@@ -85,11 +85,11 @@ public:
virtual LLInventoryType::EType getInventoryType() const = 0; virtual LLInventoryType::EType getInventoryType() const = 0;
virtual void performAction(LLInventoryModel* model, std::string action) = 0; virtual void performAction(LLInventoryModel* model, std::string action) = 0;
virtual LLWearableType::EType getWearableType() const = 0; virtual LLWearableType::EType getWearableType() const = 0;
// This method should be called when a drag begins. returns TRUE // This method should be called when a drag begins. returns TRUE
// if the drag can begin, otherwise FALSE. // if the drag can begin, otherwise FALSE.
virtual BOOL startDrag(EDragAndDropType* type, LLUUID* id) const = 0; virtual BOOL startDrag(EDragAndDropType* type, LLUUID* id) const = 0;
// This method will be called to determine if a drop can be // This method will be called to determine if a drop can be
// performed, and will set drop to TRUE if a drop is // performed, and will set drop to TRUE if a drop is
// requested. Returns TRUE if a drop is possible/happened, // requested. Returns TRUE if a drop is possible/happened,
@@ -97,12 +97,6 @@ public:
virtual BOOL dragOrDrop(MASK mask, BOOL drop, virtual BOOL dragOrDrop(MASK mask, BOOL drop,
EDragAndDropType cargo_type, EDragAndDropType cargo_type,
void* cargo_data) = 0; void* cargo_data) = 0;
// This method is called when the object being referenced by the
// bridge is actually dropped. This allows for cleanup of the old
// view, reference counting, etc.
// virtual void dropped() = 0;
}; };
#endif #endif

View File

@@ -53,9 +53,6 @@ const F32 LLFolderViewItem::FOLDER_OPEN_TIME_CONSTANT = 0.03f;
LLUIImagePtr LLFolderViewItem::sArrowImage; LLUIImagePtr LLFolderViewItem::sArrowImage;
LLUIImagePtr LLFolderViewItem::sBoxImage; LLUIImagePtr LLFolderViewItem::sBoxImage;
// This is used to keep track of existing folder view items and
// avoid a crash bug due to a race condition (see in doIdle()).
std::set<LLFolderViewItem*> sFolderViewItems;
//static //static
LLFontGL* LLFolderViewItem::getLabelFontForStyle(U8 style) LLFontGL* LLFolderViewItem::getLabelFontForStyle(U8 style)
@@ -111,7 +108,6 @@ LLFolderViewItem::LLFolderViewItem( const std::string& name, LLUIImagePtr icon,
mLastFilterGeneration(-1), mLastFilterGeneration(-1),
mStringMatchOffset(std::string::npos), mStringMatchOffset(std::string::npos),
mControlLabelRotation(0.f), mControlLabelRotation(0.f),
mDragAndDropTarget(FALSE), mDragAndDropTarget(FALSE),
mIsLoading(FALSE), mIsLoading(FALSE),
mLabel( name ), mLabel( name ),
@@ -122,14 +118,8 @@ LLFolderViewItem::LLFolderViewItem( const std::string& name, LLUIImagePtr icon,
mIconOverlay(icon_overlay), mIconOverlay(icon_overlay),
mListener(listener), mListener(listener),
mShowLoadStatus(true), mShowLoadStatus(true),
mSearchType(0) mSearchType(0)
{ {
sFolderViewItems.insert(this);
/*S32 icon_height = mIcon.notNull() ? mIcon->getHeight() : 0;
S32 label_height = llround(sFont->getLineHeight());*/
postBuild();//Not parsing xml file yet. postBuild();//Not parsing xml file yet.
} }
@@ -143,7 +133,6 @@ BOOL LLFolderViewItem::postBuild()
// Destroys the object // Destroys the object
LLFolderViewItem::~LLFolderViewItem( void ) LLFolderViewItem::~LLFolderViewItem( void )
{ {
sFolderViewItems.erase(this);
delete mListener; delete mListener;
mListener = NULL; mListener = NULL;
} }
@@ -174,7 +163,7 @@ LLFolderViewItem* LLFolderViewItem::getNextOpenNode(BOOL include_children)
{ {
return NULL; return NULL;
} }
LLFolderViewItem* itemp = mParentFolder->getNextFromChild( this, include_children ); LLFolderViewItem* itemp = mParentFolder->getNextFromChild( this, include_children );
while(itemp && !itemp->getVisible()) while(itemp && !itemp->getVisible())
{ {
@@ -196,7 +185,7 @@ LLFolderViewItem* LLFolderViewItem::getPreviousOpenNode(BOOL include_children)
{ {
return NULL; return NULL;
} }
LLFolderViewItem* itemp = mParentFolder->getPreviousFromChild( this, include_children ); LLFolderViewItem* itemp = mParentFolder->getPreviousFromChild( this, include_children );
// Skip over items that are invisible or are hidden from the UI. // Skip over items that are invisible or are hidden from the UI.
@@ -302,7 +291,7 @@ void LLFolderViewItem::updateExtraSearchCriteria()
void LLFolderViewItem::refresh() void LLFolderViewItem::refresh()
{ {
refreshFromListener(); refreshFromListener();
std::string searchable_label(mLabel); std::string searchable_label(mLabel);
searchable_label.append(mLabelSuffix); searchable_label.append(mLabelSuffix);
LLStringUtil::toUpper(searchable_label); LLStringUtil::toUpper(searchable_label);
@@ -584,8 +573,6 @@ BOOL LLFolderViewItem::remove()
return TRUE; return TRUE;
} }
// Build an appropriate context menu for the item. // Build an appropriate context menu for the item.
void LLFolderViewItem::buildContextMenu(LLMenuGL& menu, U32 flags) void LLFolderViewItem::buildContextMenu(LLMenuGL& menu, U32 flags)
{ {
@@ -965,10 +952,14 @@ void LLFolderViewItem::draw()
focus_bottom + 1, focus_bottom + 1,
getRect().getWidth() - 2, getRect().getWidth() - 2,
0, 0,
sHighlightBgColor, TRUE); sHighlightBgColor, TRUE);
} }
} }
} }
//--------------------------------------------------------------------------------//
// Draw DragNDrop highlight
//
if (mDragAndDropTarget) if (mDragAndDropTarget)
{ {
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
@@ -1025,18 +1016,18 @@ void LLFolderViewItem::draw()
// //
if (getRoot()->getDebugFilters()) if (getRoot()->getDebugFilters())
{ {
if (!getFiltered() && !possibly_has_children) if (!getFiltered() && !possibly_has_children)
{ {
color.mV[VALPHA] *= 0.5f; color.mV[VALPHA] *= 0.5f;
} }
LLColor4 filter_color = mLastFilterGeneration >= getRoot()->getFilter()->getCurrentGeneration() ? LLColor4 filter_color = mLastFilterGeneration >= getRoot()->getFilter()->getCurrentGeneration() ?
LLColor4(0.5f, 0.8f, 0.5f, 1.f) : LLColor4(0.5f, 0.8f, 0.5f, 1.f) :
LLColor4(0.8f, 0.5f, 0.5f, 1.f); LLColor4(0.8f, 0.5f, 0.5f, 1.f);
LLFontGL::getFontMonospace()->renderUTF8(mStatusText, 0, text_left, y, filter_color, LLFontGL::getFontMonospace()->renderUTF8(mStatusText, 0, text_left, y, filter_color,
LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW,
S32_MAX, S32_MAX, &right_x, FALSE ); S32_MAX, S32_MAX, &right_x, FALSE );
text_left = right_x; text_left = right_x;
} }
//--------------------------------------------------------------------------------// //--------------------------------------------------------------------------------//
// Draw the actual label text // Draw the actual label text
// //
@@ -1078,6 +1069,9 @@ void LLFolderViewItem::draw()
S32_MAX, S32_MAX, &right_x, FALSE ); S32_MAX, S32_MAX, &right_x, FALSE );
} }
//--------------------------------------------------------------------------------//
// Highlight string match
//
if (sBoxImage.notNull() && mStringMatchOffset != std::string::npos) if (sBoxImage.notNull() && mStringMatchOffset != std::string::npos)
{ {
// don't draw backgrounds for zero-length strings // don't draw backgrounds for zero-length strings
@@ -1167,8 +1161,8 @@ BOOL LLFolderViewFolder::addToFolder(LLFolderViewFolder* folder, LLFolderView* r
return folder->addFolder(this); return folder->addFolder(this);
} }
// Finds width and height of this object and it's children. Also // Finds width and height of this object and its children. Also
// makes sure that this view and it's children are the right size. // makes sure that this view and its children are the right size.
S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation) S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation)
{ {
// sort before laying out contents // sort before laying out contents
@@ -1275,12 +1269,12 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation)
if (llabs(mCurHeight - mTargetHeight) > 1.f) if (llabs(mCurHeight - mTargetHeight) > 1.f)
{ {
mCurHeight = lerp(mCurHeight, mTargetHeight, LLCriticalDamp::getInterpolant(mIsOpen ? FOLDER_OPEN_TIME_CONSTANT : FOLDER_CLOSE_TIME_CONSTANT)); mCurHeight = lerp(mCurHeight, mTargetHeight, LLCriticalDamp::getInterpolant(mIsOpen ? FOLDER_OPEN_TIME_CONSTANT : FOLDER_CLOSE_TIME_CONSTANT));
requestArrange(); requestArrange();
// hide child elements that fall out of current animated height // hide child elements that fall out of current animated height
for (folders_t::iterator iter = mFolders.begin(); for (folders_t::iterator iter = mFolders.begin();
iter != mFolders.end();) iter != mFolders.end();)
{ {
folders_t::iterator fit = iter++; folders_t::iterator fit = iter++;
// number of pixels that bottom of folder label is from top of parent folder // number of pixels that bottom of folder label is from top of parent folder
@@ -1293,7 +1287,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation)
} }
for (items_t::iterator iter = mItems.begin(); for (items_t::iterator iter = mItems.begin();
iter != mItems.end();) iter != mItems.end();)
{ {
items_t::iterator iit = iter++; items_t::iterator iit = iter++;
// number of pixels that bottom of item label is from top of parent folder // number of pixels that bottom of item label is from top of parent folder
@@ -1329,6 +1323,7 @@ void LLFolderViewFolder::requestSort()
// whenever item order changes, we need to lay things out again // whenever item order changes, we need to lay things out again
requestArrange(); requestArrange();
} }
void LLFolderViewFolder::setCompletedFilterGeneration(S32 generation, BOOL recurse_up) void LLFolderViewFolder::setCompletedFilterGeneration(S32 generation, BOOL recurse_up)
{ {
mMostFilteredDescendantGeneration = llmin(mMostFilteredDescendantGeneration, generation); mMostFilteredDescendantGeneration = llmin(mMostFilteredDescendantGeneration, generation);
@@ -1367,7 +1362,7 @@ void LLFolderViewFolder::filter( LLInventoryFilter& filter)
// go ahead and flag this folder as done // go ahead and flag this folder as done
mLastFilterGeneration = filter_generation; mLastFilterGeneration = filter_generation;
} }
else else // filter self only on first pass through
{ {
// filter against folder rules // filter against folder rules
filterFolder(filter); filterFolder(filter);
@@ -1486,7 +1481,7 @@ void LLFolderViewFolder::filter( LLInventoryFilter& filter)
requestArrange(); requestArrange();
} }
} }
// if we didn't use all filter iterations // if we didn't use all filter iterations
// that means we filtered all of our descendants // that means we filtered all of our descendants
// instead of exhausting the filter count for this frame // instead of exhausting the filter count for this frame
@@ -1553,9 +1548,10 @@ BOOL LLFolderViewFolder::getFiltered(S32 filter_generation)
{ {
return getFilteredFolder(filter_generation) && LLFolderViewItem::getFiltered(filter_generation); return getFilteredFolder(filter_generation) && LLFolderViewItem::getFiltered(filter_generation);
} }
BOOL LLFolderViewFolder::hasFilteredDescendants(S32 filter_generation) BOOL LLFolderViewFolder::hasFilteredDescendants(S32 filter_generation)
{ {
return mMostFilteredDescendantGeneration >= filter_generation; return mMostFilteredDescendantGeneration >= filter_generation;
} }
@@ -1567,12 +1563,12 @@ BOOL LLFolderViewFolder::hasFilteredDescendants()
// Passes selection information on to children and record selection // Passes selection information on to children and record selection
// information if necessary. // information if necessary.
BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL openitem, BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL openitem,
BOOL take_keyboard_focus) BOOL take_keyboard_focus)
{ {
BOOL rv = FALSE; BOOL rv = FALSE;
if( selection == this ) if (selection == this)
{ {
if (!isSelected()) if (!isSelected())
{ {
selectItem(); selectItem();
} }
@@ -1580,16 +1576,16 @@ BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL openitem
} }
else else
{ {
if (isSelected()) if (isSelected())
{ {
deselectItem(); deselectItem();
} }
rv = FALSE; rv = FALSE;
} }
BOOL child_selected = FALSE; BOOL child_selected = FALSE;
for (folders_t::iterator iter = mFolders.begin(); for (folders_t::iterator iter = mFolders.begin();
iter != mFolders.end();) iter != mFolders.end();)
{ {
folders_t::iterator fit = iter++; folders_t::iterator fit = iter++;
if((*fit)->setSelection(selection, openitem, take_keyboard_focus)) if((*fit)->setSelection(selection, openitem, take_keyboard_focus))
@@ -1599,7 +1595,7 @@ BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL openitem
} }
} }
for (items_t::iterator iter = mItems.begin(); for (items_t::iterator iter = mItems.begin();
iter != mItems.end();) iter != mItems.end();)
{ {
items_t::iterator iit = iter++; items_t::iterator iit = iter++;
if((*iit)->setSelection(selection, openitem, take_keyboard_focus)) if((*iit)->setSelection(selection, openitem, take_keyboard_focus))
@@ -1627,7 +1623,7 @@ BOOL LLFolderViewFolder::changeSelection(LLFolderViewItem* selection, BOOL selec
if (isSelected() != selected) if (isSelected() != selected)
{ {
rv = TRUE; rv = TRUE;
if (selected) if (selected)
{ {
selectItem(); selectItem();
} }
@@ -1639,19 +1635,19 @@ BOOL LLFolderViewFolder::changeSelection(LLFolderViewItem* selection, BOOL selec
} }
for (folders_t::iterator iter = mFolders.begin(); for (folders_t::iterator iter = mFolders.begin();
iter != mFolders.end();) iter != mFolders.end();)
{ {
folders_t::iterator fit = iter++; folders_t::iterator fit = iter++;
if ((*fit)->changeSelection(selection, selected)) if((*fit)->changeSelection(selection, selected))
{ {
rv = TRUE; rv = TRUE;
} }
} }
for (items_t::iterator iter = mItems.begin(); for (items_t::iterator iter = mItems.begin();
iter != mItems.end();) iter != mItems.end();)
{ {
items_t::iterator iit = iter++; items_t::iterator iit = iter++;
if ((*iit)->changeSelection(selection, selected)) if((*iit)->changeSelection(selection, selected))
{ {
rv = TRUE; rv = TRUE;
} }
@@ -1659,7 +1655,6 @@ BOOL LLFolderViewFolder::changeSelection(LLFolderViewItem* selection, BOOL selec
return rv; return rv;
} }
LLFolderViewFolder* LLFolderViewFolder::getCommonAncestor(LLFolderViewItem* item_a, LLFolderViewItem* item_b, bool& reverse) LLFolderViewFolder* LLFolderViewFolder::getCommonAncestor(LLFolderViewItem* item_a, LLFolderViewItem* item_b, bool& reverse)
{ {
if (!item_a->getParentFolder() || !item_b->getParentFolder()) return NULL; if (!item_a->getParentFolder() || !item_b->getParentFolder()) return NULL;
@@ -1935,7 +1930,7 @@ void LLFolderViewFolder::destroyView()
} }
//deleteAllChildren(); //deleteAllChildren();
if (mParentFolder) if (mParentFolder)
{ {
mParentFolder->removeView(this); mParentFolder->removeView(this);
@@ -2018,9 +2013,9 @@ void LLFolderViewFolder::sortBy(U32 order)
return; return;
} }
// Propegate this change to sub folders // Propagate this change to sub folders
for (folders_t::iterator iter = mFolders.begin(); for (folders_t::iterator iter = mFolders.begin();
iter != mFolders.end();) iter != mFolders.end();)
{ {
folders_t::iterator fit = iter++; folders_t::iterator fit = iter++;
(*fit)->sortBy(order); (*fit)->sortBy(order);
@@ -2036,7 +2031,7 @@ void LLFolderViewFolder::sortBy(U32 order)
if (order & LLInventoryFilter::SO_DATE) if (order & LLInventoryFilter::SO_DATE)
{ {
time_t latest = 0; time_t latest = 0;
if (!mItems.empty()) if (!mItems.empty())
{ {
LLFolderViewItem* item = *(mItems.begin()); LLFolderViewItem* item = *(mItems.begin());
@@ -2099,7 +2094,7 @@ BOOL LLFolderViewFolder::isMovable()
} }
for (items_t::iterator iter = mItems.begin(); for (items_t::iterator iter = mItems.begin();
iter != mItems.end();) iter != mItems.end();)
{ {
items_t::iterator iit = iter++; items_t::iterator iit = iter++;
if(!(*iit)->isMovable()) if(!(*iit)->isMovable())
@@ -2109,7 +2104,7 @@ BOOL LLFolderViewFolder::isMovable()
} }
for (folders_t::iterator iter = mFolders.begin(); for (folders_t::iterator iter = mFolders.begin();
iter != mFolders.end();) iter != mFolders.end();)
{ {
folders_t::iterator fit = iter++; folders_t::iterator fit = iter++;
if(!(*fit)->isMovable()) if(!(*fit)->isMovable())
@@ -2132,7 +2127,7 @@ BOOL LLFolderViewFolder::isRemovable()
} }
for (items_t::iterator iter = mItems.begin(); for (items_t::iterator iter = mItems.begin();
iter != mItems.end();) iter != mItems.end();)
{ {
items_t::iterator iit = iter++; items_t::iterator iit = iter++;
if(!(*iit)->isRemovable()) if(!(*iit)->isRemovable())
@@ -2142,7 +2137,7 @@ BOOL LLFolderViewFolder::isRemovable()
} }
for (folders_t::iterator iter = mFolders.begin(); for (folders_t::iterator iter = mFolders.begin();
iter != mFolders.end();) iter != mFolders.end();)
{ {
folders_t::iterator fit = iter++; folders_t::iterator fit = iter++;
if(!(*fit)->isRemovable()) if(!(*fit)->isRemovable())
@@ -2273,7 +2268,7 @@ void LLFolderViewFolder::setOpenArrangeRecursively(BOOL openitem, ERecurseType r
if (recurse == RECURSE_DOWN || recurse == RECURSE_UP_DOWN) if (recurse == RECURSE_DOWN || recurse == RECURSE_UP_DOWN)
{ {
for (folders_t::iterator iter = mFolders.begin(); for (folders_t::iterator iter = mFolders.begin();
iter != mFolders.end();) iter != mFolders.end();)
{ {
folders_t::iterator fit = iter++; folders_t::iterator fit = iter++;
(*fit)->setOpenArrangeRecursively(openitem, RECURSE_DOWN); /* Flawfinder: ignore */ (*fit)->setOpenArrangeRecursively(openitem, RECURSE_DOWN); /* Flawfinder: ignore */
@@ -2293,11 +2288,11 @@ void LLFolderViewFolder::setOpenArrangeRecursively(BOOL openitem, ERecurseType r
} }
BOOL LLFolderViewFolder::handleDragAndDropFromChild(MASK mask, BOOL LLFolderViewFolder::handleDragAndDropFromChild(MASK mask,
BOOL drop, BOOL drop,
EDragAndDropType c_type, EDragAndDropType c_type,
void* cargo_data, void* cargo_data,
EAcceptance* accept, EAcceptance* accept,
std::string& tooltip_msg) std::string& tooltip_msg)
{ {
BOOL accepted = mListener && mListener->dragOrDrop(mask,drop,c_type,cargo_data); BOOL accepted = mListener && mListener->dragOrDrop(mask,drop,c_type,cargo_data);
if (accepted) if (accepted)
@@ -2342,13 +2337,13 @@ void LLFolderViewFolder::applyFunctorRecursively(LLFolderViewFunctor& functor)
functor.doFolder(this); functor.doFolder(this);
for (folders_t::iterator iter = mFolders.begin(); for (folders_t::iterator iter = mFolders.begin();
iter != mFolders.end();) iter != mFolders.end();)
{ {
folders_t::iterator fit = iter++; folders_t::iterator fit = iter++;
(*fit)->applyFunctorRecursively(functor); (*fit)->applyFunctorRecursively(functor);
} }
for (items_t::iterator iter = mItems.begin(); for (items_t::iterator iter = mItems.begin();
iter != mItems.end();) iter != mItems.end();)
{ {
items_t::iterator iit = iter++; items_t::iterator iit = iter++;
functor.doItem((*iit)); functor.doItem((*iit));
@@ -2359,13 +2354,13 @@ void LLFolderViewFolder::applyListenerFunctorRecursively(LLFolderViewListenerFun
{ {
functor(mListener); functor(mListener);
for (folders_t::iterator iter = mFolders.begin(); for (folders_t::iterator iter = mFolders.begin();
iter != mFolders.end();) iter != mFolders.end();)
{ {
folders_t::iterator fit = iter++; folders_t::iterator fit = iter++;
(*fit)->applyListenerFunctorRecursively(functor); (*fit)->applyListenerFunctorRecursively(functor);
} }
for (items_t::iterator iter = mItems.begin(); for (items_t::iterator iter = mItems.begin();
iter != mItems.end();) iter != mItems.end();)
{ {
items_t::iterator iit = iter++; items_t::iterator iit = iter++;
(*iit)->applyListenerFunctorRecursively(functor); (*iit)->applyListenerFunctorRecursively(functor);
@@ -2407,16 +2402,16 @@ BOOL LLFolderViewFolder::handleDragAndDropToThisFolder(MASK mask,
BOOL accepted = mListener && mListener->dragOrDrop(mask, drop, cargo_type, cargo_data); BOOL accepted = mListener && mListener->dragOrDrop(mask, drop, cargo_type, cargo_data);
if (accepted) if (accepted)
{ {
mDragAndDropTarget = TRUE; mDragAndDropTarget = TRUE;
*accept = ACCEPT_YES_MULTI; *accept = ACCEPT_YES_MULTI;
} }
else else
{ {
*accept = ACCEPT_NO; *accept = ACCEPT_NO;
} }
if (!drop && accepted) if (!drop && accepted)
{ {
getRoot()->autoOpenTest(this); getRoot()->autoOpenTest(this);
} }
@@ -2431,7 +2426,7 @@ BOOL LLFolderViewFolder::handleRightMouseDown( S32 x, S32 y, MASK mask )
// fetch contents of this folder, as context menu can depend on contents // fetch contents of this folder, as context menu can depend on contents
// still, user would have to open context menu again to see the changes // still, user would have to open context menu again to see the changes
gInventory.fetchDescendentsOf(mListener->getUUID()); gInventory.fetchDescendentsOf(mListener->getUUID());
if( mIsOpen ) if( mIsOpen )
{ {
handled = childrenHandleRightMouseDown( x, y, mask ) != NULL; handled = childrenHandleRightMouseDown( x, y, mask ) != NULL;
@@ -2529,18 +2524,18 @@ void LLFolderViewFolder::draw()
{ {
possibly_has_children = true; possibly_has_children = true;
} }
BOOL loading = (mIsOpen BOOL loading = (mIsOpen
&& possibly_has_children && possibly_has_children
&& !up_to_date ); && !up_to_date );
if ( loading && !mIsLoading ) if ( loading && !mIsLoading )
{ {
// Measure how long we've been in the loading state // Measure how long we've been in the loading state
mTimeSinceRequestStart.reset(); mTimeSinceRequestStart.reset();
} }
mIsLoading = loading; mIsLoading = loading;
LLFolderViewItem::draw(); LLFolderViewItem::draw();
@@ -2645,7 +2640,7 @@ LLFolderViewItem* LLFolderViewFolder::getNextFromChild( LLFolderViewItem* item,
// turn on downwards traversal for next folder // turn on downwards traversal for next folder
++fit; ++fit;
} }
if (fit != fend) if (fit != fend)
{ {
result = (*fit); result = (*fit);
@@ -2675,7 +2670,6 @@ LLFolderViewItem* LLFolderViewFolder::getNextFromChild( LLFolderViewItem* item,
return result; return result;
} }
// this does postfix traversal, as folders are listed above their contents // this does postfix traversal, as folders are listed above their contents
LLFolderViewItem* LLFolderViewFolder::getPreviousFromChild( LLFolderViewItem* item, BOOL include_children ) LLFolderViewItem* LLFolderViewFolder::getPreviousFromChild( LLFolderViewItem* item, BOOL include_children )
{ {
@@ -2743,7 +2737,7 @@ LLFolderViewItem* LLFolderViewFolder::getPreviousFromChild( LLFolderViewItem* it
{ {
++iit; ++iit;
} }
if (iit != iend) if (iit != iend)
{ {
// we found an appropriate item // we found an appropriate item
@@ -2782,6 +2776,7 @@ LLFolderViewItem* LLFolderViewFolder::getPreviousFromChild( LLFolderViewItem* it
return result; return result;
} }
bool LLInventorySort::updateSort(U32 order) bool LLInventorySort::updateSort(U32 order)
{ {
if (order != mSortOrder) if (order != mSortOrder)
@@ -2829,8 +2824,8 @@ bool LLInventorySort::operator()(const LLFolderViewItem* const& a, const LLFolde
// OR if these are folders and we are sorting folders by name. // OR if these are folders and we are sorting folders by name.
bool by_name = (!mByDate bool by_name = (!mByDate
|| (mFoldersByName || (mFoldersByName
&& (a->getSortGroup() != SG_ITEM))); && (a->getSortGroup() != SG_ITEM)));
if (a->getSortGroup() != b->getSortGroup()) if (a->getSortGroup() != b->getSortGroup())
{ {
if (mSystemToTop) if (mSystemToTop)

View File

@@ -169,7 +169,6 @@ void remove_inventory_category_from_avatar(LLInventoryCategory* category);
void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_id); void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_id);
bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, LLMoveInv*); bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, LLMoveInv*);
bool confirm_attachment_rez(const LLSD& notification, const LLSD& response); bool confirm_attachment_rez(const LLSD& notification, const LLSD& response);
void teleport_via_landmark(const LLUUID& asset_id);
static BOOL can_move_to_outfit(LLInventoryItem* inv_item, BOOL move_is_into_current_outfit); static BOOL can_move_to_outfit(LLInventoryItem* inv_item, BOOL move_is_into_current_outfit);
// Helper functions // Helper functions
@@ -434,7 +433,7 @@ void LLInvFVBridge::removeBatchNoCheck(LLDynamicArray<LLFolderViewEventListener*
--update[cat->getParentUUID()]; --update[cat->getParentUUID()];
++update[trash_id]; ++update[trash_id];
// <edit> // <edit>
if(!gInventory.isObjectDescendentOf(cat->getUUID(), gSystemFolderRoot)) if(!gInventory.isObjectDescendentOf(cat->getUUID(), gSystemFolderRoot)) //Avoid fake items.
{ {
// </edit> // </edit>
if(start_new_message) if(start_new_message)
@@ -1506,8 +1505,7 @@ BOOL LLItemBridge::removeItem()
// Already in trash // Already in trash
if (model->isObjectDescendentOf(mUUID, trash_id)) return FALSE; if (model->isObjectDescendentOf(mUUID, trash_id)) return FALSE;
//Is this needed? What does it fix? Ascent has bad commenting. // <edit> trash problem
/* // <edit> trash problem
if(gInventory.isObjectDescendentOf(mUUID, gSystemFolderRoot)) if(gInventory.isObjectDescendentOf(mUUID, gSystemFolderRoot))
{ {
LLInventoryModel::LLCategoryUpdate up(item->getParentUUID(), -1); LLInventoryModel::LLCategoryUpdate up(item->getParentUUID(), -1);
@@ -1515,7 +1513,7 @@ BOOL LLItemBridge::removeItem()
gInventory.accountForUpdate(up); gInventory.accountForUpdate(up);
gInventory.notifyObservers(); gInventory.notifyObservers();
} }
// </edit> */ // </edit>
LLNotification::Params params("ConfirmItemDeleteHasLinks"); LLNotification::Params params("ConfirmItemDeleteHasLinks");
params.functor(boost::bind(&LLItemBridge::confirmRemoveItem, this, _1, _2)); params.functor(boost::bind(&LLItemBridge::confirmRemoveItem, this, _1, _2));

View File

@@ -2,31 +2,25 @@
* @file llinventorybridge.h * @file llinventorybridge.h
* @brief Implementation of the Inventory-Folder-View-Bridge classes. * @brief Implementation of the Inventory-Folder-View-Bridge classes.
* *
* $LicenseInfo:firstyear=2001&license=viewergpl$ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
*
* Copyright (c) 2001-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code * Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab * Copyright (C) 2010, Linden Research, Inc.
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* *
* There are special exceptions to the terms and conditions of the GPL as * This library is free software; you can redistribute it and/or
* it is applied to this Source Code. View the full text of the exception * modify it under the terms of the GNU Lesser General Public
* in the file doc/FLOSS-exception.txt in this software distribution, or * License as published by the Free Software Foundation;
* online at * version 2.1 of the License only.
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* *
* By copying, modifying or distributing this software, you acknowledge * This library is distributed in the hope that it will be useful,
* that you have read and understood your obligations described above, * but WITHOUT ANY WARRANTY; without even the implied warranty of
* and agree to abide by those obligations. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* *
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * You should have received a copy of the GNU Lesser General Public
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * License along with this library; if not, write to the Free Software
* COMPLETENESS OR PERFORMANCE. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
@@ -38,7 +32,6 @@
#include "llfoldervieweventlistener.h" #include "llfoldervieweventlistener.h"
#include "llinventorymodel.h" #include "llinventorymodel.h"
#include "llinventoryobserver.h" #include "llinventoryobserver.h"
//#include "llinventoryview.h"
#include "llviewercontrol.h" #include "llviewercontrol.h"
#include "llwearable.h" #include "llwearable.h"
@@ -59,7 +52,7 @@ typedef std::vector<std::string> menuentry_vec_t;
// //
// You'll want to call LLInvItemFVELister::createBridge() to actually create // You'll want to call LLInvItemFVELister::createBridge() to actually create
// an instance of this class. This helps encapsulate the // an instance of this class. This helps encapsulate the
// funcationality a bit. (except for folders, you can create those // functionality a bit. (except for folders, you can create those
// manually...) // manually...)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class LLInvFVBridge : public LLFolderViewEventListener class LLInvFVBridge : public LLFolderViewEventListener
@@ -126,6 +119,9 @@ public:
virtual LLInventoryType::EType getInventoryType() const { return mInvType; } virtual LLInventoryType::EType getInventoryType() const { return mInvType; }
virtual LLWearableType::EType getWearableType() const { return LLWearableType::WT_NONE; } virtual LLWearableType::EType getWearableType() const { return LLWearableType::WT_NONE; }
//--------------------------------------------------------------------
// Convenience functions for adding various common menu options.
//--------------------------------------------------------------------
protected: protected:
virtual void addTrashContextMenuOptions(menuentry_vec_t &items, virtual void addTrashContextMenuOptions(menuentry_vec_t &items,
menuentry_vec_t &disabled_items); menuentry_vec_t &disabled_items);
@@ -140,8 +136,7 @@ protected:
BOOL isLinkedObjectInTrash() const; // Is this obj or its baseobj in the trash? BOOL isLinkedObjectInTrash() const; // Is this obj or its baseobj in the trash?
BOOL isLinkedObjectMissing() const; // Is this a linked obj whose baseobj is not in inventory? BOOL isLinkedObjectMissing() const; // Is this a linked obj whose baseobj is not in inventory?
// return true if the item is in agent inventory. if false, it
// must be lost or in the inventory library.
BOOL isAgentInventory() const; // false if lost or in the inventory library BOOL isAgentInventory() const; // false if lost or in the inventory library
BOOL isCOFFolder() const; // true if COF or descendent of BOOL isCOFFolder() const; // true if COF or descendent of
virtual BOOL isItemPermissive() const; virtual BOOL isItemPermissive() const;
@@ -157,7 +152,7 @@ protected:
protected: protected:
LLHandle<LLPanel> mInventoryPanel; LLHandle<LLPanel> mInventoryPanel;
LLFolderView* mRoot; LLFolderView* mRoot;
LLUUID mUUID; // item id const LLUUID mUUID; // item id
LLInventoryType::EType mInvType; LLInventoryType::EType mInvType;
BOOL mIsLink; BOOL mIsLink;
void purgeItem(LLInventoryModel *model, const LLUUID &uuid); void purgeItem(LLInventoryModel *model, const LLUUID &uuid);
@@ -278,10 +273,12 @@ public:
protected: protected:
void buildContextMenuBaseOptions(U32 flags); void buildContextMenuBaseOptions(U32 flags);
void buildContextMenuFolderOptions(U32 flags); void buildContextMenuFolderOptions(U32 flags);
// menu callbacks
//--------------------------------------------------------------------
// Menu callbacks
//--------------------------------------------------------------------
static void pasteClipboard(void* user_data); static void pasteClipboard(void* user_data);
static void createNewCategory(void* user_data); static void createNewCategory(void* user_data);
static void createNewShirt(void* user_data); static void createNewShirt(void* user_data);
static void createNewPants(void* user_data); static void createNewPants(void* user_data);
static void createNewShoes(void* user_data); static void createNewShoes(void* user_data);
@@ -459,7 +456,7 @@ public:
virtual BOOL renameItem(const std::string& new_name); virtual BOOL renameItem(const std::string& new_name);
LLInventoryObject* getObject() const; LLInventoryObject* getObject() const;
protected: protected:
static LLUUID sContextMenuItemID; // Only valid while the context menu is open. static LLUUID sContextMenuItemID; // Only valid while the context menu is open.
U32 mAttachPt; U32 mAttachPt;
BOOL mIsMultiObject; BOOL mIsMultiObject;
}; };
@@ -475,7 +472,6 @@ public:
virtual void openItem(); virtual void openItem();
}; };
class LLWearableBridge : public LLItemBridge class LLWearableBridge : public LLItemBridge
{ {
public: public:

View File

@@ -2,31 +2,25 @@
* @file lltexlayer.cpp * @file lltexlayer.cpp
* @brief A texture layer. Used for avatars. * @brief A texture layer. Used for avatars.
* *
* $LicenseInfo:firstyear=2002&license=viewergpl$ * $LicenseInfo:firstyear=2002&license=viewerlgpl$
*
* Copyright (c) 2002-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code * Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab * Copyright (C) 2010, Linden Research, Inc.
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* *
* There are special exceptions to the terms and conditions of the GPL as * This library is free software; you can redistribute it and/or
* it is applied to this Source Code. View the full text of the exception * modify it under the terms of the GNU Lesser General Public
* in the file doc/FLOSS-exception.txt in this software distribution, or * License as published by the Free Software Foundation;
* online at * version 2.1 of the License only.
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* *
* By copying, modifying or distributing this software, you acknowledge * This library is distributed in the hope that it will be useful,
* that you have read and understood your obligations described above, * but WITHOUT ANY WARRANTY; without even the implied warranty of
* and agree to abide by those obligations. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* *
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * You should have received a copy of the GNU Lesser General Public
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * License along with this library; if not, write to the Free Software
* COMPLETENESS OR PERFORMANCE. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$ * $/LicenseInfo$
*/ */

View File

@@ -1,32 +1,26 @@
/** /**
* @file lltexlayer.h * @file lltexlayer.h
* @brief A texture layer. Used for avatars. * @brief Texture layer classes. Used for avatars.
* *
* $LicenseInfo:firstyear=2002&license=viewergpl$ * $LicenseInfo:firstyear=2002&license=viewerlgpl$
*
* Copyright (c) 2002-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code * Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab * Copyright (C) 2010, Linden Research, Inc.
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* *
* There are special exceptions to the terms and conditions of the GPL as * This library is free software; you can redistribute it and/or
* it is applied to this Source Code. View the full text of the exception * modify it under the terms of the GNU Lesser General Public
* in the file doc/FLOSS-exception.txt in this software distribution, or * License as published by the Free Software Foundation;
* online at * version 2.1 of the License only.
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* *
* By copying, modifying or distributing this software, you acknowledge * This library is distributed in the hope that it will be useful,
* that you have read and understood your obligations described above, * but WITHOUT ANY WARRANTY; without even the implied warranty of
* and agree to abide by those obligations. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* *
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * You should have received a copy of the GNU Lesser General Public
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * License along with this library; if not, write to the Free Software
* COMPLETENESS OR PERFORMANCE. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$ * $/LicenseInfo$
*/ */

View File

@@ -2,31 +2,25 @@
* @file llviewerinventory.cpp * @file llviewerinventory.cpp
* @brief Implementation of the viewer side inventory objects. * @brief Implementation of the viewer side inventory objects.
* *
* $LicenseInfo:firstyear=2002&license=viewergpl$ * $LicenseInfo:firstyear=2002&license=viewerlgpl$
*
* Copyright (c) 2002-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code * Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab * Copyright (C) 2010, Linden Research, Inc.
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* *
* There are special exceptions to the terms and conditions of the GPL as * This library is free software; you can redistribute it and/or
* it is applied to this Source Code. View the full text of the exception * modify it under the terms of the GNU Lesser General Public
* in the file doc/FLOSS-exception.txt in this software distribution, or * License as published by the Free Software Foundation;
* online at * version 2.1 of the License only.
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* *
* By copying, modifying or distributing this software, you acknowledge * This library is distributed in the hope that it will be useful,
* that you have read and understood your obligations described above, * but WITHOUT ANY WARRANTY; without even the implied warranty of
* and agree to abide by those obligations. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* *
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * You should have received a copy of the GNU Lesser General Public
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * License along with this library; if not, write to the Free Software
* COMPLETENESS OR PERFORMANCE. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
@@ -209,6 +203,13 @@ void LLViewerInventoryItem::updateServer(BOOL is_new) const
LLNotificationsUtil::add("IncompleteInventoryItem"); LLNotificationsUtil::add("IncompleteInventoryItem");
return; return;
} }
if(gAgent.getID() != mPermissions.getOwner())
{
// *FIX: deal with this better.
llwarns << "LLViewerInventoryItem::updateServer() - for unowned item"
<< llendl;
return;
}
LLInventoryModel::LLCategoryUpdate up(mParentUUID, is_new ? 1 : 0); LLInventoryModel::LLCategoryUpdate up(mParentUUID, is_new ? 1 : 0);
gInventory.accountForUpdate(up); gInventory.accountForUpdate(up);
@@ -1345,7 +1346,7 @@ private:
/** /**
* Returns true if specified item is not found among inventory items * Returns true if specified item is not found among inventory items
*// */
bool operator()(const sort_index_map_t::value_type& id_index_pair) const bool operator()(const sort_index_map_t::value_type& id_index_pair) const
{ {
LLPointer<LLViewerInventoryItem> item = gInventory.getItem(id_index_pair.first); LLPointer<LLViewerInventoryItem> item = gInventory.getItem(id_index_pair.first);

View File

@@ -51,10 +51,10 @@ extern LLPipeline gPipeline;
// LLViewerJointAttachment() // LLViewerJointAttachment()
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
LLViewerJointAttachment::LLViewerJointAttachment() : LLViewerJointAttachment::LLViewerJointAttachment() :
mVisibleInFirst(FALSE), mVisibleInFirst(FALSE),
mGroup(0), mGroup(0),
mIsHUDAttachment(FALSE), mIsHUDAttachment(FALSE),
mPieSlice(-1) mPieSlice(-1)
{ {
mValid = FALSE; mValid = FALSE;
mUpdateXform = FALSE; mUpdateXform = FALSE;
@@ -160,6 +160,7 @@ BOOL LLViewerJointAttachment::addObject(LLViewerObject* object)
{ {
object->extractAttachmentItemID(); object->extractAttachmentItemID();
// Same object reattached
if (isObjectAttached(object)) if (isObjectAttached(object))
{ {
llinfos << "(same object re-attached)" << llendl; llinfos << "(same object re-attached)" << llendl;
@@ -202,7 +203,7 @@ BOOL LLViewerJointAttachment::addObject(LLViewerObject* object)
} }
calcLOD(); calcLOD();
mUpdateXform = TRUE; mUpdateXform = TRUE;
return TRUE; return TRUE;
} }
@@ -237,7 +238,7 @@ void LLViewerJointAttachment::removeObject(LLViewerObject *object)
//if object is active, make it static //if object is active, make it static
if(object->mDrawable->isActive()) if(object->mDrawable->isActive())
{ {
object->mDrawable->makeStatic(FALSE) ; object->mDrawable->makeStatic(FALSE);
} }
LLVector3 cur_position = object->getRenderPosition(); LLVector3 cur_position = object->getRenderPosition();
@@ -402,7 +403,6 @@ BOOL LLViewerJointAttachment::updateLOD(F32 pixel_area, BOOL activate)
return res; return res;
} }
BOOL LLViewerJointAttachment::isObjectAttached(const LLViewerObject *viewer_object) const BOOL LLViewerJointAttachment::isObjectAttached(const LLViewerObject *viewer_object) const
{ {
for (attachedobjs_vec_t::const_iterator iter = mAttachedObjects.begin(); for (attachedobjs_vec_t::const_iterator iter = mAttachedObjects.begin();

View File

@@ -2,31 +2,25 @@
* @file llviewerjointattachment.h * @file llviewerjointattachment.h
* @brief Implementation of LLViewerJointAttachment class * @brief Implementation of LLViewerJointAttachment class
* *
* $LicenseInfo:firstyear=2002&license=viewergpl$ * $LicenseInfo:firstyear=2002&license=viewerlgpl$
*
* Copyright (c) 2002-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code * Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab * Copyright (C) 2010, Linden Research, Inc.
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* *
* There are special exceptions to the terms and conditions of the GPL as * This library is free software; you can redistribute it and/or
* it is applied to this Source Code. View the full text of the exception * modify it under the terms of the GNU Lesser General Public
* in the file doc/FLOSS-exception.txt in this software distribution, or * License as published by the Free Software Foundation;
* online at * version 2.1 of the License only.
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* *
* By copying, modifying or distributing this software, you acknowledge * This library is distributed in the hope that it will be useful,
* that you have read and understood your obligations described above, * but WITHOUT ANY WARRANTY; without even the implied warranty of
* and agree to abide by those obligations. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* *
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * You should have received a copy of the GNU Lesser General Public
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * License along with this library; if not, write to the Free Software
* COMPLETENESS OR PERFORMANCE. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
@@ -76,21 +70,15 @@ public:
void setOriginalPosition(LLVector3 &position); void setOriginalPosition(LLVector3 &position);
void setAttachmentVisibility(BOOL visible); void setAttachmentVisibility(BOOL visible);
void setIsHUDAttachment(BOOL is_hud) { mIsHUDAttachment = is_hud; } void setIsHUDAttachment(BOOL is_hud) { mIsHUDAttachment = is_hud; }
// BOOL getIsHUDAttachment() { return mIsHUDAttachment; }
// [RLVa:KB] - Checked: 2010-09-26 (RLVa-1.3.0a) | Added: RLVa-1.3.0a
BOOL getIsHUDAttachment() const { return mIsHUDAttachment; } BOOL getIsHUDAttachment() const { return mIsHUDAttachment; }
// [/RLVa:KB]
/*virtual*/ BOOL isAnimatable() const { return FALSE; } BOOL isAnimatable() const { return FALSE; }
// S32 getGroup() { return mGroup; }
// S32 getPieSlice() { return mPieSlice; }
// S32 getNumObjects() { return mAttachedObjects.size(); }
// [RLVa:KB] - Checked: 2010-09-26 (RLVa-1.3.0a) | Added: RLVa-1.3.0a
S32 getGroup() const { return mGroup; } S32 getGroup() const { return mGroup; }
S32 getPieSlice() const { return mPieSlice; } S32 getPieSlice() const { return mPieSlice; }
S32 getNumObjects() const { return mAttachedObjects.size(); } S32 getNumObjects() const { return mAttachedObjects.size(); }
// [/RLVa:KB]
void clampObjectPosition();
// //
// unique methods // unique methods
@@ -98,8 +86,6 @@ public:
BOOL addObject(LLViewerObject* object); BOOL addObject(LLViewerObject* object);
void removeObject(LLViewerObject *object); void removeObject(LLViewerObject *object);
void clampObjectPosition();
// //
// attachments operations // attachments operations
// //

View File

@@ -2704,7 +2704,7 @@ void LLViewerObject::processTaskInv(LLMessageSystem* msg, void** user_data)
LLPointer<LLInventoryObject> obj; LLPointer<LLInventoryObject> obj;
obj = new LLInventoryObject(object->mID, LLUUID::null, obj = new LLInventoryObject(object->mID, LLUUID::null,
LLAssetType::AT_CATEGORY, LLAssetType::AT_CATEGORY,
std::string("Contents")); "Contents");
object->mInventory->push_front(obj); object->mInventory->push_front(obj);
object->doInventoryCallback(); object->doInventoryCallback();
delete ft; delete ft;

View File

@@ -1,32 +1,26 @@
/** /**
* @file llvoavatar.cpp * @File llvoavatar.cpp
* @brief Implementation of LLVOAvatar class which is a derivation fo LLViewerObject * @brief Implementation of LLVOAvatar class which is a derivation of LLViewerObject
* *
* $LicenseInfo:firstyear=2001&license=viewergpl$ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
*
* Copyright (c) 2001-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code * Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab * Copyright (C) 2010, Linden Research, Inc.
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* *
* There are special exceptions to the terms and conditions of the GPL as * This library is free software; you can redistribute it and/or
* it is applied to this Source Code. View the full text of the exception * modify it under the terms of the GNU Lesser General Public
* in the file doc/FLOSS-exception.txt in this software distribution, or * License as published by the Free Software Foundation;
* online at * version 2.1 of the License only.
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* *
* By copying, modifying or distributing this software, you acknowledge * This library is distributed in the hope that it will be useful,
* that you have read and understood your obligations described above, * but WITHOUT ANY WARRANTY; without even the implied warranty of
* and agree to abide by those obligations. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* *
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * You should have received a copy of the GNU Lesser General Public
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * License along with this library; if not, write to the Free Software
* COMPLETENESS OR PERFORMANCE. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
@@ -2930,66 +2924,6 @@ void LLVOAvatar::idleUpdateBoobEffect()
mBoobState = newBoobState; mBoobState = newBoobState;
} }
/*
if(mFirstSetActualButtGravRan)
{
// BUTT
EmeraldBoobInputs buttInputs;
buttInputs.type = 1;
buttInputs.chestPosition = mPelvisp->getWorldPosition();
buttInputs.chestRotation = mPelvisp->getWorldRotation();
buttInputs.elapsedTime = mBoobBounceTimer.getElapsedTimeF32();
buttInputs.appearanceFlag = getAppearanceFlag();
EmeraldBoobState newButtState = EmeraldBoobUtils::idleUpdate(sBoobConfig, mLocalBoobConfig, mButtState, buttInputs);
if(mButtState.boobGrav != newButtState.boobGrav)
{
LLVisualParam *param;
param = getVisualParam(795);
ESex avatar_sex = getSex();
param->stopAnimating(FALSE);
param->setWeight(newButtState.boobGrav*0.3f+getActualButtGrav(), FALSE);
param->apply(avatar_sex);
updateVisualParams();
}
mButtState = newButtState;
}
if(mFirstSetActualFatGravRan)
{
// FAT
EmeraldBoobInputs fatInputs;
fatInputs.type = 2;
fatInputs.chestPosition = mPelvisp->getWorldPosition();
fatInputs.chestRotation = mPelvisp->getWorldRotation();
fatInputs.elapsedTime = mBoobBounceTimer.getElapsedTimeF32();
fatInputs.appearanceFlag = getAppearanceFlag();
EmeraldBoobState newFatState = EmeraldBoobUtils::idleUpdate(sBoobConfig, mLocalBoobConfig, mFatState, fatInputs);
if(mFatState.boobGrav != newFatState.boobGrav)
{
LLVisualParam *param;
param = getVisualParam(157);
ESex avatar_sex = getSex();
param->stopAnimating(FALSE);
param->setWeight(newFatState.boobGrav*0.3f+getActualFatGrav(), FALSE);
param->apply(avatar_sex);
updateVisualParams();
}
mFatState = newFatState;
}
*/
} }
void LLVOAvatar::idleUpdateLipSync(bool voice_enabled) void LLVOAvatar::idleUpdateLipSync(bool voice_enabled)
@@ -6863,6 +6797,7 @@ const LLViewerJointAttachment *LLVOAvatar::attachObject(LLViewerObject *viewer_o
// <edit> testzone attachpt // <edit> testzone attachpt
if(!attachment) if(!attachment)
{ {
llwarns << "Failed to find attachment." << llendl;
S32 attachmentID = ATTACHMENT_ID_FROM_STATE(viewer_object->getState()); S32 attachmentID = ATTACHMENT_ID_FROM_STATE(viewer_object->getState());
LLUUID item_id; LLUUID item_id;
LLNameValue* item_id_nv = viewer_object->getNVPair("AttachItemID"); LLNameValue* item_id_nv = viewer_object->getNVPair("AttachItemID");
@@ -7286,6 +7221,7 @@ LLVOAvatar* LLVOAvatar::findAvatarFromAttachment( LLViewerObject* obj )
return NULL; return NULL;
} }
// warning: order(N) not order(1)
S32 LLVOAvatar::getAttachmentCount() S32 LLVOAvatar::getAttachmentCount()
{ {
S32 count = mAttachmentPoints.size(); S32 count = mAttachmentPoints.size();
@@ -8699,7 +8635,6 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id )
// static // static
void LLVOAvatar::dumpArchetypeXML( void* ) void LLVOAvatar::dumpArchetypeXML( void* )
{ {
LLVOAvatar* avatar = gAgentAvatarp;
LLAPRFile outfile(gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER, "new archetype.xml"), LL_APR_WB); LLAPRFile outfile(gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER, "new archetype.xml"), LL_APR_WB);
apr_file_t* file = outfile.getFileHandle() ; apr_file_t* file = outfile.getFileHandle() ;
if( !file ) if( !file )
@@ -8732,7 +8667,8 @@ void LLVOAvatar::dumpArchetypeXML( void* )
{ {
if( LLVOAvatarDictionary::getTEWearableType((ETextureIndex)te) == type ) if( LLVOAvatarDictionary::getTEWearableType((ETextureIndex)te) == type )
{ {
LLViewerTexture* te_image = avatar->getTEImage((ETextureIndex)te); // MULTIPLE_WEARABLES: extend to multiple wearables?
LLViewerTexture* te_image = ((LLVOAvatar *)(gAgentAvatarp))->getImage((ETextureIndex)te, 0);
if( te_image ) if( te_image )
{ {
std::string uuid_str; std::string uuid_str;

View File

@@ -2,31 +2,25 @@
* @file llvoinventorylistener.cpp * @file llvoinventorylistener.cpp
* @brief Interface for classes that wish to receive updates about viewer object inventory * @brief Interface for classes that wish to receive updates about viewer object inventory
* *
* $LicenseInfo:firstyear=2001&license=viewergpl$ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
*
* Copyright (c) 2001-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code * Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab * Copyright (C) 2010, Linden Research, Inc.
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* *
* There are special exceptions to the terms and conditions of the GPL as * This library is free software; you can redistribute it and/or
* it is applied to this Source Code. View the full text of the exception * modify it under the terms of the GNU Lesser General Public
* in the file doc/FLOSS-exception.txt in this software distribution, or * License as published by the Free Software Foundation;
* online at * version 2.1 of the License only.
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* *
* By copying, modifying or distributing this software, you acknowledge * This library is distributed in the hope that it will be useful,
* that you have read and understood your obligations described above, * but WITHOUT ANY WARRANTY; without even the implied warranty of
* and agree to abide by those obligations. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* *
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * You should have received a copy of the GNU Lesser General Public
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * License along with this library; if not, write to the Free Software
* COMPLETENESS OR PERFORMANCE. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$ * $/LicenseInfo$
*/ */

View File

@@ -2,31 +2,25 @@
* @file llvoinventorylistener.h * @file llvoinventorylistener.h
* @brief Interface for classes that wish to receive updates about viewer object inventory * @brief Interface for classes that wish to receive updates about viewer object inventory
* *
* $LicenseInfo:firstyear=2001&license=viewergpl$ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
*
* Copyright (c) 2001-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code * Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab * Copyright (C) 2010, Linden Research, Inc.
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* *
* There are special exceptions to the terms and conditions of the GPL as * This library is free software; you can redistribute it and/or
* it is applied to this Source Code. View the full text of the exception * modify it under the terms of the GNU Lesser General Public
* in the file doc/FLOSS-exception.txt in this software distribution, or * License as published by the Free Software Foundation;
* online at * version 2.1 of the License only.
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* *
* By copying, modifying or distributing this software, you acknowledge * This library is distributed in the hope that it will be useful,
* that you have read and understood your obligations described above, * but WITHOUT ANY WARRANTY; without even the implied warranty of
* and agree to abide by those obligations. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* *
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * You should have received a copy of the GNU Lesser General Public
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * License along with this library; if not, write to the Free Software
* COMPLETENESS OR PERFORMANCE. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$ * $/LicenseInfo$
*/ */

View File

@@ -2,31 +2,25 @@
* @file llwearable.cpp * @file llwearable.cpp
* @brief LLWearable class implementation * @brief LLWearable class implementation
* *
* $LicenseInfo:firstyear=2002&license=viewergpl$ * $LicenseInfo:firstyear=2002&license=viewerlgpl$
*
* Copyright (c) 2002-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code * Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab * Copyright (C) 2010, Linden Research, Inc.
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* *
* There are special exceptions to the terms and conditions of the GPL as * This library is free software; you can redistribute it and/or
* it is applied to this Source Code. View the full text of the exception * modify it under the terms of the GNU Lesser General Public
* in the file doc/FLOSS-exception.txt in this software distribution, or * License as published by the Free Software Foundation;
* online at * version 2.1 of the License only.
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* *
* By copying, modifying or distributing this software, you acknowledge * This library is distributed in the hope that it will be useful,
* that you have read and understood your obligations described above, * but WITHOUT ANY WARRANTY; without even the implied warranty of
* and agree to abide by those obligations. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* *
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * You should have received a copy of the GNU Lesser General Public
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * License along with this library; if not, write to the Free Software
* COMPLETENESS OR PERFORMANCE. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
@@ -528,7 +522,7 @@ BOOL LLWearable::isOldVersion() const
param; param;
param = (LLViewerVisualParam*) gAgentAvatarp->getNextVisualParam() ) param = (LLViewerVisualParam*) gAgentAvatarp->getNextVisualParam() )
{ {
if( (param->getWearableType() == mType) && (param->isTweakable()) ) if( (param->getWearableType() == mType) && (param->isTweakable() ) )
{ {
param_count++; param_count++;
if( !is_in_map(mVisualParamIndexMap, param->getID() ) ) if( !is_in_map(mVisualParamIndexMap, param->getID() ) )
@@ -708,13 +702,7 @@ void LLWearable::writeToAvatar()
//ZOMG: When switching shapes from inventory //ZOMG: When switching shapes from inventory
if(param_id == 507) if(param_id == 507)
gAgentAvatarp->setActualBoobGrav(weight); gAgentAvatarp->setActualBoobGrav(weight);
/*if(param_id == 795)
gAgentAvatarp->setActualButtGrav(weight);
if(param_id == 157)
gAgentAvatarp->setActualFatGrav(weight);
*/
// only animate with user-originated changes
gAgentAvatarp->setVisualParamWeight( param_id, weight, FALSE ); gAgentAvatarp->setVisualParamWeight( param_id, weight, FALSE );
} }
} }
@@ -850,11 +838,6 @@ void LLWearable::copyDataFrom(const LLWearable* src)
//pretty sure right //pretty sure right
if(id == 507) if(id == 507)
gAgentAvatarp->setActualBoobGrav(weight); gAgentAvatarp->setActualBoobGrav(weight);
/*if(id == 795)
gAgentAvatarp->setActualButtGrav(weight);
if(id == 157)
gAgentAvatarp->setActualFatGrav(weight);
*/
mSavedVisualParamMap[id] = weight; mSavedVisualParamMap[id] = weight;
} }
@@ -1059,7 +1042,6 @@ void LLWearable::revertValues()
LLVisualParam *param = getVisualParam(id); LLVisualParam *param = getVisualParam(id);
if(param && !dynamic_cast<LLDriverParam*>(param) ) if(param && !dynamic_cast<LLDriverParam*>(param) )
{ {
//param->setAnimationTarget(value, TRUE);
setVisualParamWeight(id, value, TRUE); setVisualParamWeight(id, value, TRUE);
} }
} }
@@ -1072,7 +1054,6 @@ void LLWearable::revertValues()
LLVisualParam *param = getVisualParam(id); LLVisualParam *param = getVisualParam(id);
if(param && dynamic_cast<LLDriverParam*>(param) ) if(param && dynamic_cast<LLDriverParam*>(param) )
{ {
//param->setAnimationTarget(value, TRUE);
setVisualParamWeight(id, value, TRUE); setVisualParamWeight(id, value, TRUE);
} }
} }
@@ -1335,7 +1316,7 @@ void LLWearable::saveNewAsset() const
{ {
llinfos << "Update Agent Inventory via capability" << llendl; llinfos << "Update Agent Inventory via capability" << llendl;
LLSD body; LLSD body;
body["folder_id"] = gInventory.findCategoryUUIDForType(getAssetType()); body["folder_id"] = gInventory.findCategoryUUIDForType(LLFolderType::assetToFolderType(getAssetType()));
body["asset_type"] = LLAssetType::lookup(getAssetType()); body["asset_type"] = LLAssetType::lookup(getAssetType());
body["inventory_type"] = LLInventoryType::lookup(LLInventoryType::IT_WEARABLE); body["inventory_type"] = LLInventoryType::lookup(LLInventoryType::IT_WEARABLE);
body["name"] = getName(); body["name"] = getName();
@@ -1412,7 +1393,7 @@ std::ostream& operator<<(std::ostream &s, const LLWearable &w)
} }
std::string terse_F32_to_string( F32 f ) std::string terse_F32_to_string(F32 f)
{ {
std::string r = llformat("%.2f", f); std::string r = llformat("%.2f", f);
S32 len = r.length(); S32 len = r.length();

View File

@@ -2,31 +2,25 @@
* @file llwearable.h * @file llwearable.h
* @brief LLWearable class header file * @brief LLWearable class header file
* *
* $LicenseInfo:firstyear=2002&license=viewergpl$ * $LicenseInfo:firstyear=2002&license=viewerlgpl$
*
* Copyright (c) 2002-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code * Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab * Copyright (C) 2010, Linden Research, Inc.
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* *
* There are special exceptions to the terms and conditions of the GPL as * This library is free software; you can redistribute it and/or
* it is applied to this Source Code. View the full text of the exception * modify it under the terms of the GNU Lesser General Public
* in the file doc/FLOSS-exception.txt in this software distribution, or * License as published by the Free Software Foundation;
* online at * version 2.1 of the License only.
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* *
* By copying, modifying or distributing this software, you acknowledge * This library is distributed in the hope that it will be useful,
* that you have read and understood your obligations described above, * but WITHOUT ANY WARRANTY; without even the implied warranty of
* and agree to abide by those obligations. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* *
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * You should have received a copy of the GNU Lesser General Public
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * License along with this library; if not, write to the Free Software
* COMPLETENESS OR PERFORMANCE. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
@@ -55,7 +49,7 @@ class LLWearable
// Constructors and destructors // Constructors and destructors
//-------------------------------------------------------------------- //--------------------------------------------------------------------
private: private:
// Private constructor used by LLWearableList // Private constructors used by LLWearableList
LLWearable(const LLTransactionID& transactionID); LLWearable(const LLTransactionID& transactionID);
LLWearable(const LLAssetID& assetID); LLWearable(const LLAssetID& assetID);
public: public:

View File

@@ -2,31 +2,25 @@
* @file llwearablelist.cpp * @file llwearablelist.cpp
* @brief LLWearableList class implementation * @brief LLWearableList class implementation
* *
* $LicenseInfo:firstyear=2002&license=viewergpl$ * $LicenseInfo:firstyear=2002&license=viewerlgpl$
*
* Copyright (c) 2002-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code * Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab * Copyright (C) 2010, Linden Research, Inc.
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* *
* There are special exceptions to the terms and conditions of the GPL as * This library is free software; you can redistribute it and/or
* it is applied to this Source Code. View the full text of the exception * modify it under the terms of the GNU Lesser General Public
* in the file doc/FLOSS-exception.txt in this software distribution, or * License as published by the Free Software Foundation;
* online at * version 2.1 of the License only.
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* *
* By copying, modifying or distributing this software, you acknowledge * This library is distributed in the hope that it will be useful,
* that you have read and understood your obligations described above, * but WITHOUT ANY WARRANTY; without even the implied warranty of
* and agree to abide by those obligations. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* *
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * You should have received a copy of the GNU Lesser General Public
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * License along with this library; if not, write to the Free Software
* COMPLETENESS OR PERFORMANCE. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
@@ -64,8 +58,6 @@ struct LLWearableArrivedData
S32 mRetries; S32 mRetries;
}; };
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// LLWearableList // LLWearableList
@@ -80,7 +72,7 @@ void LLWearableList::cleanup()
mList.clear(); mList.clear();
} }
void LLWearableList::getAsset( const LLAssetID& assetID, const std::string& wearable_name, LLAssetType::EType asset_type, void(*asset_arrived_callback)(LLWearable*, void* userdata), void* userdata ) void LLWearableList::getAsset(const LLAssetID& assetID, const std::string& wearable_name, LLAssetType::EType asset_type, void(*asset_arrived_callback)(LLWearable*, void* userdata), void* userdata)
{ {
llassert( (asset_type == LLAssetType::AT_CLOTHING) || (asset_type == LLAssetType::AT_BODYPART) ); llassert( (asset_type == LLAssetType::AT_CLOTHING) || (asset_type == LLAssetType::AT_BODYPART) );
LLWearable* instance = get_if_there(mList, assetID, (LLWearable*)NULL ); LLWearable* instance = get_if_there(mList, assetID, (LLWearable*)NULL );
@@ -212,45 +204,6 @@ void LLWearableList::processGetAssetReply( const char* filename, const LLAssetID
} }
// Creates a new wearable just like the old_wearable but with data copied over from item
LLWearable* LLWearableList::createWearableMatchedToInventoryItem( LLWearable* old_wearable, LLViewerInventoryItem* item )
{
lldebugs << "LLWearableList::createWearableMatchedToInventoryItem()" << llendl;
LLWearable* wearable = generateNewWearable();
wearable->copyDataFrom( old_wearable );
wearable->setName( item->getName() );
wearable->setDescription( item->getDescription() );
wearable->setPermissions( item->getPermissions() );
wearable->setSaleInfo( item->getSaleInfo() );
// Send to the dataserver
wearable->saveNewAsset();
return wearable;
}
/*LLWearable* LLWearableList::createCopyFromAvatar( LLWearable* old_wearable, const std::string& new_name )
{
lldebugs << "LLWearableList::createCopyFromAvatar()" << llendl;
LLWearable* wearable = generateNewWearable();
wearable->copyDataFrom( old_wearable );
LLPermissions perm(old_wearable->getPermissions());
perm.setOwnerAndGroup(LLUUID::null, gAgent.getID(), LLUUID::null, true);
wearable->setPermissions(perm);
wearable->readFromAvatar(); // update from the avatar
if (!new_name.empty()) wearable->setName(new_name);
// Send to the dataserver
wearable->saveNewAsset();
return wearable;
}*/
LLWearable* LLWearableList::createCopy(const LLWearable* old_wearable, const std::string& new_name) LLWearable* LLWearableList::createCopy(const LLWearable* old_wearable, const std::string& new_name)
{ {
lldebugs << "LLWearableList::createCopy()" << llendl; lldebugs << "LLWearableList::createCopy()" << llendl;

View File

@@ -2,31 +2,25 @@
* @file llwearablelist.h * @file llwearablelist.h
* @brief LLWearableList class header file * @brief LLWearableList class header file
* *
* $LicenseInfo:firstyear=2002&license=viewergpl$ * $LicenseInfo:firstyear=2002&license=viewerlgpl$
*
* Copyright (c) 2002-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code * Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab * Copyright (C) 2010, Linden Research, Inc.
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* *
* There are special exceptions to the terms and conditions of the GPL as * This library is free software; you can redistribute it and/or
* it is applied to this Source Code. View the full text of the exception * modify it under the terms of the GNU Lesser General Public
* in the file doc/FLOSS-exception.txt in this software distribution, or * License as published by the Free Software Foundation;
* online at * version 2.1 of the License only.
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* *
* By copying, modifying or distributing this software, you acknowledge * This library is distributed in the hope that it will be useful,
* that you have read and understood your obligations described above, * but WITHOUT ANY WARRANTY; without even the implied warranty of
* and agree to abide by those obligations. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* *
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * You should have received a copy of the GNU Lesser General Public
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * License along with this library; if not, write to the Free Software
* COMPLETENESS OR PERFORMANCE. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$ * $/LicenseInfo$
*/ */
@@ -52,7 +46,7 @@ public:
~LLWearableList(); ~LLWearableList();
void cleanup() ; void cleanup() ;
S32 getLength() { return mList.size(); } S32 getLength() const { return mList.size(); }
void getAsset(const LLAssetID& assetID, void getAsset(const LLAssetID& assetID,
const std::string& wearable_name, const std::string& wearable_name,
@@ -60,10 +54,8 @@ public:
void(*asset_arrived_callback)(LLWearable*, void* userdata), void(*asset_arrived_callback)(LLWearable*, void* userdata),
void* userdata); void* userdata);
LLWearable* createWearableMatchedToInventoryItem( LLWearable* old_wearable, LLViewerInventoryItem* item );
//LLWearable* createCopyFromAvatar( LLWearable* old_wearable, const std::string& new_name = std::string() );
LLWearable* createCopy(const LLWearable* old_wearable, const std::string& new_name = std::string()); LLWearable* createCopy(const LLWearable* old_wearable, const std::string& new_name = std::string());
LLWearable* createNewWearable( LLWearableType::EType type ); LLWearable* createNewWearable(LLWearableType::EType type);
// Callback // Callback
static void processGetAssetReply(const char* filename, const LLAssetID& assetID, void* user_data, S32 status, LLExtStat ext_status); static void processGetAssetReply(const char* filename, const LLAssetID& assetID, void* user_data, S32 status, LLExtStat ext_status);

View File

@@ -40,6 +40,7 @@ struct WearableEntry : public LLDictionaryEntry
LLDictionaryEntry(name), LLDictionaryEntry(name),
mAssetType(assetType), mAssetType(assetType),
mDefaultNewName(default_new_name), mDefaultNewName(default_new_name),
//*TODO:Translate
mLabel(/*LLTrans::getString*/(name)), mLabel(/*LLTrans::getString*/(name)),
mIconName(iconName), mIconName(iconName),
mDisableCameraSwitch(disable_camera_switch), mDisableCameraSwitch(disable_camera_switch),

View File

@@ -37,23 +37,23 @@ class LLWearableType
public: public:
enum EType enum EType
{ {
WT_SHAPE = 0, WT_SHAPE = 0,
WT_SKIN = 1, WT_SKIN = 1,
WT_HAIR = 2, WT_HAIR = 2,
WT_EYES = 3, WT_EYES = 3,
WT_SHIRT = 4, WT_SHIRT = 4,
WT_PANTS = 5, WT_PANTS = 5,
WT_SHOES = 6, WT_SHOES = 6,
WT_SOCKS = 7, WT_SOCKS = 7,
WT_JACKET = 8, WT_JACKET = 8,
WT_GLOVES = 9, WT_GLOVES = 9,
WT_UNDERSHIRT = 10, WT_UNDERSHIRT = 10,
WT_UNDERPANTS = 11, WT_UNDERPANTS = 11,
WT_SKIRT = 12, WT_SKIRT = 12,
WT_ALPHA = 13, WT_ALPHA = 13,
WT_TATTOO = 14, WT_TATTOO = 14,
WT_PHYSICS = 15, WT_PHYSICS = 15,
WT_COUNT = 16, WT_COUNT = 16,
WT_INVALID = 255, WT_INVALID = 255,
WT_NONE = -1, WT_NONE = -1,
@@ -73,5 +73,4 @@ protected:
~LLWearableType() {} ~LLWearableType() {}
}; };
#endif // LL_LLWEARABLETYPE_H #endif // LL_LLWEARABLETYPE_H