Fix Forum Feeds Close on Link Activated

This commit is contained in:
Phenom 2020-11-10 20:06:04 +01:00
parent 8e32a804ad
commit 8702dcdcb2
2 changed files with 24 additions and 5 deletions

View File

@ -99,7 +99,11 @@ void GxsForumMsgItem::setup()
/* clear ui */ /* clear ui */
ui->titleLabel->setText(tr("Loading...")); ui->titleLabel->setText(tr("Loading..."));
ui->titleLabel->setOpenExternalLinks(false); //To get linkActivated working
connect(ui->titleLabel, SIGNAL(linkActivated(QString)), this, SLOT(on_linkActivated(QString)));
ui->subjectLabel->clear(); ui->subjectLabel->clear();
ui->subjectLabel->setOpenExternalLinks(false); //To get linkActivated working
connect(ui->subjectLabel, SIGNAL(linkActivated(QString)), this, SLOT(on_linkActivated(QString)));
ui->timestamplabel->clear(); ui->timestamplabel->clear();
ui->parentNameLabel->clear(); ui->parentNameLabel->clear();
ui->nameLabel->clear(); ui->nameLabel->clear();
@ -506,3 +510,16 @@ void GxsForumMsgItem::setAsRead()
setReadStatus(false, false); setReadStatus(false, false);
} }
void GxsForumMsgItem::on_linkActivated(QString link)
{
RetroShareLink rsLink(link);
if (rsLink.valid() ) {
QList<RetroShareLink> rsLinks;
rsLinks.append(rsLink);
RetroShareLink::process(rsLinks);
removeItem();
return;
}
}

View File

@ -46,20 +46,20 @@ public:
uint64_t uniqueIdentifier() const override { return hash_64bits("GxsForumMsgItem " + messageId().toStdString()) ; } uint64_t uniqueIdentifier() const override { return hash_64bits("GxsForumMsgItem " + messageId().toStdString()) ; }
protected: protected:
/* FeedItem */ /* FeedItem */
virtual void doExpand(bool open); virtual void doExpand(bool open) override;
virtual void expandFill(bool first); virtual void expandFill(bool first) override;
/* load message data */ /* load message data */
virtual void loadParentMessage(const RsGxsMessageId &parent_msg); virtual void loadParentMessage(const RsGxsMessageId &parent_msg);
/* GxsGroupFeedItem */ /* GxsGroupFeedItem */
virtual QString groupName(); virtual QString groupName() override;
virtual void loadGroup() override; virtual void loadGroup() override;
virtual RetroShareLink::enumType getLinkType() { return RetroShareLink::TYPE_FORUM; } virtual RetroShareLink::enumType getLinkType() override { return RetroShareLink::TYPE_FORUM; }
//virtual bool isLoading(); //virtual bool isLoading();
/* GxsFeedItem */ /* GxsFeedItem */
virtual QString messageName(); virtual QString messageName() override;
virtual void loadMessage() override; virtual void loadMessage() override;
virtual void loadComment() override { return; } virtual void loadComment() override { return; }
@ -70,6 +70,8 @@ private slots:
void unsubscribeForum(); void unsubscribeForum();
void on_linkActivated(QString link);
signals: signals:
void vote(const RsGxsGrpMsgIdPair& msgId, bool up); void vote(const RsGxsGrpMsgIdPair& msgId, bool up);