added some more debug info and proper error output to GxsDb

This commit is contained in:
csoler 2020-03-26 23:19:34 +01:00
parent 8cf78b072b
commit c18dfb39c3
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
8 changed files with 98 additions and 46 deletions

View file

@ -175,7 +175,7 @@ void GxsGroupFrameDialog::initUi()
void GxsGroupFrameDialog::showEvent(QShowEvent *event)
{
if (!mInitialized || ui->groupTreeWidget->treeWidget()->topLevelItemCount() == 0)
if (!mInitialized )
{
/* Problem: virtual methods cannot be used in constructor */
@ -1028,6 +1028,8 @@ void GxsGroupFrameDialog::updateGroupSummary()
std::cerr << __PRETTY_FUNCTION__ << " failed to collect group info " << std::endl;
return;
}
if(groupInfo.empty())
return;
RsQThreadUtils::postToObject( [this,groupInfo]()
{
@ -1049,17 +1051,18 @@ void GxsGroupFrameDialog::updateGroupSummary()
mNavigatePendingGroupId.clear();
mNavigatePendingMsgId.clear();
}
// update the local cache in order to avoid re-asking the data when the UI wants it (this happens on ::show() for instance)
mCachedGroupMetas.clear();
// update the local cache in order to avoid re-asking the data when the UI wants it (this happens on ::show() for instance)
mCachedGroupMetas.clear();
// now delete the data that is not used anymore
for(auto& g:groupInfo)
{
mCachedGroupMetas[g->mMeta.mGroupId] = g->mMeta;
delete g;
}
for(auto& g:groupInfo)
{
mCachedGroupMetas[g->mMeta.mGroupId] = g->mMeta;
delete g;
}
}, this );
});