From 7decd2b7b03787cb36164e6dfe3d2337afa53057 Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 11 Dec 2023 21:51:17 +0100 Subject: [PATCH] removed some debug output --- .../src/gui/Posted/PostedListWidgetWithModel.cpp | 5 ++++- retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp | 10 ++++++++-- retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp | 2 ++ .../src/gui/gxschannels/GxsChannelPostFilesModel.cpp | 3 ++- .../src/gui/gxschannels/GxsChannelPostsModel.cpp | 4 +++- .../gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp | 6 ++++++ 6 files changed, 25 insertions(+), 5 deletions(-) diff --git a/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp b/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp index 1798bb4bc..9245706d1 100644 --- a/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp +++ b/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp @@ -619,12 +619,13 @@ void PostedListWidgetWithModel::updateGroupData() void PostedListWidgetWithModel::postPostLoad() { +#ifdef DEBUG_POSTED std::cerr << "Post channel load..." << std::endl; +#endif whileBlocking(ui->filter_LE)->setText(QString()); //Clear it before navigate, as it will update it. if (!mNavigatePendingMsgId.isNull()) navigate(mNavigatePendingMsgId); - #ifdef TO_REMOVE else if( (mLastSelectedPosts.count(groupId()) > 0) && !mLastSelectedPosts[groupId()].isNull()) @@ -639,8 +640,10 @@ void PostedListWidgetWithModel::postPostLoad() ui->postsTree->setFocus(); } #endif +#ifdef DEBUG_POSTED else std::cerr << "No pre-selected channel post." << std::endl; +#endif updateShowLabel(); } diff --git a/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp b/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp index 1233b3100..afc676bdd 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp @@ -131,15 +131,19 @@ void GxsCommentDialog::idChooserReady() void GxsCommentDialog::voterSelectionChanged( int index ) { +#ifdef DEBUG_COMMENT_DIALOG std::cerr << "GxsCommentDialog::voterSelectionChanged(" << index << ")"; std::cerr << std::endl; +#endif RsGxsId voterId; switch (ui->idChooser->getChosenId(voterId)) { case GxsIdChooser::KnowId: case GxsIdChooser::UnKnowId: - std::cerr << "GxsCommentDialog::voterSelectionChanged() => " << voterId; +#ifdef DEBUG_COMMENT_DIALOG + std::cerr << "GxsCommentDialog::voterSelectionChanged() => " << voterId; std::cerr << std::endl; +#endif ui->treeWidget->setVoteId(voterId); break; @@ -160,8 +164,10 @@ void GxsCommentDialog::setCommentHeader(QWidget *header) return; } - std::cerr << "GxsCommentDialog::setCommentHeader() Adding header to ui,postFrame"; +#ifdef DEBUG_COMMENT_DIALOG + std::cerr << "GxsCommentDialog::setCommentHeader() Adding header to ui,postFrame"; std::cerr << std::endl; +#endif //header->setParent(ui->postFrame); //ui->postFrame->setVisible(true); diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp index 9d8d66d61..069c51b79 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp @@ -466,7 +466,9 @@ void GxsGroupFrameDialog::groupTreeCustomPopupMenu(QPoint point) uint32_t current_store_time = checkDelay(mInterface->getStoragePeriod(mGroupId))/86400 ; uint32_t current_sync_time = checkDelay(mInterface->getSyncPeriod(mGroupId))/86400 ; +#ifdef DEBUG_GROUPFRAMEDIALOG std::cerr << "Got sync=" << current_sync_time << ". store=" << current_store_time << std::endl; +#endif QAction *actnn = NULL; QMenu *ctxMenu2 = contextMnu.addMenu(tr("Synchronise posts of last...")) ; diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostFilesModel.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostFilesModel.cpp index 0796b6ce1..806fcaa69 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostFilesModel.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostFilesModel.cpp @@ -499,8 +499,9 @@ void RsGxsChannelPostFilesModel::update_files(std::set& add else ++afit; } - +#ifdef DEBUG_CHANNEL_FILES_MODEL RsDbg() << " Remains: " << added_files.size() << " added files and " << removed_files.size() << " removed files" ; +#endif // 2 - add whatever file remains, diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsModel.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsModel.cpp index a42587d85..8b5b7e707 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsModel.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsModel.cpp @@ -38,7 +38,7 @@ #include "GxsChannelPostFilesModel.h" //#define DEBUG_CHANNEL_MODEL_DATA -#define DEBUG_CHANNEL_MODEL +//#define DEBUG_CHANNEL_MODEL Q_DECLARE_METATYPE(RsMsgMetaData) Q_DECLARE_METATYPE(RsGxsChannelPost) @@ -592,10 +592,12 @@ void RsGxsChannelPostsModel::update_posts(const RsGxsGroupId& group_id) std::cerr << __PRETTY_FUNCTION__ << " failed to retrieve channel messages for channel " << group_id << std::endl; return; } +#ifdef DEBUG_CHANNEL_MODEL std::cerr << "Got channel all content for channel " << group_id << std::endl; std::cerr << " posts : " << posts->size() << std::endl; std::cerr << " comments: " << comments.size() << std::endl; std::cerr << " votes : " << votes.size() << std::endl; +#endif // 2 - update the model in the UI thread. diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp index 2e292444e..18aa2ad17 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp @@ -781,7 +781,9 @@ void GxsChannelPostsWidgetWithModel::handlePostsTreeSizeChange(QSize s,bool forc return; int n_columns = std::max(1,(int)floor(s.width() / (mChannelPostsDelegate->cellSize(0,font(),ui->postsTree->width())))); +#ifdef DEBUG_CHANNEL_POSTS_WIDGET RsDbg() << "nb columns: " << n_columns << " current count=" << mChannelPostsModel->columnCount() ; +#endif // save current post. The setNumColumns() indeed loses selection @@ -825,7 +827,9 @@ void GxsChannelPostsWidgetWithModel::handleEvent_main_thread(std::shared_ptrmChannelGroupId == groupId()) { +#ifdef DEBUG_CHANNEL_POSTS_WIDGET RsDbg() << "Received new message in current channel, msgId=" << e->mChannelMsgId ; +#endif RsThread::async([this,E=*e]() // dereferencing to make a copy that will survive while e is deleted by the parent thread. { @@ -1042,7 +1046,9 @@ void GxsChannelPostsWidgetWithModel::updateData(bool update_group_data, bool upd void GxsChannelPostsWidgetWithModel::postChannelPostLoad() { +#ifdef DEBUG_CHANNEL_POSTS_WIDGET std::cerr << "Post channel load..." << std::endl; +#endif if (!mNavigatePendingMsgId.isNull()) navigate(mNavigatePendingMsgId);