CHUI-659 : WIP : Verified (tested) and cleaned up some CHUI-101 refactoring code.

meow-7.2.2
Merov Linden 2013-01-07 15:32:47 -08:00
parent 613b7a45a7
commit 3d0ec3da5b
4 changed files with 10 additions and 28 deletions

View File

@ -401,8 +401,8 @@ public:
virtual const FilterType& getFilter() const { return mFilter; }
virtual void setFilter(const FilterType& filter) { mFilter = filter; }
// TODO RN: remove this and put all filtering logic in view model
// add getStatusText and isFiltering()
// By default, we assume the content is available. If a network fetch mechanism is implemented for the model,
// this method needs to be overloaded and return the relevant fetch status.
virtual bool contentsReady() { return true; }

View File

@ -42,8 +42,6 @@
#include "llclipboard.h"
#include "lltrans.h"
//TODO RN: fix use of static cast as much as possible
LLFastTimer::DeclareTimer FT_FILTER_CLIPBOARD("Filter Clipboard");
LLInventoryFilter::FilterOps::FilterOps(const Params& p)
@ -83,7 +81,7 @@ LLInventoryFilter::LLInventoryFilter(const Params& p)
bool LLInventoryFilter::check(const LLFolderViewModelItem* item)
{
const LLFolderViewModelItemInventory* listener = static_cast<const LLFolderViewModelItemInventory*>(item);
const LLFolderViewModelItemInventory* listener = dynamic_cast<const LLFolderViewModelItemInventory*>(item);
// Clipboard cut items are *always* filtered so we need this value upfront
const BOOL passed_clipboard = (listener ? checkAgainstClipboard(listener->getUUID()) : TRUE);
@ -122,7 +120,7 @@ bool LLInventoryFilter::check(const LLInventoryItem* item)
bool LLInventoryFilter::checkFolder(const LLFolderViewModelItem* item) const
{
const LLFolderViewModelItemInventory* listener = static_cast<const LLFolderViewModelItemInventory*>(item);
const LLFolderViewModelItemInventory* listener = dynamic_cast<const LLFolderViewModelItemInventory*>(item);
if (!listener)
{
llerrs << "Folder view event listener not found." << llendl;
@ -384,8 +382,7 @@ const std::string& LLInventoryFilter::getFilterSubString(BOOL trim) const
std::string::size_type LLInventoryFilter::getStringMatchOffset(LLFolderViewModelItem* item) const
{
const LLFolderViewModelItemInventory* listener = static_cast<const LLFolderViewModelItemInventory*>(item);
return mFilterSubString.size() ? listener->getSearchableName().find(mFilterSubString) : std::string::npos;
return mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos;
}
bool LLInventoryFilter::isDefault() const

View File

@ -1555,6 +1555,10 @@ void LLPanelObjectInventory::reset()
mCommitCallbackRegistrar.pushScope(); // push local callbacks
// Reset the inventory model to show all folders by default
mInventoryViewModel.getFilter().setShowFolderState(LLInventoryFilter::SHOW_ALL_FOLDERS);
// Create a new folder view root
LLRect dummy_rect(0, 1, 1, 0);
LLFolderView::Params p;
p.name = "task inventory";
@ -1566,11 +1570,7 @@ void LLPanelObjectInventory::reset()
p.view_model = &mInventoryViewModel;
p.root = NULL;
mFolders = LLUICtrlFactory::create<LLFolderView>(p);
// this ensures that we never say "searching..." or "no items found"
//TODO RN: make this happen by manipulating filter object directly
LLInventoryFilter& inventoryFilter = dynamic_cast<LLInventoryFilter&>(mFolders->getFolderViewModel()->getFilter());
inventoryFilter.setShowFolderState(LLInventoryFilter::SHOW_ALL_FOLDERS);
mFolders->setCallbackRegistrar(&mCommitCallbackRegistrar);
if (hasFocus())

View File

@ -652,26 +652,11 @@ void LLFloaterTexturePicker::draw()
{
folder_view->setPinningSelectedItem(mSelectedItemPinned);
folder_view->getViewModelItem()->dirtyFilter();
//TODO RN: test..still works without this?
//folder_view->arrangeFromRoot();
mSelectedItemPinned = TRUE;
}
}
}
// static
/*
void LLFloaterTexturePicker::onSaveAnotherCopyDialog( S32 option, void* userdata )
{
LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
if( 0 == option )
{
self->copyToInventoryFinal();
}
}
*/
const LLUUID& LLFloaterTexturePicker::findItemID(const LLUUID& asset_id, BOOL copyable_only)
{
LLViewerInventoryCategory::cat_array_t cats;