diff --git a/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp b/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp index e274c4b5a..b610f9dd3 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp @@ -86,6 +86,13 @@ GxsCommentDialog::~GxsCommentDialog() delete(ui); } +void GxsCommentDialog::commentClear() +{ + ui->treeWidget->clear(); + mGrpId.clear(); + mMostRecentMsgId.clear(); + mMsgVersions.clear(); +} void GxsCommentDialog::commentLoad(const RsGxsGroupId &grpId, const std::set& msg_versions,const RsGxsMessageId& most_recent_msgId,bool use_cache) { std::cerr << "GxsCommentDialog::commentLoad(" << grpId << ", most recent msg version: " << most_recent_msgId << ")"; diff --git a/retroshare-gui/src/gui/gxs/GxsCommentDialog.h b/retroshare-gui/src/gui/gxs/GxsCommentDialog.h index 987fd0c07..4be6edede 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsCommentDialog.h @@ -39,6 +39,7 @@ public: void setTokenService(RsTokenService *token_service, RsGxsCommentService *comment_service); void setCommentHeader(QWidget *header); void commentLoad(const RsGxsGroupId &grpId, const std::set &msg_versions, const RsGxsMessageId &most_recent_msgId, bool use_cache=false); + void commentClear(); RsGxsGroupId groupId() { return mGrpId; } RsGxsMessageId messageId() { return mMostRecentMsgId; } diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsModel.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsModel.cpp index 72599364c..b8f6b2650 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsModel.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsModel.cpp @@ -76,24 +76,18 @@ void updateCommentCounts( std::vector& posts, std::vector post_indices; for(uint32_t i=0;igetChannelComments(mChannelGroup.mMeta.mGroupId,std::set{ e->mChannelMsgId },comments)) { std::cerr << __PRETTY_FUNCTION__ << " failed to retrieve message comment data for channel/msg " << e->mChannelGroupId << "/" << e->mChannelMsgId << std::endl; @@ -228,8 +225,6 @@ void RsGxsChannelPostsModel::setFilter(const QStringList& strings,bool only_unre count = mFilteredPosts.size(); - std::cerr << "After filtering: " << count << " posts remain." << std::endl; - beginInsertRows(QModelIndex(),0,rowCount()-1); endInsertRows(); diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp index dbcb2a39d..43161efaa 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp @@ -183,7 +183,6 @@ void ChannelPostDelegate::paint(QPainter * painter, const QStyleOptionViewItem & p.drawPixmap(mZoom*QPoint(0.1*fm.height(),-3.4*fm.height()),FilesDefs::getPixmapFromQtResourcePath(STAR_OVERLAY_IMAGE).scaled(mZoom*6*fm.height(),mZoom*6*fm.height(),Qt::KeepAspectRatio,Qt::SmoothTransformation)); } - std::cerr << "mCommentCount=" << post.mCommentCount << std::endl; if(post.mCommentCount) { QPainter p(&pixmap); @@ -856,6 +855,8 @@ void GxsChannelPostsWidgetWithModel::updateGroupData() std::cerr << "Old group: " << mGroup.mMeta.mGroupId << ", new group: " << group.mMeta.mGroupId << ". Celaring selection" << std::endl; #endif whileBlocking(ui->postsTree->selectionModel())->clear(); + whileBlocking(ui->commentsDialog)->commentClear(); + updateCommentsCount(0); } mGroup = group;