diff options
author | Merov Linden <merov@lindenlab.com> | 2011-11-17 19:48:39 -0800 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2011-11-17 19:48:39 -0800 |
commit | 28344855dc4c4b20f4188e7dd64991707d87377f (patch) | |
tree | 12baafe5906b589c620a265a0372ebac50757a0a /indra/newview | |
parent | 13a7fbc7a0cf460b4f57028b2e46c33426aa3a01 (diff) |
EXP-1498 : Always create the folder widget, move empty filtering to foltering code. Still update issues though.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llinventoryfilter.cpp | 13 | ||||
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 41 |
2 files changed, 23 insertions, 31 deletions
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 516b47e616..438081c177 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -36,6 +36,7 @@ #include "llviewercontrol.h" #include "llfolderview.h" #include "llinventorybridge.h" +#include "llviewerfoldertype.h" // linden library includes #include "lltrans.h" @@ -117,7 +118,17 @@ bool LLInventoryFilter::checkFolder(const LLFolderViewFolder* folder) const LLFolderViewEventListener* listener = folder->getListener(); const LLUUID folder_id = listener->getUUID(); - + + const LLInvFVBridge *bridge = dynamic_cast<const LLInvFVBridge *>(folder->getListener()); + bool is_system_folder = bridge->isSystemFolder(); + bool is_hidden_if_empty = LLViewerFolderType::lookupIsHiddenIfEmpty(listener->getPreferredType()); + bool is_empty = (gInventory.categoryHasChildren(folder_id) != LLInventoryModel::CHILDREN_YES); + + if (is_system_folder && is_empty && is_hidden_if_empty) + { + return false; + } + if (mFilterOps.mFilterTypes & FILTERTYPE_CATEGORY) { // Can only filter categories for items in your inventory diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index aff48b1961..a9ec4af4f3 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -618,41 +618,22 @@ LLFolderView * LLInventoryPanel::createFolderView(LLInvFVBridge * bridge, bool u LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge) { - // Create the folder ui widget, unless it's an empty system folder that should be hidden - // Note : we still let the code create a listener for it (in case something shows up in it) - // but we simply skip creating the ui ctrl and adding it. - // *TODO : Need to be verified: if the listener is triggered and something added, will the code - // crash (because it's assuming, wrongly, that the uictrl exists)? - - bool is_system_folder = bridge->isSystemFolder(); - bool is_hidden_if_empty = LLViewerFolderType::lookupIsHiddenIfEmpty(bridge->getPreferredType()); - bool is_empty = (mInventory->categoryHasChildren(bridge->getUUID()) != LLInventoryModel::CHILDREN_YES); - - if (!is_system_folder || !is_empty || !is_hidden_if_empty) - { - LLFolderViewFolder::Params params; + LLFolderViewFolder::Params params; - params.name = bridge->getDisplayName(); - params.icon = bridge->getIcon(); - params.icon_open = bridge->getOpenIcon(); - - if (mShowItemLinkOverlays) // if false, then links show up just like normal items - { - params.icon_overlay = LLUI::getUIImage("Inv_Link"); - } - - params.root = mFolderRoot; - params.listener = bridge; - params.tool_tip = params.name; + params.name = bridge->getDisplayName(); + params.icon = bridge->getIcon(); + params.icon_open = bridge->getOpenIcon(); - return LLUICtrlFactory::create<LLFolderViewFolder>(params); - } - else + if (mShowItemLinkOverlays) // if false, then links show up just like normal items { - // It's an empty system folder that should be hidden -> return NULL - return NULL; + params.icon_overlay = LLUI::getUIImage("Inv_Link"); } + + params.root = mFolderRoot; + params.listener = bridge; + params.tool_tip = params.name; + return LLUICtrlFactory::create<LLFolderViewFolder>(params); } LLFolderViewItem * LLInventoryPanel::createFolderViewItem(LLInvFVBridge * bridge) |