mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-11-30 20:36:36 -05:00
Code change to test group edit
- can modify group names and content now Group edit code fixes git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs_finale@6811 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
18944404cc
commit
25d721b6fe
10 changed files with 133 additions and 74 deletions
|
|
@ -169,28 +169,18 @@ public:
|
|||
// expand as support is added for other utypes
|
||||
enum UpdateType { DESCRIPTION, NAME };
|
||||
|
||||
RsGxsGroupUpdateMeta(const std::string& groupId);
|
||||
~RsGxsGroupUpdateMeta()
|
||||
{
|
||||
GxsMetaUpdate::iterator mit = mUpdates.begin();
|
||||
for(; mit != mUpdates.end(); mit++)
|
||||
delete mit->second;
|
||||
}
|
||||
RsGxsGroupUpdateMeta(const std::string& groupId) : mGroupId(groupId) {}
|
||||
|
||||
typedef std::map<UpdateType, UpdateItem*> GxsMetaUpdate;
|
||||
typedef std::map<UpdateType, std::string> GxsMetaUpdate;
|
||||
|
||||
/*!
|
||||
* Only one item of a utype can exist
|
||||
* @param utype the type of meta update
|
||||
* @param item update item containing the change value
|
||||
*/
|
||||
void setMetaUpdate(UpdateType utype, UpdateItem* item)
|
||||
void setMetaUpdate(UpdateType utype, const std::string& update)
|
||||
{
|
||||
GxsMetaUpdate::iterator mit;
|
||||
if ((mit = mUpdates.find(utype)) != mUpdates.end())
|
||||
mUpdates[utype] = item;
|
||||
else
|
||||
delete mUpdates[utype];
|
||||
mUpdates[utype] = update;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
@ -199,9 +189,8 @@ public:
|
|||
*/
|
||||
bool removeUpdateType(UpdateType utype){ return mUpdates.erase(utype) == 1; }
|
||||
|
||||
const GxsMetaUpdate* getUpdate() { return &mUpdates; }
|
||||
|
||||
const std::string& getGroupId() { return mGroupId; }
|
||||
const GxsMetaUpdate* getUpdates() const { return &mUpdates; }
|
||||
const std::string& getGroupId() const { return mGroupId; }
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue