summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorRichard Linden <none@none>2012-06-19 22:36:12 -0700
committerRichard Linden <none@none>2012-06-19 22:36:12 -0700
commit9e49fb558f894a1960d208114b8c051536f58c9e (patch)
treec36d1626b2fbd546c29485cdb3066fa565e40082 /indra
parent4d258b7d3b020c54239930509d8bad7abccf50f9 (diff)
CHUI-101 WIP Make LLFolderview general purpose
added more casts to LLFolderViewModelItemInventory, etc. to fix compile errors
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/llavataractions.cpp4
-rw-r--r--indra/newview/llinventorybridge.cpp42
-rw-r--r--indra/newview/llinventorybridge.h11
-rw-r--r--indra/newview/llinventorypanel.cpp6
-rw-r--r--indra/newview/llinventorypanel.h1
-rw-r--r--indra/newview/llpanellandmarks.cpp94
-rw-r--r--indra/newview/llpanellandmarks.h2
-rw-r--r--indra/newview/llpanelmaininventory.cpp6
-rw-r--r--indra/newview/llpanelmarketplaceinbox.cpp8
-rw-r--r--indra/newview/llpanelmarketplaceinboxinventory.cpp2
-rw-r--r--indra/newview/llpanelobjectinventory.cpp21
-rw-r--r--indra/newview/lltexturectrl.cpp2
12 files changed, 103 insertions, 96 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 68dc7681cc..b154dd458c 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -733,7 +733,7 @@ std::set<LLUUID> LLAvatarActions::getInventorySelectedUUIDs()
it != end_it;
++it)
{
- inventory_selected_uuids.insert((*it)->getListener()->getUUID());
+ inventory_selected_uuids.insert(static_cast<LLFolderViewModelItemInventory*>((*it)->getViewModelItem())->getUUID());
}
return inventory_selected_uuids;
}
@@ -778,7 +778,7 @@ bool LLAvatarActions::canShareSelectedItems(LLInventoryPanel* inv_panel /* = NUL
const std::set<LLFolderViewItem*>::const_iterator it_end = inventory_selected.end();
for (; it != it_end; ++it)
{
- LLViewerInventoryCategory* inv_cat = gInventory.getCategory((*it)->getItemViewModel()->getUUID());
+ LLViewerInventoryCategory* inv_cat = gInventory.getCategory(static_cast<LLFolderViewModelItemInventory*>((*it)->getViewModelItem())->getUUID());
// any category can be offered.
if (inv_cat)
{
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 312b7314a1..44d0fdd3dd 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -895,7 +895,7 @@ LLInventoryModel* LLInvFVBridge::getInventoryModel() const
return panel ? panel->getModel() : NULL;
}
-LLInventoryFilter* getInventoryFilter() const
+LLInventoryFilter* LLInvFVBridge::getInventoryFilter() const
{
LLInventoryPanel* panel = mInventoryPanel.get();
return panel ? panel->getFilter() : NULL;
@@ -1278,7 +1278,7 @@ bool LLInvFVBridge::canListOnMarketplaceNow() const
LLFolderViewFolder * object_folderp = mInventoryPanel.get() ? mInventoryPanel.get()->getFolderByID(object_id) : NULL;
if (object_folderp)
{
- can_list = !object_folderp->isLoading();
+ can_list = !static_cast<LLFolderBridge*>(object_folderp->getViewModelItem())->isLoading();
}
}
@@ -1319,7 +1319,7 @@ LLToolDragAndDrop::ESource LLInvFVBridge::getDragSource() const
return LLToolDragAndDrop::SOURCE_LIBRARY;
}
- return SOURCE_VIEWER;
+ return LLToolDragAndDrop::SOURCE_VIEWER;
}
@@ -1534,7 +1534,7 @@ PermissionMask LLItemBridge::getPermissionMask() const
return perm_mask;
}
-void LLItemBridge::buildDisplayName()
+void LLItemBridge::buildDisplayName() const
{
if(getItem())
{
@@ -1817,7 +1817,7 @@ void LLFolderBridge::selectItem()
LLInventoryModelBackgroundFetch::instance().start(getUUID(), true);
}
-void LLFolderBridge::buildDisplayName()
+void LLFolderBridge::buildDisplayName() const
{
LLFolderType::EType preferred_type = getPreferredType();
@@ -1845,7 +1845,7 @@ void LLFolderBridge::buildDisplayName()
//can not be detected as protected with LLFolderType::lookupIsProtectedType
if (accessories || LLFolderType::lookupIsProtectedType(preferred_type))
{
- LLTrans::findString(mDisplayName, "InvFolder " + getName());
+ LLTrans::findString(mDisplayName, std::string("InvFolder ") + getName(), LLSD());
};
}
@@ -1859,7 +1859,7 @@ void LLFolderBridge::update()
possibly_has_children = true;
}
- BOOL loading = (possibly_has_children
+ bool loading = (possibly_has_children
&& !up_to_date );
if (loading != mIsLoading)
@@ -3415,7 +3415,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items
// Do not call execute() or done() here as if the folder is here, there's likely no point drilling down
// This saves lots of time as buildContextMenu() is called a lot
delete fetch;
- buildContextMenuFolderOptions(flags);
+ buildContextMenuFolderOptions(flags, items, disabled_items);
}
else
{
@@ -3628,23 +3628,6 @@ void LLFolderBridge::pasteClipboard(void* user_data)
if(self) self->pasteFromClipboard();
}
-void LLFolderBridge::createNewCategory(void* user_data)
-{
- LLFolderBridge* bridge = (LLFolderBridge*)user_data;
- if(!bridge) return;
- LLInventoryModel* model = bridge->getInventoryModel();
- if(!model) return;
- LLUUID id;
- id = model->createNewCategory(bridge->getUUID(),
- LLFolderType::FT_NONE,
- LLStringUtil::null);
- model->notifyObservers();
-
- // At this point, the bridge has probably been deleted, but the
- // view is still there.
- panel->setSelection(id, TAKE_FOCUS_YES);
-}
-
void LLFolderBridge::createNewShirt(void* user_data)
{
LLFolderBridge::createWearable((LLFolderBridge*)user_data, LLWearableType::WT_SHIRT);
@@ -3830,9 +3813,10 @@ void LLFolderBridge::dropToFavorites(LLInventoryItem* inv_item)
LLPointer<AddFavoriteLandmarkCallback> cb = new AddFavoriteLandmarkCallback();
LLInventoryPanel* panel = mInventoryPanel.get();
LLFolderViewItem* drag_over_item = panel ? panel->getRootFolder()->getDraggingOverItem() : NULL;
- if (drag_over_item && drag_over_item->getViewModelItem())
+ LLFolderViewModelItemInventory* view_model = drag_over_item ? static_cast<LLFolderViewModelItemInventory*>(drag_over_item->getViewModelItem()) : NULL;
+ if (view_model)
{
- cb.get()->setTargetLandmarkId(drag_over_item->getViewModelItem()->getUUID());
+ cb.get()->setTargetLandmarkId(view_model->getUUID());
}
copy_inventory_item(
@@ -4032,7 +4016,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
if (itemp)
{
LLUUID srcItemId = inv_item->getUUID();
- LLUUID destItemId = itemp->getViewModelItem()->getUUID();
+ LLUUID destItemId = static_cast<LLFolderViewModelItemInventory*>(itemp->getViewModelItem())->getUUID();
gInventory.rearrangeFavoriteLandmarks(srcItemId, destItemId);
}
}
@@ -6119,7 +6103,7 @@ void LLLinkFolderBridge::gotoItem()
const LLUUID &cat_uuid = getFolderID();
if (!cat_uuid.isNull())
{
- LLFolderViewItem *base_folder = mInventoryPanel.get()->getItemByID(cat_uuid)
+ LLFolderViewItem *base_folder = mInventoryPanel.get()->getItemByID(cat_uuid);
if (base_folder)
{
if (LLInventoryModel* model = getInventoryModel())
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index bc5ac24c70..d303e8377d 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -176,7 +176,7 @@ protected:
mutable std::string mDisplayName;
void purgeItem(LLInventoryModel *model, const LLUUID &uuid);
- virtual void buildDisplayName();
+ virtual void buildDisplayName() const;
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -230,7 +230,7 @@ public:
protected:
BOOL confirmRemoveItem(const LLSD& notification, const LLSD& response);
virtual BOOL isItemPermissive() const;
- virtual void buildDisplayName();
+ virtual void buildDisplayName() const;
};
@@ -249,7 +249,7 @@ public:
BOOL dragItemIntoFolder(LLInventoryItem* inv_item, BOOL drop, std::string& tooltip_msg);
BOOL dragCategoryIntoFolder(LLInventoryCategory* inv_category, BOOL drop, std::string& tooltip_msg);
- virtual void buildDisplayName();
+ virtual void buildDisplayName() const;
virtual void performAction(LLInventoryModel* model, std::string action);
virtual void openItem();
@@ -293,6 +293,8 @@ public:
LLViewerInventoryCategory* getCategory() const;
LLHandle<LLFolderBridge> getHandle() { mHandle.bind(this); return mHandle; }
+ bool isLoading() { return mIsLoading; }
+
protected:
void buildContextMenuOptions(U32 flags, menuentry_vec_t& items, menuentry_vec_t& disabled_items);
void buildContextMenuFolderOptions(U32 flags, menuentry_vec_t& items, menuentry_vec_t& disabled_items);
@@ -301,7 +303,6 @@ protected:
// Menu callbacks
//--------------------------------------------------------------------
static void pasteClipboard(void* user_data);
- static void createNewCategory(void* user_data);
static void createNewShirt(void* user_data);
static void createNewPants(void* user_data);
static void createNewShoes(void* user_data);
@@ -337,7 +338,7 @@ private:
bool mWearables;
bool mIsLoading;
LLTimer mTimeSinceRequestStart;
- std::string mDisplayName;
+ mutable std::string mDisplayName;
LLRootHandle<LLFolderBridge> mHandle;
};
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index e739694fe0..d3f6474392 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -600,6 +600,11 @@ LLFolderView* LLInventoryPanel::getRootFolder()
return mFolderRoot;
}
+LLUUID LLInventoryPanel::getRootFolderID()
+{
+ return static_cast<LLFolderViewModelItemInventory*>(mFolderRoot->getViewModelItem())->getUUID();
+}
+
// static
void LLInventoryPanel::onIdle(void *userdata)
@@ -1146,6 +1151,7 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open)
if (!floater_inventory)
{
llwarns << "Could not find My Inventory floater" << llendl;
+
return FALSE;
}
diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h
index cd32b18779..2aa05e1b61 100644
--- a/indra/newview/llinventorypanel.h
+++ b/indra/newview/llinventorypanel.h
@@ -203,6 +203,7 @@ public:
// This method is called when something has changed about the inventory.
void modelChanged(U32 mask);
LLFolderView* getRootFolder();
+ LLUUID getRootFolderID();
LLScrollContainer* getScrollableContainer() { return mScroller; }
void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action);
diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp
index 54ad2bcb76..901c6379de 100644
--- a/indra/newview/llpanellandmarks.cpp
+++ b/indra/newview/llpanellandmarks.cpp
@@ -138,7 +138,7 @@ private:
// virtual
void LLOpenFolderByID::doFolder(LLFolderViewFolder* folder)
{
- if (folder->getViewModelItem() && folder->getViewModelItem()->getUUID() == mFolderID)
+ if (folder->getViewModelItem() && static_cast<LLFolderViewModelItemInventory*>(folder->getViewModelItem())->getUUID() == mFolderID)
{
if (!folder->isOpen())
{
@@ -281,28 +281,21 @@ void LLLandmarksPanel::onShowOnMap()
//virtual
void LLLandmarksPanel::onShowProfile()
{
- LLFolderViewItem* cur_item = getCurSelectedItem();
+ LLFolderViewModelItemInventory* cur_item = getCurSelectedViewModelItem();
if(!cur_item)
return;
- cur_item->getViewModelItem()->performAction(mCurrentSelectedList->getModel(),"about");
+ cur_item->performAction(mCurrentSelectedList->getModel(),"about");
}
// virtual
void LLLandmarksPanel::onTeleport()
{
- LLFolderViewItem* current_item = getCurSelectedItem();
- if (!current_item)
- {
- llwarns << "There are no selected list. No actions are performed." << llendl;
- return;
- }
-
- LLFolderViewModelItem* listenerp = current_item->getViewModelItem();
- if (listenerp && listenerp->getInventoryType() == LLInventoryType::IT_LANDMARK)
+ LLFolderViewModelItemInventory* view_model_item = getCurSelectedViewModelItem();
+ if (view_model_item && view_model_item->getInventoryType() == LLInventoryType::IT_LANDMARK)
{
- listenerp->openItem();
+ view_model_item->openItem();
}
}
@@ -360,7 +353,7 @@ void LLLandmarksPanel::onSelectorButtonClicked()
LLFolderViewItem* cur_item = mFavoritesInventoryPanel->getRootFolder()->getCurSelectedItem();
if (!cur_item) return;
- LLFolderViewModelItem* listenerp = cur_item->getViewModelItem();
+ LLFolderViewModelItemInventory* listenerp = static_cast<LLFolderViewModelItemInventory*>(cur_item->getViewModelItem());
if (listenerp->getInventoryType() == LLInventoryType::IT_LANDMARK)
{
LLSD key;
@@ -417,8 +410,9 @@ void LLLandmarksPanel::setItemSelected(const LLUUID& obj_id, BOOL take_keyboard_
bool LLLandmarksPanel::isLandmarkSelected() const
{
- LLFolderViewItem* current_item = getCurSelectedItem();
- if(current_item && current_item->getViewModelItem()->getInventoryType() == LLInventoryType::IT_LANDMARK)
+ LLFolderViewModelItemInventory* current_item = getCurSelectedViewModelItem();
+
+ if(current_item && current_item->getInventoryType() == LLInventoryType::IT_LANDMARK)
{
return true;
}
@@ -440,10 +434,10 @@ bool LLLandmarksPanel::isReceivedFolderSelected() const
void LLLandmarksPanel::doActionOnCurSelectedLandmark(LLLandmarkList::loaded_callback_t cb)
{
- LLFolderViewItem* cur_item = getCurSelectedItem();
- if(cur_item && cur_item->getViewModelItem()->getInventoryType() == LLInventoryType::IT_LANDMARK)
+ LLFolderViewModelItemInventory* cur_item = getCurSelectedViewModelItem();
+ if(cur_item && cur_item->getInventoryType() == LLInventoryType::IT_LANDMARK)
{
- LLLandmark* landmark = LLLandmarkActions::getLandmark(cur_item->getViewModelItem()->getUUID(), cb);
+ LLLandmark* landmark = LLLandmarkActions::getLandmark(cur_item->getUUID(), cb);
if (landmark)
{
cb(landmark);
@@ -456,6 +450,17 @@ LLFolderViewItem* LLLandmarksPanel::getCurSelectedItem() const
return mCurrentSelectedList ? mCurrentSelectedList->getRootFolder()->getCurSelectedItem() : NULL;
}
+LLFolderViewModelItemInventory* LLLandmarksPanel::getCurSelectedViewModelItem() const
+{
+ LLFolderViewItem* cur_item = getCurSelectedItem();
+ if (cur_item)
+ {
+ return static_cast<LLFolderViewModelItemInventory*>(cur_item->getViewModelItem());
+ }
+ return NULL;
+}
+
+
LLFolderViewItem* LLLandmarksPanel::selectItemInAccordionTab(LLPlacesInventoryPanel* inventory_list,
const std::string& tab_name,
const LLUUID& obj_id,
@@ -508,12 +513,12 @@ void LLLandmarksPanel::processParcelInfo(const LLParcelData& parcel_data)
// We have to make request to sever to get parcel_id and snaption_id.
if(isLandmarkSelected())
{
- LLFolderViewItem* cur_item = getCurSelectedItem();
+ LLFolderViewModelItemInventory* cur_item = getCurSelectedViewModelItem();
if (!cur_item) return;
- LLUUID id = cur_item->getViewModelItem()->getUUID();
+ LLUUID id = cur_item->getUUID();
LLInventoryItem* inv_item = mCurrentSelectedList->getModel()->getItem(id);
doActionOnCurSelectedLandmark(boost::bind(
- &LLLandmarksPanel::doProcessParcelInfo, this, _1, cur_item, inv_item, parcel_data));
+ &LLLandmarksPanel::doProcessParcelInfo, this, _1, getCurSelectedItem(), inv_item, parcel_data));
}
}
@@ -646,7 +651,7 @@ void LLLandmarksPanel::onAccordionExpandedCollapsed(const LLSD& param, LLPlacesI
// Start background fetch, mostly for My Inventory and Library
if (expanded)
{
- const LLUUID &cat_id = inventory_list->getRootFolderID();
+ const LLUUID &cat_id = mCurrentSelectedList->getRootFolderID();
// Just because the category itself has been fetched, doesn't mean its child folders have.
/*
if (!gInventory.isCategoryComplete(cat_id))
@@ -731,14 +736,9 @@ void LLLandmarksPanel::onActionsButtonClick()
{
LLToggleableMenu* menu = mGearFolderMenu;
- LLFolderViewItem* cur_item = NULL;
if(mCurrentSelectedList)
{
- cur_item = mCurrentSelectedList->getRootFolder()->getCurSelectedItem();
- if(!cur_item)
- return;
-
- LLFolderViewModelItem* listenerp = cur_item->getViewModelItem();
+ LLFolderViewModelItemInventory* listenerp = getCurSelectedViewModelItem();
if(!listenerp)
return;
@@ -776,6 +776,9 @@ void LLLandmarksPanel::onTrashButtonClick() const
void LLLandmarksPanel::onAddAction(const LLSD& userdata) const
{
+ LLFolderViewModelItemInventory* view_model = getCurSelectedViewModelItem();
+ LLFolderViewItem* item = getCurSelectedItem();
+
std::string command_name = userdata.asString();
if("add_landmark" == command_name)
{
@@ -791,21 +794,21 @@ void LLLandmarksPanel::onAddAction(const LLSD& userdata) const
}
else if ("category" == command_name)
{
- LLFolderViewItem* item = getCurSelectedItem();
if (item && mCurrentSelectedList == mLandmarksInventoryPanel)
{
LLFolderViewModelItem* folder_bridge = NULL;
- if (item-> getViewModelItem()->getInventoryType()
+
+ if (view_model->getInventoryType()
== LLInventoryType::IT_LANDMARK)
{
// for a landmark get parent folder bridge
folder_bridge = item->getParentFolder()->getViewModelItem();
}
- else if (item-> getViewModelItem()->getInventoryType()
+ else if (view_model->getInventoryType()
== LLInventoryType::IT_CATEGORY)
{
// for a folder get its own bridge
- folder_bridge = item->getViewModelItem();
+ folder_bridge = view_model;
}
menu_create_inventory_item(mCurrentSelectedList,
@@ -834,9 +837,9 @@ void LLLandmarksPanel::onClipboardAction(const LLSD& userdata) const
std::string command_name = userdata.asString();
if("copy_slurl" == command_name)
{
- LLFolderViewItem* cur_item = getCurSelectedItem();
+ LLFolderViewModelItemInventory* cur_item = getCurSelectedViewModelItem();
if(cur_item)
- LLLandmarkActions::copySLURLtoClipboard(cur_item->getViewModelItem()->getUUID());
+ LLLandmarkActions::copySLURLtoClipboard(cur_item->getUUID());
}
else if ( "paste" == command_name)
{
@@ -984,11 +987,6 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const
{
LLFolderViewItem* item = *iter;
- // If no item is found it might be a folder id.
- if (!item)
- {
- item = root_folder_view->getFolderByID(*iter);
- }
if (!item) return false;
if (!canItemBeModified(command_name, item)) return false;
@@ -1012,10 +1010,10 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const
if ("show_on_map" == command_name)
{
- LLFolderViewItem* cur_item = root_folder_view->getCurSelectedItem();
+ LLFolderViewModelItemInventory* cur_item = getCurSelectedViewModelItem();
if (!cur_item) return false;
- LLViewerInventoryItem* inv_item = static_cast<LLViewerInventoryItem*>(static_cast<LLFolderViewModelItemInventory*>(cur_item->getViewModelItem())->getInventoryObject());
+ LLViewerInventoryItem* inv_item = dynamic_cast<LLViewerInventoryItem*>(cur_item->getInventoryObject());
if (!inv_item) return false;
LLUUID asset_uuid = inv_item->getAssetUUID();
@@ -1105,23 +1103,23 @@ void LLLandmarksPanel::onMenuVisibilityChange(LLUICtrl* ctrl, const LLSD& param)
{
const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
- std::set<LLFolderViewItem*> selected_uuids = root_folder_view->getSelectionList();
+ std::set<LLFolderViewItem*> selected_items = root_folder_view->getSelectionList();
// Iterate through selected items to find out if any of these items are in Trash
// or all the items are in Trash category.
- for (std::set<LLFolderViewItem*>::const_iterator iter = selected_uuids.begin(); iter != selected_uuids.end(); ++iter)
+ for (std::set<LLFolderViewItem*>::const_iterator iter = selected_items.begin(); iter != selected_items.end(); ++iter)
{
LLFolderViewItem* item = *iter;
// If no item is found it might be a folder id.
if (!item) continue;
- LLFolderViewModelItem* listenerp = item->getViewModelItem();
+ LLFolderViewModelItemInventory* listenerp = static_cast<LLFolderViewModelItemInventory*>(item->getViewModelItem());
if(!listenerp) continue;
// Trash category itself should not be included because it can't be
// actually restored from trash.
- are_all_items_in_trash &= listenerp->isItemInTrash() && (*iter)->getItemViewModel()->getUUID() != trash_id;
+ are_all_items_in_trash &= listenerp->isItemInTrash() && listenerp->getUUID() != trash_id;
// If there are any selected items in Trash including the Trash category itself
// we show "Restore Item" in context menu and hide other irrelevant items.
@@ -1160,7 +1158,7 @@ bool LLLandmarksPanel::canItemBeModified(const std::string& command_name, LLFold
bool can_be_modified = false;
// landmarks can be modified in any other accordion...
- if (item->getViewModelItem()->getInventoryType() == LLInventoryType::IT_LANDMARK)
+ if (static_cast<LLFolderViewModelItemInventory*>(item->getViewModelItem())->getInventoryType() == LLInventoryType::IT_LANDMARK)
{
can_be_modified = true;
@@ -1198,7 +1196,7 @@ bool LLLandmarksPanel::canItemBeModified(const std::string& command_name, LLFold
if (can_be_modified)
{
- LLFolderViewModelItemInventory* listenerp = item->getViewModelItem();
+ LLFolderViewModelItemInventory* listenerp = static_cast<LLFolderViewModelItemInventory*>(item->getViewModelItem());
if ("cut" == command_name)
{
diff --git a/indra/newview/llpanellandmarks.h b/indra/newview/llpanellandmarks.h
index b2f4e92473..aa5f69739d 100644
--- a/indra/newview/llpanellandmarks.h
+++ b/indra/newview/llpanellandmarks.h
@@ -44,6 +44,7 @@ class LLMenuGL;
class LLToggleableMenu;
class LLInventoryPanel;
class LLPlacesInventoryPanel;
+class LLFolderViewModelItemInventory;
class LLLandmarksPanel : public LLPanelPlacesTab, LLRemoteParcelInfoObserver
{
@@ -87,6 +88,7 @@ protected:
bool isReceivedFolderSelected() const;
void doActionOnCurSelectedLandmark(LLLandmarkList::loaded_callback_t cb);
LLFolderViewItem* getCurSelectedItem() const;
+ LLFolderViewModelItemInventory* getCurSelectedViewModelItem() const;
/**
* Selects item with "obj_id" in "inventory_list" and scrolls accordion
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index fbdbce61bd..565a7408c2 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -47,6 +47,7 @@
#include "llresmgr.h"
#include "llscrollcontainer.h"
#include "llsdserialize.h"
+#include "llsdparam.h"
#include "llspinctrl.h"
#include "lltoggleablemenu.h"
#include "lltooldraganddrop.h"
@@ -230,7 +231,10 @@ LLPanelMainInventory::~LLPanelMainInventory( void )
if (filter)
{
LLSD filterState;
- filter->toLLSD(filterState);
+ LLInventoryFilter::Params p;
+ filter->toParams(p);
+ LLParamSDParser parser;
+ parser.writeSD(filterState, p);
filterRoot[filter->getName()] = filterState;
}
diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp
index 8a07d6d516..3547156197 100644
--- a/indra/newview/llpanelmarketplaceinbox.cpp
+++ b/indra/newview/llpanelmarketplaceinbox.cpp
@@ -143,8 +143,8 @@ U32 LLPanelMarketplaceInbox::getFreshItemCount() const
if (inbox_folder)
{
- LLFolderViewFolder::folders_t::iterator folders_it = inbox_folder->getFoldersBegin();
- LLFolderViewFolder::folders_t::iterator folders_end = inbox_folder->getFoldersEnd();
+ LLFolderViewFolder::folders_t::const_iterator folders_it = inbox_folder->getFoldersBegin();
+ LLFolderViewFolder::folders_t::const_iterator folders_end = inbox_folder->getFoldersEnd();
for (; folders_it != folders_end; ++folders_it)
{
@@ -157,8 +157,8 @@ U32 LLPanelMarketplaceInbox::getFreshItemCount() const
}
}
- LLFolderViewFolder::items_t::iterator items_it = inbox_folder->getItemsBegin();
- LLFolderViewFolder::items_t::iterator items_end = inbox_folder->getItemsEnd();
+ LLFolderViewFolder::items_t::const_iterator items_it = inbox_folder->getItemsBegin();
+ LLFolderViewFolder::items_t::const_iterator items_end = inbox_folder->getItemsEnd();
for (; items_it != items_end; ++items_it)
{
diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp
index 1d079adfd3..2947be3c2e 100644
--- a/indra/newview/llpanelmarketplaceinboxinventory.cpp
+++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp
@@ -30,7 +30,7 @@
#include "llfolderview.h"
#include "llfolderviewitem.h"
-#include "llfoldervieweventlistener.h"
+#include "llfolderviewmodel.h"
#include "llinventorybridge.h"
#include "llinventoryfunctions.h"
#include "llpanellandmarks.h"
diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp
index ae68b5ce95..56df01e150 100644
--- a/indra/newview/llpanelobjectinventory.cpp
+++ b/indra/newview/llpanelobjectinventory.cpp
@@ -109,6 +109,8 @@ public:
/*virtual*/ LLFolderType::EType getPreferredType() const { return LLFolderType::FT_NONE; }
virtual const LLUUID& getUUID() const { return mUUID; }
virtual time_t getCreationDate() const;
+ virtual void setCreationDate(time_t creation_date_utc);
+
virtual LLUIImagePtr getIcon() const;
virtual void openItem();
virtual BOOL canOpenItem() const { return FALSE; }
@@ -130,11 +132,15 @@ public:
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
virtual void performAction(LLInventoryModel* model, std::string action);
virtual BOOL isUpToDate() const { return TRUE; }
- virtual BOOL hasChildren() const { return FALSE; }
+ virtual bool hasChildren() const { return FALSE; }
virtual LLInventoryType::EType getInventoryType() const { return LLInventoryType::IT_NONE; }
virtual LLWearableType::EType getWearableType() const { return LLWearableType::WT_NONE; }
+ virtual EInventorySortGroup getSortGroup() const { return SG_ITEM; }
+ virtual LLInventoryObject* getInventoryObject() const { return findInvObject(); }
+
// LLDragAndDropBridge functionality
+ virtual LLToolDragAndDrop::ESource getDragSource() const { return LLToolDragAndDrop::SOURCE_WORLD; }
virtual BOOL startDrag(EDragAndDropType* type, LLUUID* id) const;
virtual BOOL dragOrDrop(MASK mask, BOOL drop,
EDragAndDropType cargo_type,
@@ -338,6 +344,10 @@ time_t LLTaskInvFVBridge::getCreationDate() const
return 0;
}
+void LLTaskInvFVBridge::setCreationDate(time_t creation_date_utc)
+{}
+
+
LLUIImagePtr LLTaskInvFVBridge::getIcon() const
{
const BOOL item_is_multi = (mFlags & LLInventoryItemFlags::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS);
@@ -461,7 +471,7 @@ BOOL LLTaskInvFVBridge::removeItem()
return FALSE;
}
-void LLTaskInvFVBridge::removeBatch(LLDynamicArray<LLFolderViewModelItem*>& batch)
+void LLTaskInvFVBridge::removeBatch(std::vector<LLFolderViewModelItem*>& batch)
{
if (!mPanel)
{
@@ -703,7 +713,7 @@ public:
virtual BOOL renameItem(const std::string& new_name);
virtual BOOL isItemRemovable() const;
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
- virtual BOOL hasChildren() const;
+ virtual bool hasChildren() const;
virtual BOOL startDrag(EDragAndDropType* type, LLUUID* id) const;
virtual BOOL dragOrDrop(MASK mask, BOOL drop,
EDragAndDropType cargo_type,
@@ -711,6 +721,7 @@ public:
std::string& tooltip_msg);
virtual BOOL canOpenItem() const { return TRUE; }
virtual void openItem();
+ virtual EInventorySortGroup getSortGroup() const { return SG_NORMAL_FOLDER; }
};
LLTaskCategoryBridge::LLTaskCategoryBridge(
@@ -761,7 +772,7 @@ void LLTaskCategoryBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
hide_context_entries(menu, items, disabled_items);
}
-BOOL LLTaskCategoryBridge::hasChildren() const
+bool LLTaskCategoryBridge::hasChildren() const
{
// return TRUE if we have or do know know if we have children.
// *FIX: For now, return FALSE - we will know for sure soon enough.
@@ -1748,7 +1759,7 @@ void LLPanelObjectInventory::createViewsForCategory(LLInventoryObject::object_li
view = LLUICtrlFactory::create<LLFolderViewItem> (params);
}
view->addToFolder(folder);
- addItemID(view->getViewModelItem()->getUUID(), view);
+ addItemID(view->getViewModelItem()->getUUID(), view);
}
}
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index a995f07df7..b7fa283dd2 100644
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -623,7 +623,7 @@ void LLFloaterTexturePicker::draw()
LLFolderView* folder_view = mInventoryPanel->getRootFolder();
if (!folder_view) return;
- LLInventoryFilter* filter = folder_view->getFilter();
+ LLInventoryFilter* filter = static_cast<LLInventoryFilter*>(folder_view->getFilter());
if (!filter) return;
bool is_filter_active = folder_view->getCompletedFilterGeneration() < filter->getCurrentGeneration() &&