diff options
| author | Dave Parks <davep@lindenlab.com> | 2009-11-24 23:21:57 -0600 |
|---|---|---|
| committer | Dave Parks <davep@lindenlab.com> | 2009-11-24 23:21:57 -0600 |
| commit | e264f00c833805e1f813bc1d0b2cfd7a1bf7b272 (patch) | |
| tree | 1a64a520502d2ed2c7dadc2316e543ae9e9a91d2 /indra/newview/llviewerinventory.cpp | |
| parent | c9e153c182dae9472a2b87cddfec8c47b30b06b9 (diff) | |
| parent | 5b5354c933aa7b1ceeb307853c24fba28d4e31bf (diff) | |
Merge
Diffstat (limited to 'indra/newview/llviewerinventory.cpp')
| -rw-r--r-- | indra/newview/llviewerinventory.cpp | 43 |
1 files changed, 38 insertions, 5 deletions
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 1d62ead843..c6ec25c1cb 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -56,11 +56,43 @@ #include "lltrans.h" #include "llappearancemgr.h" #include "llfloatercustomize.h" +#include "llcommandhandler.h" +#include "llviewermessage.h" ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs ///---------------------------------------------------------------------------- +class LLInventoryHandler : public LLCommandHandler +{ +public: + // requires trusted browser to trigger + LLInventoryHandler() : LLCommandHandler("inventory", UNTRUSTED_THROTTLE) { } + + bool handle(const LLSD& params, const LLSD& query_map, + LLMediaCtrl* web) + { + if (params.size() < 2) return false; + LLUUID inventory_id; + if (!inventory_id.set(params[0], FALSE)) + { + return false; + } + + const std::string verb = params[1].asString(); + if (verb == "select") + { + std::vector<LLUUID> items_to_open; + items_to_open.push_back(inventory_id); + open_inventory_offer(items_to_open, ""); + return true; + } + + return false; + } +}; +LLInventoryHandler gInventoryHandler; + ///---------------------------------------------------------------------------- /// Class LLViewerInventoryItem ///---------------------------------------------------------------------------- @@ -1215,11 +1247,6 @@ void LLViewerInventoryItem::rename(const std::string& n) const LLPermissions& LLViewerInventoryItem::getPermissions() const { - if (const LLViewerInventoryItem *linked_item = getLinkedItem()) - { - return linked_item->getPermissions(); - } - // Use the actual permissions of the symlink, not its parent. return LLInventoryItem::getPermissions(); } @@ -1341,6 +1368,12 @@ BOOL LLViewerInventoryItem::extractSortFieldAndDisplayName(const std::string& na return result; } +void LLViewerInventoryItem::insertDefaultSortField(std::string& name) +{ + name.insert(0, std::string("1") + getSeparator()); +} + + // This returns true if the item that this item points to // doesn't exist in memory (i.e. LLInventoryModel). The baseitem // might still be in the database but just not loaded yet. |
