- Added copy link to GxsFeedItem (GxsChannelPostItem)

- Fixed copy link of GxsGroupFrameDialog
  - utf8 issue
  - removed unread message count from group name

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7476 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2014-07-26 23:52:45 +00:00
parent 8427c92486
commit 3458cdc8fc
12 changed files with 112 additions and 182 deletions

View file

@ -189,11 +189,11 @@ void GxsChannelPostItem::loadPost(const RsGxsChannelPost &post)
{
title = tr("Channel Feed") + ": ";
RetroShareLink link;
link.createChannel(post.mMeta.mGroupId.toStdString(), "");
link.createGxsGroupLink(RetroShareLink::TYPE_CHANNEL, post.mMeta.mGroupId, "");
title += link.toHtml();
ui->titleLabel->setText(title);
RetroShareLink msgLink;
msgLink.createChannel(post.mMeta.mGroupId.toStdString(), post.mMeta.mMsgId.toStdString());
msgLink.createGxsMessageLink(RetroShareLink::TYPE_CHANNEL, post.mMeta.mGroupId, post.mMeta.mMsgId, QString::fromUtf8(post.mMeta.mMsgName.c_str()));
ui->subjectLabel->setText(msgLink.toHtml());
if (IS_GROUP_SUBSCRIBED(mSubscribeFlags) || IS_GROUP_ADMIN(mSubscribeFlags))
@ -314,6 +314,11 @@ void GxsChannelPostItem::loadPost(const RsGxsChannelPost &post)
mInUpdateItemStatic = false;
}
QString GxsChannelPostItem::messageName()
{
return QString::fromUtf8(mPost.mMeta.mMsgName.c_str());
}
void GxsChannelPostItem::setReadStatus(bool isNew, bool isUnread)
{
if (isUnread)
@ -536,25 +541,6 @@ void GxsChannelPostItem::channelMsgReadSatusChanged(const QString& channelId, co
#endif
}
void GxsChannelPostItem::copyLink()
{
#if 0
if (mChanId.empty() || mMsgId.empty()) {
return;
}
ChannelMsgInfo cmi;
if (rsChannels->getChannelMessage(mChanId, mMsgId, cmi)) {
RetroShareLink link;
if (link.createChannel(cmi.channelId, cmi.msgId)) {
QList<RetroShareLink> urls;
urls.push_back(link);
RSLinkClipboard::copyLinks(urls);
}
}
#endif
}
void GxsChannelPostItem::makeDownVote()
{
RsGxsGrpMsgIdPair msgId;

View file

@ -55,6 +55,8 @@ public:
protected:
virtual void loadMessage(const uint32_t &token);
virtual RetroShareLink::enumType getLinkType() { return RetroShareLink::TYPE_CHANNEL; }
virtual QString messageName();
private slots:
/* default stuff */
@ -62,7 +64,6 @@ private slots:
void readAndClearItem();
void download();
void play();
void copyLink();
void loadComments();
void readToggled(bool checked);