From 0e0430a222703c7746d2ed0114d7740dc694bbe3 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 19 Sep 2023 15:08:52 +0200 Subject: [PATCH 1/2] added more debug info to comment tree widget --- retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp | 7 +++++-- retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp b/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp index 4757b036e..1233b3100 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp @@ -29,6 +29,8 @@ #include #include +//#define DEBUG_COMMENT_DIALOG 1 + /** Constructor */ GxsCommentDialog::GxsCommentDialog(QWidget *parent, const RsGxsId &default_author, RsGxsCommentService *comment_service) : QWidget(parent), ui(new Ui::GxsCommentDialog) @@ -96,8 +98,9 @@ void GxsCommentDialog::commentClear() void GxsCommentDialog::commentLoad(const RsGxsGroupId &grpId, const std::set& msg_versions,const RsGxsMessageId& most_recent_msgId,bool use_cache) { #ifdef DEBUG_COMMENT_DIALOG - std::cerr << "GxsCommentDialog::commentLoad(" << grpId << ", most recent msg version: " << most_recent_msgId << ")"; - std::cerr << std::endl; + std::cerr << "GxsCommentDialog::commentLoad(" << grpId << ", most recent msg version: " << most_recent_msgId << ")" << std::endl; + for(const auto& mid:msg_versions) + std::cerr << " msg version: " << mid << std::endl; #endif mGrpId = grpId; diff --git a/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp b/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp index 517543b9a..6a7371384 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp +++ b/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp @@ -73,6 +73,7 @@ std::map > GxsCommentTreeWidget::mComm QMutex GxsCommentTreeWidget::mCacheMutex; //#define USE_NEW_DELEGATE 1 +//#define DEBUG_GXSCOMMENT_TREEWIDGET 1 // This class allows to draw the item using an appropriate size @@ -508,6 +509,8 @@ void GxsCommentTreeWidget::service_requestComments(const RsGxsGroupId& group_id, /* request comments */ #ifdef DEBUG_GXSCOMMENT_TREEWIDGET std::cerr << "GxsCommentTreeWidget::service_requestComments for group " << group_id << std::endl; + for(const auto& mid:msgIds) + std::cerr << " including message " << mid << std::endl; #endif RsThread::async([this,group_id,msgIds]() From 11c07cd7c3aae4d50a2f488c3148fb6d2b49b7b5 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 19 Sep 2023 15:10:29 +0200 Subject: [PATCH 2/2] moved endResetModel() call to the endof internal data update in RsFriendListModel --- retroshare-gui/src/gui/common/FriendListModel.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/retroshare-gui/src/gui/common/FriendListModel.cpp b/retroshare-gui/src/gui/common/FriendListModel.cpp index f8740466d..622ae3930 100644 --- a/retroshare-gui/src/gui/common/FriendListModel.cpp +++ b/retroshare-gui/src/gui/common/FriendListModel.cpp @@ -1145,8 +1145,6 @@ void RsFriendListModel::updateInternalData() mLocations.clear(); mTopLevel.clear(); - endResetModel(); - auto TL = mTopLevel ; // This allows to fill TL without touching mTopLevel outside of [begin/end]InsertRows(). // create a map of profiles and groups @@ -1282,7 +1280,8 @@ void RsFriendListModel::updateInternalData() endInsertRows(); } - postMods(); + endResetModel(); + postMods(); mLastInternalDataUpdate = time(NULL); }