Added new method to GxsFeedItem to set content with QVariant.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7477 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2014-07-27 18:29:35 +00:00
parent 3458cdc8fc
commit e588b25b67
6 changed files with 36 additions and 3 deletions

View file

@ -73,7 +73,17 @@ GxsChannelPostItem::GxsChannelPostItem(FeedHolder *parent, uint32_t feedId, cons
loadPost(post);
}
bool GxsChannelPostItem::setPost(const RsGxsChannelPost &post)
void GxsChannelPostItem::setContent(const QVariant &content)
{
if (!content.canConvert<RsGxsChannelPost>()) {
return;
}
RsGxsChannelPost post = content.value<RsGxsChannelPost>();
setContent(post);
}
bool GxsChannelPostItem::setContent(const RsGxsChannelPost &post)
{
if (groupId() != post.mMeta.mGroupId || messageId() != post.mMeta.mMsgId) {
std::cerr << "GxsChannelPostItem::setPost() - Wrong id, cannot set post";