summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llappviewer.cpp2
-rw-r--r--indra/newview/llinventorybridge.h159
-rw-r--r--indra/newview/llinventorymodel.cpp210
-rw-r--r--indra/newview/llpanelplaceinfo.cpp1
4 files changed, 105 insertions, 267 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 48cb3babfa..3fc3c8e382 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -3652,7 +3652,7 @@ void LLAppViewer::idleShutdown()
if (!saved_teleport_history)
{
saved_teleport_history = true;
- LLTeleportHistory::getInstance()->save();
+ LLTeleportHistory::getInstance()->dump();
LLLocationHistory::getInstance()->save(); // *TODO: find a better place for doing this
return;
}
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index b55a6a658b..3958f7e9c2 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -575,165 +575,6 @@ public:
// This method is a convenience function which creates the correct
// type of bridge action based on some basic information
static LLInvFVBridgeAction* createAction(LLAssetType::EType asset_type,
- const LLUUID& uuid,LLInventoryModel* model);
-
- static void doAction(LLAssetType::EType asset_type,
- const LLUUID& uuid,LLInventoryModel* model);
-
- virtual void doIt() { };
- virtual ~LLInvFVBridgeAction(){}//need this because of warning on OSX
-protected:
- LLInvFVBridgeAction(const LLUUID& id,LLInventoryModel* model):mUUID(id),mModel(model){}
-
- LLViewerInventoryItem* getItem() const;
-protected:
- const LLUUID& mUUID; // item id
- LLInventoryModel* mModel;
-
-};
-
-
-
-class LLTextureBridgeAction: public LLInvFVBridgeAction
-{
- friend class LLInvFVBridgeAction;
-public:
- virtual void doIt() ;
- virtual ~LLTextureBridgeAction(){}
-protected:
- LLTextureBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){}
-
-};
-
-
-class LLSoundBridgeAction: public LLInvFVBridgeAction
-{
- friend class LLInvFVBridgeAction;
-public:
- virtual void doIt() ;
- virtual ~LLSoundBridgeAction(){}
-protected:
- LLSoundBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){}
-
-};
-
-
-class LLLandmarkBridgeAction: public LLInvFVBridgeAction
-{
- friend class LLInvFVBridgeAction;
-public:
- virtual void doIt() ;
- virtual ~LLLandmarkBridgeAction(){}
-protected:
- LLLandmarkBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){}
-
-};
-
-
-class LLCallingCardBridgeAction: public LLInvFVBridgeAction
-{
- friend class LLInvFVBridgeAction;
-public:
- virtual void doIt() ;
- virtual ~LLCallingCardBridgeAction(){}
-protected:
- LLCallingCardBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){}
-
-};
-
-
-class LLNotecardBridgeAction: public LLInvFVBridgeAction
-{
- friend class LLInvFVBridgeAction;
-public:
- virtual void doIt() ;
- virtual ~LLNotecardBridgeAction(){}
-protected:
- LLNotecardBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){}
-
-};
-
-
-class LLGestureBridgeAction: public LLInvFVBridgeAction
-{
- friend class LLInvFVBridgeAction;
-public:
- virtual void doIt() ;
- virtual ~LLGestureBridgeAction(){}
-protected:
- LLGestureBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){}
-
-};
-
-
-class LLAnimationBridgeAction: public LLInvFVBridgeAction
-{
- friend class LLInvFVBridgeAction;
-public:
- virtual void doIt() ;
- virtual ~LLAnimationBridgeAction(){}
-protected:
- LLAnimationBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){}
-
-};
-
-
-class LLObjectBridgeAction: public LLInvFVBridgeAction
-{
- friend class LLInvFVBridgeAction;
-public:
- virtual void doIt() ;
- virtual ~LLObjectBridgeAction(){}
-protected:
- LLObjectBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){}
-
-};
-
-
-class LLLSLTextBridgeAction: public LLInvFVBridgeAction
-{
- friend class LLInvFVBridgeAction;
-public:
- virtual void doIt() ;
- virtual ~LLLSLTextBridgeAction(){}
-protected:
- LLLSLTextBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){}
-
-};
-
-
-class LLWearableBridgeAction: public LLInvFVBridgeAction
-{
- friend class LLInvFVBridgeAction;
-public:
- virtual void doIt();
- virtual ~LLWearableBridgeAction(){}
-protected:
- LLWearableBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){}
-
-
- BOOL isInTrash() const;
- // return true if the item is in agent inventory. if false, it
- // must be lost or in the inventory library.
- BOOL isAgentInventory() const;
-
- void wearOnAvatar();
-
-};
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// Class LLInvFVBridgeAction (& it's derived classes)
-//
-// This is an implementation class to be able to
-// perform action to view inventory items.
-//
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-class LLInvFVBridgeAction
-{
-public:
- // This method is a convenience function which creates the correct
- // type of bridge action based on some basic information
- static LLInvFVBridgeAction* createAction(LLAssetType::EType asset_type,
const LLUUID& uuid,LLInventoryModel* model);
static void doAction(LLAssetType::EType asset_type,
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 9177d51d5c..bac02e30bf 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -1844,7 +1844,7 @@ bool LLInventoryModel::isCategoryComplete(const LLUUID& cat_id) const
}
bool LLInventoryModel::loadSkeleton(
- const LLInventoryModel::options_t& options,
+ const LLSD& options,
const LLUUID& owner_id)
{
lldebugs << "importing inventory skeleton for " << owner_id << llendl;
@@ -1857,44 +1857,41 @@ bool LLInventoryModel::loadSkeleton(
LLUUID id;
LLAssetType::EType preferred_type;
bool rv = true;
- for(options_t::const_iterator it = options.begin(); it < options.end(); ++it)
- {
- LLPointer<LLViewerInventoryCategory> cat = new LLViewerInventoryCategory(owner_id);
- response_t::const_iterator no_response = (*it).end();
- response_t::const_iterator skel;
- skel = (*it).find("name");
- if(skel == no_response) goto clean_cat;
- cat->rename(std::string((*skel).second));
- skel = (*it).find("folder_id");
- if(skel == no_response) goto clean_cat;
- id.set((*skel).second);
- // if an id is null, it locks the viewer.
- if(id.isNull()) goto clean_cat;
- cat->setUUID(id);
- skel = (*it).find("parent_id");
- if(skel == no_response) goto clean_cat;
- id.set((*skel).second);
- cat->setParent(id);
- skel = (*it).find("type_default");
- if(skel == no_response)
- {
- preferred_type = LLAssetType::AT_NONE;
+
+ for(LLSD::array_const_iterator it = options.beginArray(),
+ end = options.endArray(); it != end; ++it)
+ {
+ LLSD name = (*it)["name"];
+ LLSD folder_id = (*it)["folder_id"];
+ LLSD parent_id = (*it)["parent_id"];
+ LLSD version = (*it)["version"];
+ if(name.isDefined()
+ && folder_id.isDefined()
+ && parent_id.isDefined()
+ && version.isDefined()
+ && folder_id.asUUID().notNull() // if an id is null, it locks the viewer.
+ )
+ {
+ LLPointer<LLViewerInventoryCategory> cat = new LLViewerInventoryCategory(owner_id);
+ cat->rename(name.asString());
+ cat->setUUID(folder_id.asUUID());
+ cat->setParent(parent_id.asUUID());
+
+ LLAssetType::EType preferred_type = LLAssetType::AT_NONE;
+ LLSD type_default = (*it)["type_default"];
+ if(type_default.isDefined())
+ {
+ preferred_type = (LLAssetType::EType)type_default.asInteger();
+ }
+ cat->setPreferredType(preferred_type);
+ cat->setVersion(version.asInteger());
+ temp_cats.insert(cat);
}
else
{
- S32 t = atoi((*skel).second.c_str());
- preferred_type = (LLAssetType::EType)t;
+ llwarns << "Unable to import near " << name.asString() << llendl;
+ rv = false;
}
- cat->setPreferredType(preferred_type);
- skel = (*it).find("version");
- if(skel == no_response) goto clean_cat;
- cat->setVersion(atoi((*skel).second.c_str()));
- temp_cats.insert(cat);
- continue;
- clean_cat:
- llwarns << "Unable to import near " << cat->getName() << llendl;
- rv = false;
- //delete cat; // automatic when cat is reasigned or destroyed
}
S32 cached_category_count = 0;
@@ -2053,85 +2050,84 @@ bool LLInventoryModel::loadSkeleton(
return rv;
}
-bool LLInventoryModel::loadMeat(
- const LLInventoryModel::options_t& options, const LLUUID& owner_id)
+bool LLInventoryModel::loadMeat(const LLSD& options, const LLUUID& owner_id)
{
llinfos << "importing inventory for " << owner_id << llendl;
- LLPermissions default_perm;
- default_perm.init(LLUUID::null, owner_id, LLUUID::null, LLUUID::null);
- LLPointer<LLViewerInventoryItem> item;
- LLUUID id;
- LLAssetType::EType type;
- LLInventoryType::EType inv_type;
bool rv = true;
- for(options_t::const_iterator it = options.begin(); it < options.end(); ++it)
- {
- item = new LLViewerInventoryItem;
- response_t::const_iterator no_response = (*it).end();
- response_t::const_iterator meat;
- meat = (*it).find("name");
- if(meat == no_response) goto clean_item;
- item->rename(std::string((*meat).second));
- meat = (*it).find("item_id");
- if(meat == no_response) goto clean_item;
- id.set((*meat).second);
- item->setUUID(id);
- meat = (*it).find("parent_id");
- if(meat == no_response) goto clean_item;
- id.set((*meat).second);
- item->setParent(id);
- meat = (*it).find("type");
- if(meat == no_response) goto clean_item;
- type = (LLAssetType::EType)atoi((*meat).second.c_str());
- item->setType(type);
- meat = (*it).find("inv_type");
- if(meat != no_response)
- {
- inv_type = (LLInventoryType::EType)atoi((*meat).second.c_str());
- item->setInventoryType(inv_type);
- }
- meat = (*it).find("data_id");
- if(meat == no_response) goto clean_item;
- id.set((*meat).second);
- if(LLAssetType::AT_CALLINGCARD == type)
- {
- LLPermissions perm;
- perm.init(id, owner_id, LLUUID::null, LLUUID::null);
- item->setPermissions(perm);
- }
- else
- {
- meat = (*it).find("perm_mask");
- if(meat != no_response)
- {
- PermissionMask perm_mask = atoi((*meat).second.c_str());
- default_perm.initMasks(
+ for(LLSD::array_const_iterator it = options.beginArray(),
+ end = options.endArray(); it != end; ++it)
+ {
+ LLSD name = (*it)["name"];
+ LLSD item_id = (*it)["item_id"];
+ LLSD parent_id = (*it)["parent_id"];
+ LLSD asset_type = (*it)["type"];
+ LLSD data_id = (*it)["data_id"];
+ if(name.isDefined()
+ && item_id.isDefined()
+ && parent_id.isDefined()
+ && asset_type.isDefined()
+ && data_id.isDefined())
+ {
+ LLPointer<LLViewerInventoryItem> item = new LLViewerInventoryItem;
+ item->rename(name.asString());
+ item->setUUID(item_id.asUUID());
+ item->setParent(parent_id.asUUID());
+ LLAssetType::EType type = (LLAssetType::EType)asset_type.asInteger();
+ item->setType(type);
+
+ LLSD llsd_inv_type = (*it)["inv_type"];
+ if(llsd_inv_type.isDefined())
+ {
+ LLInventoryType::EType inv_type = (LLInventoryType::EType)llsd_inv_type.asInteger();
+ item->setInventoryType(inv_type);
+ }
+
+ if(LLAssetType::AT_CALLINGCARD == type)
+ {
+ LLPermissions perm;
+ perm.init(data_id.asUUID(), owner_id, LLUUID::null, LLUUID::null);
+ item->setPermissions(perm);
+ }
+ else
+ {
+ LLPermissions default_perm;
+ default_perm.init(LLUUID::null, owner_id, LLUUID::null, LLUUID::null);
+ LLSD llsd_perm_mask = (*it)["perm_mask"];
+ if(llsd_perm_mask.isDefined())
+ {
+ PermissionMask perm_mask = llsd_perm_mask.asInteger();
+ default_perm.initMasks(
perm_mask, perm_mask, perm_mask, perm_mask, perm_mask);
- }
- else
- {
- default_perm.initMasks(
- PERM_NONE, PERM_NONE, PERM_NONE, PERM_NONE, PERM_NONE);
- }
- item->setPermissions(default_perm);
- item->setAssetUUID(id);
- }
- meat = (*it).find("flags");
- if(meat != no_response)
- {
- item->setFlags(strtoul((*meat).second.c_str(), NULL, 0));
+ }
+ else
+ {
+ default_perm.initMasks(
+ PERM_NONE, PERM_NONE, PERM_NONE, PERM_NONE, PERM_NONE);
+ }
+ item->setPermissions(default_perm);
+ item->setAssetUUID(data_id.asUUID());
+ }
+
+ LLSD flags = (*it)["flags"];
+ if(flags.isDefined())
+ {
+ // Not sure how well LLSD.asInteger() maps to
+ // unsigned long - using strtoul()
+ item->setFlags(strtoul(flags.asString().c_str(), NULL, 0));
+ }
+
+ LLSD time = (*it)["time"];
+ if(time.isDefined())
+ {
+ item->setCreationDate(time.asInteger());
+ }
+ addItem(item);
}
- meat = (*it).find("time");
- if(meat != no_response)
+ else
{
- item->setCreationDate(atoi((*meat).second.c_str()));
+ llwarns << "Unable to import near " << name.asString() << llendl;
+ rv = false;
}
- addItem(item);
- continue;
- clean_item:
- llwarns << "Unable to import near " << item->getName() << llendl;
- rv = false;
- //delete item; // automatic when item is reassigned or destroyed
}
return rv;
}
diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp
index 3ed93e5598..951c223668 100644
--- a/indra/newview/llpanelplaceinfo.cpp
+++ b/indra/newview/llpanelplaceinfo.cpp
@@ -61,6 +61,7 @@
#include "lluictrlfactory.h"
#include "llweb.h"
#include "llsdutil.h"
+#include "llsdutil_math.h"
static LLRegisterPanelClassWrapper<LLPanelPlaceInfo> t_places("panel_landmark_info");