Update RLVa to 1.4.0-compatible
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
*
|
||||
* Copyright (c) 2009-2010, Kitty Barnett
|
||||
* Copyright (c) 2009-2011, Kitty Barnett
|
||||
*
|
||||
* The source code in this file is provided to you under the terms of the
|
||||
* GNU General Public License, version 2.0, but WITHOUT ANY WARRANTY;
|
||||
@@ -62,7 +62,36 @@ public:
|
||||
// RlvInventory member functions
|
||||
//
|
||||
|
||||
// Checked: 2010-02-28 (RLVa-1.1.3a) | Modified: RLVa-1.0.0h
|
||||
// Checked: 2011-03-28 (RLVa-1.3.0g) | Modified: RLVa-1.3.0g
|
||||
RlvInventory::RlvInventory()
|
||||
: m_fFetchStarted(false), m_fFetchComplete(false)
|
||||
{
|
||||
}
|
||||
|
||||
// Checked: 2011-03-28 (RLVa-1.3.0g) | Added: RLVa-1.3.0g
|
||||
RlvInventory::~RlvInventory()
|
||||
{
|
||||
if (gInventory.containsObserver(this))
|
||||
gInventory.removeObserver(this);
|
||||
}
|
||||
|
||||
// Checked: 2011-03-28 (RLVa-1.3.0g) | Added: RLVa-1.3.0g
|
||||
void RlvInventory::changed(U32 mask)
|
||||
{
|
||||
const std::set<LLUUID>& idsChanged = gInventory.getChangedIDs();
|
||||
if (std::find(idsChanged.begin(), idsChanged.end(), m_idRlvRoot) != idsChanged.end())
|
||||
{
|
||||
gInventory.removeObserver(this);
|
||||
|
||||
LLUUID idRlvRootPrev = m_idRlvRoot;
|
||||
m_idRlvRoot.setNull();
|
||||
|
||||
if (idRlvRootPrev != getSharedRootID())
|
||||
m_OnSharedRootIDChanged();
|
||||
}
|
||||
}
|
||||
|
||||
// Checked: 2010-02-28 (RLVa-1.2.0a) | Modified: RLVa-1.0.0h
|
||||
void RlvInventory::fetchSharedInventory()
|
||||
{
|
||||
// Sanity check - don't fetch if we're already fetching, or if we don't have a shared root
|
||||
@@ -222,25 +251,29 @@ bool RlvInventory::getPath(const uuid_vec_t& idItems, LLInventoryModel::cat_arra
|
||||
return (folders.count() != 0);
|
||||
}
|
||||
|
||||
// Checked: 2010-02-28 (RLVa-1.1.3a) | Modified: RLVa-1.0.0h
|
||||
LLViewerInventoryCategory* RlvInventory::getSharedRoot() const
|
||||
// Checked: 2011-03-28 (RLVa-1.3.0g) | Modified: RLVa-1.3.0g
|
||||
const LLUUID& RlvInventory::getSharedRootID() const
|
||||
{
|
||||
if (gInventory.isInventoryUsable())
|
||||
if ( (m_idRlvRoot.isNull()) && (gInventory.isInventoryUsable()) )
|
||||
{
|
||||
LLInventoryModel::cat_array_t* pFolders; LLInventoryModel::item_array_t* pItems;
|
||||
gInventory.getDirectDescendentsOf(gInventory.getRootFolderID(), pFolders, pItems);
|
||||
if (pFolders)
|
||||
{
|
||||
// NOTE: we might have multiple #RLV folders so we'll just go with the first one we come across
|
||||
LLViewerInventoryCategory* pFolder;
|
||||
const LLViewerInventoryCategory* pFolder;
|
||||
for (S32 idxFolder = 0, cntFolder = pFolders->count(); idxFolder < cntFolder; idxFolder++)
|
||||
{
|
||||
if ( ((pFolder = pFolders->get(idxFolder)) != NULL) && (RlvInventory::cstrSharedRoot == pFolder->getName()) )
|
||||
return pFolder;
|
||||
if ( ((pFolder = pFolders->get(idxFolder)) != NULL) && (cstrSharedRoot == pFolder->getName()) )
|
||||
{
|
||||
if (!gInventory.containsObserver((RlvInventory*)this))
|
||||
gInventory.addObserver((RlvInventory*)this);
|
||||
m_idRlvRoot = pFolder->getUUID();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return m_idRlvRoot;
|
||||
}
|
||||
|
||||
// Checked: 2010-02-28 (RLVa-1.2.0a) | Modified: RLVa-1.0.1a
|
||||
|
||||
Reference in New Issue
Block a user