DD-43, DD-44 : implement update_marketplace_category() and get it called swhen appropriate

meow-7.2.2
Merov Linden 2014-03-14 13:52:42 -07:00
parent 705d4182c8
commit f93f860e9b
3 changed files with 20 additions and 0 deletions

View File

@ -111,6 +111,16 @@ void append_path(const LLUUID& id, std::string& path)
path.append(temp);
}
void update_marketplace_category(const LLUUID& cat_id)
{
// When changing the marketplace status of a folder, the only thing that needs to happen is
// for all observers of the folder to, possibly, change the display label of said folder.
// At least that's the status for the moment so, even if that function seems small, we
// prefer to encapsulate that behavior here.
gInventory.addChangedMask(LLInventoryObserver::LABEL, cat_id);
gInventory.notifyObservers();
}
void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::string& new_name)
{
LLViewerInventoryCategory* cat;

View File

@ -58,6 +58,9 @@ void show_task_item_profile(const LLUUID& item_uuid, const LLUUID& object_id);
void show_item_original(const LLUUID& item_uuid);
void reset_inventory_filter();
// Just nudge the category in the global inventory to signal that its marketplace status changed
void update_marketplace_category(const LLUUID& cat_id);
void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::string& new_name);
void copy_inventory_category(LLInventoryModel* model, LLViewerInventoryCategory* cat, const LLUUID& parent_id, const LLUUID& root_copy_id = LLUUID::null);

View File

@ -30,6 +30,7 @@
#include "llagent.h"
#include "llhttpclient.h"
#include "llinventoryfunctions.h"
#include "llsdserialize.h"
#include "lltimer.h"
#include "lltrans.h"
@ -596,6 +597,7 @@ bool LLMarketplaceData::setListingID(const LLUUID& folder_id, std::string listin
else
{
(it->second).mListingId = listing_id;
update_marketplace_category(folder_id);
return true;
}
}
@ -609,6 +611,7 @@ bool LLMarketplaceData::setVersionFolderID(const LLUUID& folder_id, const LLUUID
else
{
(it->second).mActiveVersionFolderId = version_id;
update_marketplace_category(folder_id);
return true;
}
}
@ -622,6 +625,7 @@ bool LLMarketplaceData::setActivation(const LLUUID& folder_id, bool activate)
else
{
(it->second).mIsActive = activate;
update_marketplace_category(folder_id);
return true;
}
}
@ -631,12 +635,15 @@ void LLMarketplaceData::addTestItem(const LLUUID& folder_id)
{
llinfos << "Merov : addTestItem, id = " << folder_id << llendl;
mMarketplaceItems[folder_id] = LLMarketplaceTuple(folder_id);
update_marketplace_category(folder_id);
}
void LLMarketplaceData::addTestItem(const LLUUID& folder_id, const LLUUID& version_id)
{
llinfos << "Merov : addTestItem, id = " << folder_id << ", version = " << version_id << llendl;
mMarketplaceItems[folder_id] = LLMarketplaceTuple(folder_id);
setVersionFolderID(folder_id, version_id);
update_marketplace_category(folder_id);
update_marketplace_category(version_id);
}