summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Antipov <mantipov@productengine.com>2010-04-19 14:12:42 +0300
committerMike Antipov <mantipov@productengine.com>2010-04-19 14:12:42 +0300
commit59d296e2008847b944678f6e3b873435e6d5f826 (patch)
treea1463939ed33485a20f911f510deb55b37f78cb7
parent71c7b2f6d76b29c527d07c01c52127bf4f5b402e (diff)
Fixed major bug EXT-6682 (Emptying Lost & Found Folder can crash Viewer2.0 if recent item was added)
Reason: a pointer to renamed item was not nullified in Folder View when rename control lost focus. Fix: updated focus lost callback to nullify the pointer to renamed item. Had to made this callback non-static to have access to Folder View's member pointer. Also made "New..." menu items disabled for Lost & Found folder. Reviewed by Tofu Linden at https://codereview.productengine.com/secondlife/r/251/ --HG-- branch : product-engine
-rw-r--r--indra/newview/llfolderview.cpp6
-rw-r--r--indra/newview/llfolderview.h2
-rw-r--r--indra/newview/llinventorybridge.cpp7
3 files changed, 11 insertions, 4 deletions
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 8d4d6a178a..c492bfcef1 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -1416,8 +1416,8 @@ void LLFolderView::startRenamingSelectedItem( void )
mRenamer->setVisible( TRUE );
// set focus will fail unless item is visible
mRenamer->setFocus( TRUE );
- mRenamer->setTopLostCallback(boost::bind(onRenamerLost, _1));
- mRenamer->setFocusLostCallback(boost::bind(onRenamerLost, _1));
+ mRenamer->setTopLostCallback(boost::bind(&LLFolderView::onRenamerLost, this, _1));
+ mRenamer->setFocusLostCallback(boost::bind(&LLFolderView::onRenamerLost, this, _1));
gViewerWindow->addPopup(mRenamer);
}
}
@@ -2386,9 +2386,9 @@ S32 LLFolderView::notify(const LLSD& info)
/// Local function definitions
///----------------------------------------------------------------------------
-//static
void LLFolderView::onRenamerLost( LLFocusableElement* renamer)
{
+ mRenameItem = NULL;
LLUICtrl* uictrl = dynamic_cast<LLUICtrl*>(renamer);
if (uictrl)
{
diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h
index 42390dfd17..874723bb1a 100644
--- a/indra/newview/llfolderview.h
+++ b/indra/newview/llfolderview.h
@@ -279,7 +279,7 @@ protected:
LLScrollContainer* mScrollContainer; // NULL if this is not a child of a scroll container.
void commitRename( const LLSD& data );
- static void onRenamerLost( LLFocusableElement* renamer);
+ void onRenamerLost( LLFocusableElement* renamer);
void finishRenamingItem( void );
void closeRenamer( void );
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 3071ef3b71..b85bf0d518 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -2680,6 +2680,13 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
{
// This is the lost+found folder.
mItems.push_back(std::string("Empty Lost And Found"));
+
+ mDisabledItems.push_back(std::string("New Folder"));
+ mDisabledItems.push_back(std::string("New Script"));
+ mDisabledItems.push_back(std::string("New Note"));
+ mDisabledItems.push_back(std::string("New Gesture"));
+ mDisabledItems.push_back(std::string("New Clothes"));
+ mDisabledItems.push_back(std::string("New Body Parts"));
}
if(trash_id == mUUID)