mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-11 07:29:38 -05:00
Merge pull request #2721 from csoler/v0.6-BugFixing_28
removed multiple references to temporary passed accross threads, caus…
This commit is contained in:
commit
242b5229d1
@ -186,13 +186,13 @@ void BaseBoardsCommentsItem::loadMessage()
|
|||||||
if (posts.size() == 1)
|
if (posts.size() == 1)
|
||||||
{
|
{
|
||||||
std::cerr << (void*)this << ": Obtained post, with msgId = " << posts[0].mMeta.mMsgId << std::endl;
|
std::cerr << (void*)this << ": Obtained post, with msgId = " << posts[0].mMeta.mMsgId << std::endl;
|
||||||
const RsPostedPost& post(posts[0]);
|
RsPostedPost post(posts[0]); // no reference to temporary because it's passed to a thread!
|
||||||
|
|
||||||
RsQThreadUtils::postToObject( [post,this]() { setPost(post,true); mIsLoadingMessage = false;}, this );
|
RsQThreadUtils::postToObject( [post,this]() { setPost(post,true); mIsLoadingMessage = false;}, this );
|
||||||
}
|
}
|
||||||
else if(comments.size() == 1)
|
else if(comments.size() == 1)
|
||||||
{
|
{
|
||||||
const RsGxsComment& cmt = comments[0];
|
RsGxsComment cmt(comments[0]);
|
||||||
std::cerr << (void*)this << ": Obtained comment, setting messageId to threadID = " << cmt.mMeta.mThreadId << std::endl;
|
std::cerr << (void*)this << ": Obtained comment, setting messageId to threadID = " << cmt.mMeta.mThreadId << std::endl;
|
||||||
|
|
||||||
RsQThreadUtils::postToObject( [cmt,this]()
|
RsQThreadUtils::postToObject( [cmt,this]()
|
||||||
|
@ -292,13 +292,13 @@ void ChannelsCommentsItem::loadMessage()
|
|||||||
#ifdef DEBUG_ITEM
|
#ifdef DEBUG_ITEM
|
||||||
std::cerr << (void*)this << ": Obtained post, with msgId = " << posts[0].mMeta.mMsgId << std::endl;
|
std::cerr << (void*)this << ": Obtained post, with msgId = " << posts[0].mMeta.mMsgId << std::endl;
|
||||||
#endif
|
#endif
|
||||||
const RsGxsChannelPost& post(posts[0]);
|
RsGxsChannelPost post(posts[0]); // no reference to temporary here, because we pass this to a thread
|
||||||
|
|
||||||
RsQThreadUtils::postToObject( [post,this]() { setPost(post); }, this );
|
RsQThreadUtils::postToObject( [post,this]() { setPost(post); }, this );
|
||||||
}
|
}
|
||||||
else if(comments.size() == 1)
|
else if(comments.size() == 1)
|
||||||
{
|
{
|
||||||
const RsGxsComment& cmt = comments[0];
|
RsGxsComment cmt(comments[0]);
|
||||||
#ifdef DEBUG_ITEM
|
#ifdef DEBUG_ITEM
|
||||||
std::cerr << (void*)this << ": Obtained comment, setting messageId to threadID = " << cmt.mMeta.mThreadId << std::endl;
|
std::cerr << (void*)this << ": Obtained comment, setting messageId to threadID = " << cmt.mMeta.mThreadId << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
@ -125,7 +125,7 @@ void GxsForumGroupItem::loadGroup()
|
|||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const RsGxsForumGroup& group(groups[0]);
|
RsGxsForumGroup group(groups[0]);// no reference to teporary accross threads!
|
||||||
|
|
||||||
RsQThreadUtils::postToObject( [group,this]()
|
RsQThreadUtils::postToObject( [group,this]()
|
||||||
{
|
{
|
||||||
|
@ -235,7 +235,7 @@ void GxsForumMsgItem::loadMessage()
|
|||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const RsGxsForumMsg& msg(msgs[0]);
|
RsGxsForumMsg msg(msgs[0]);
|
||||||
|
|
||||||
RsQThreadUtils::postToObject( [msg,this]()
|
RsQThreadUtils::postToObject( [msg,this]()
|
||||||
{
|
{
|
||||||
@ -280,7 +280,7 @@ void GxsForumMsgItem::loadParentMessage(const RsGxsMessageId& parent_msg)
|
|||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const RsGxsForumMsg& msg(msgs[0]);
|
RsGxsForumMsg msg(msgs[0]);
|
||||||
|
|
||||||
RsQThreadUtils::postToObject( [msg,this]()
|
RsQThreadUtils::postToObject( [msg,this]()
|
||||||
{
|
{
|
||||||
|
@ -173,11 +173,7 @@ void RsGxsChannelPostsModel::updateFilter(uint32_t& count)
|
|||||||
{
|
{
|
||||||
preMods();
|
preMods();
|
||||||
|
|
||||||
beginResetModel();
|
|
||||||
|
|
||||||
mFilteredPosts.clear();
|
mFilteredPosts.clear();
|
||||||
//mFilteredPosts.push_back(0);
|
|
||||||
endResetModel();
|
|
||||||
|
|
||||||
for(size_t i=0;i<mPosts.size();++i)
|
for(size_t i=0;i<mPosts.size();++i)
|
||||||
if(postPassesFilter(mPosts[i],mFilteredStrings,mFilterUnread))
|
if(postPassesFilter(mPosts[i],mFilteredStrings,mFilterUnread))
|
||||||
|
@ -379,7 +379,7 @@ GxsChannelPostsWidgetWithModel::GxsChannelPostsWidgetWithModel(const RsGxsGroupI
|
|||||||
connect(ui->viewType_TB,SIGNAL(clicked()),this,SLOT(switchView()));
|
connect(ui->viewType_TB,SIGNAL(clicked()),this,SLOT(switchView()));
|
||||||
|
|
||||||
ui->showUnread_TB->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/message-state-unread.png"));
|
ui->showUnread_TB->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/message-state-unread.png"));
|
||||||
ui->showUnread_TB->setChecked(false);
|
whileBlocking(ui->showUnread_TB)->setChecked(false);
|
||||||
ui->showUnread_TB->setToolTip(tr("Show unread posts only"));
|
ui->showUnread_TB->setToolTip(tr("Show unread posts only"));
|
||||||
connect(ui->showUnread_TB,SIGNAL(toggled(bool)),this,SLOT(switchOnlyUnread(bool)));
|
connect(ui->showUnread_TB,SIGNAL(toggled(bool)),this,SLOT(switchOnlyUnread(bool)));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user