diff options
Diffstat (limited to 'linden/indra/newview/llinventorybridge.cpp')
-rw-r--r-- | linden/indra/newview/llinventorybridge.cpp | 48 |
1 files changed, 42 insertions, 6 deletions
diff --git a/linden/indra/newview/llinventorybridge.cpp b/linden/indra/newview/llinventorybridge.cpp index fd7d98e..f8baf46 100644 --- a/linden/indra/newview/llinventorybridge.cpp +++ b/linden/indra/newview/llinventorybridge.cpp | |||
@@ -88,10 +88,14 @@ | |||
88 | void inc_busy_count() | 88 | void inc_busy_count() |
89 | { | 89 | { |
90 | // gViewerWindow->getWindow()->incBusyCount(); | 90 | // gViewerWindow->getWindow()->incBusyCount(); |
91 | // check balance of these calls if this code is changed to ever actually | ||
92 | // *do* something! | ||
91 | } | 93 | } |
92 | void dec_busy_count() | 94 | void dec_busy_count() |
93 | { | 95 | { |
94 | // gViewerWindow->getWindow()->decBusyCount(); | 96 | // gViewerWindow->getWindow()->decBusyCount(); |
97 | // check balance of these calls if this code is changed to ever actually | ||
98 | // *do* something! | ||
95 | } | 99 | } |
96 | 100 | ||
97 | // Function declarations | 101 | // Function declarations |
@@ -906,7 +910,7 @@ BOOL LLItemBridge::removeItem() | |||
906 | return FALSE; | 910 | return FALSE; |
907 | } | 911 | } |
908 | // move it to the trash | 912 | // move it to the trash |
909 | LLPreview::hide(mUUID); | 913 | LLPreview::hide(mUUID, TRUE); |
910 | LLInventoryModel* model = mInventoryPanel->getModel(); | 914 | LLInventoryModel* model = mInventoryPanel->getModel(); |
911 | if(!model) return FALSE; | 915 | if(!model) return FALSE; |
912 | LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH); | 916 | LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH); |
@@ -1365,6 +1369,17 @@ protected: | |||
1365 | 1369 | ||
1366 | void LLRightClickInventoryFetchDescendentsObserver::done() | 1370 | void LLRightClickInventoryFetchDescendentsObserver::done() |
1367 | { | 1371 | { |
1372 | // Avoid passing a NULL-ref as mCompleteFolders.front() down to | ||
1373 | // gInventory.collectDescendents() | ||
1374 | if( mCompleteFolders.empty() ) | ||
1375 | { | ||
1376 | llwarns << "LLRightClickInventoryFetchDescendentsObserver::done with empty mCompleteFolders" << llendl; | ||
1377 | dec_busy_count(); | ||
1378 | gInventory.removeObserver(this); | ||
1379 | delete this; | ||
1380 | return; | ||
1381 | } | ||
1382 | |||
1368 | // What we do here is get the complete information on the items in | 1383 | // What we do here is get the complete information on the items in |
1369 | // the library, and set up an observer that will wait for that to | 1384 | // the library, and set up an observer that will wait for that to |
1370 | // happen. | 1385 | // happen. |
@@ -1375,7 +1390,7 @@ void LLRightClickInventoryFetchDescendentsObserver::done() | |||
1375 | item_array, | 1390 | item_array, |
1376 | LLInventoryModel::EXCLUDE_TRASH); | 1391 | LLInventoryModel::EXCLUDE_TRASH); |
1377 | S32 count = item_array.count(); | 1392 | S32 count = item_array.count(); |
1378 | #if 0 | 1393 | #if 0 // HACK/TODO: Why? |
1379 | // This early causes a giant menu to get produced, and doesn't seem to be needed. | 1394 | // This early causes a giant menu to get produced, and doesn't seem to be needed. |
1380 | if(!count) | 1395 | if(!count) |
1381 | { | 1396 | { |
@@ -2919,7 +2934,6 @@ void LLGestureBridge::openItem() | |||
2919 | BOOL LLGestureBridge::removeItem() | 2934 | BOOL LLGestureBridge::removeItem() |
2920 | { | 2935 | { |
2921 | // Force close the preview window, if it exists | 2936 | // Force close the preview window, if it exists |
2922 | LLPreview::hide(mUUID); | ||
2923 | gGestureManager.deactivateGesture(mUUID); | 2937 | gGestureManager.deactivateGesture(mUUID); |
2924 | return LLItemBridge::removeItem(); | 2938 | return LLItemBridge::removeItem(); |
2925 | } | 2939 | } |
@@ -3458,13 +3472,27 @@ public: | |||
3458 | { | 3472 | { |
3459 | /* | 3473 | /* |
3460 | * Do nothing. We only care about the destructor | 3474 | * Do nothing. We only care about the destructor |
3475 | * | ||
3476 | * The reason for this is that this callback is used in a hack where the | ||
3477 | * same callback is given to dozens of items, and the destructor is called | ||
3478 | * after the last item has fired the event and dereferenced it -- if all | ||
3479 | * the events actually fire! | ||
3461 | */ | 3480 | */ |
3462 | } | 3481 | } |
3463 | 3482 | ||
3464 | protected: | 3483 | protected: |
3465 | ~LLWearInventoryCategoryCallback() | 3484 | ~LLWearInventoryCategoryCallback() |
3466 | { | 3485 | { |
3467 | wear_inventory_category_on_avatar(gInventory.getCategory(mCatID), mAppend); | 3486 | // Is the destructor called by ordinary dereference, or because the app's shutting down? |
3487 | // If the inventory callback manager goes away, we're shutting down, no longer want the callback. | ||
3488 | if( LLInventoryCallbackManager::is_instantiated() ) | ||
3489 | { | ||
3490 | wear_inventory_category_on_avatar(gInventory.getCategory(mCatID), mAppend); | ||
3491 | } | ||
3492 | else | ||
3493 | { | ||
3494 | llwarns << "Dropping unhandled LLWearInventoryCategoryCallback" << llendl; | ||
3495 | } | ||
3468 | } | 3496 | } |
3469 | 3497 | ||
3470 | private: | 3498 | private: |
@@ -4214,8 +4242,17 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) | |||
4214 | items.push_back("Restore Item"); | 4242 | items.push_back("Restore Item"); |
4215 | } | 4243 | } |
4216 | else | 4244 | else |
4217 | { | 4245 | { // FWIW, it looks like SUPPRESS_OPEN_ITEM is not set anywhere |
4218 | BOOL no_open = ((flags & SUPPRESS_OPEN_ITEM) == SUPPRESS_OPEN_ITEM); | 4246 | BOOL no_open = ((flags & SUPPRESS_OPEN_ITEM) == SUPPRESS_OPEN_ITEM); |
4247 | |||
4248 | // If we have clothing, don't add "Open" as it's the same action as "Wear" SL-18976 | ||
4249 | LLViewerInventoryItem* item = getItem(); | ||
4250 | if( !no_open && item ) | ||
4251 | { | ||
4252 | no_open = (item->getType() == LLAssetType::AT_CLOTHING) || | ||
4253 | (item->getType() == LLAssetType::AT_BODYPART); | ||
4254 | } | ||
4255 | |||
4219 | if (!no_open) | 4256 | if (!no_open) |
4220 | { | 4257 | { |
4221 | items.push_back("Open"); | 4258 | items.push_back("Open"); |
@@ -4242,7 +4279,6 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) | |||
4242 | LLWearableBridge::canEditOnAvatar, | 4279 | LLWearableBridge::canEditOnAvatar, |
4243 | (void*)this));*/ | 4280 | (void*)this));*/ |
4244 | 4281 | ||
4245 | LLViewerInventoryItem* item = getItem(); | ||
4246 | if( item && (item->getType() == LLAssetType::AT_CLOTHING) ) | 4282 | if( item && (item->getType() == LLAssetType::AT_CLOTHING) ) |
4247 | { | 4283 | { |
4248 | items.push_back("Take Off"); | 4284 | items.push_back("Take Off"); |