Merge pull request #2171 from csoler/v0.6-BugFixing_2

0.6.6-RC2 fixes
This commit is contained in:
csoler 2020-12-20 10:39:27 +01:00 committed by GitHub
commit dbeefa4d24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 85 additions and 44 deletions

View File

@ -1730,8 +1730,10 @@ int RsDataService::setCacheSize(uint32_t /* size */)
return 0;
}
void RsDataService::debug_printCacheSize() const
void RsDataService::debug_printCacheSize()
{
RS_STACK_MUTEX(mDbMutex);
uint32_t nb_items,nb_items_on_deadlist;
uint64_t total_size,total_size_of_deadlist;
@ -1743,7 +1745,7 @@ void RsDataService::debug_printCacheSize() const
nb_items = 0,nb_items_on_deadlist = 0;
total_size = 0,total_size_of_deadlist = 0;
for(auto it:mMsgMetaDataCache)
for(auto& it:mMsgMetaDataCache)
{
uint32_t tmp_nb_items,tmp_nb_items_on_deadlist;
uint64_t tmp_total_size,tmp_total_size_of_deadlist;

View File

@ -292,7 +292,7 @@ public:
int updateGroupKeys(const RsGxsGroupId& grpId,const RsTlvSecurityKeySet& keys, uint32_t subscribe_flags) ;
void debug_printCacheSize() const;
void debug_printCacheSize() ;
private:

View File

@ -1472,7 +1472,12 @@ bool RsGxsDataAccess::getGroupStatistic(GroupStatisticRequest *req)
GxsMsgMetaResult metaResult;
mDataStore->retrieveGxsMsgMetaData(metaReq, metaResult);
const std::vector<const RsGxsMsgMetaData*>& msgMetaV = metaResult[req->mGrpId];
const auto& msgMetaV_it = metaResult.find(req->mGrpId);
if(msgMetaV_it == metaResult.end())
return false;
const auto& msgMetaV(msgMetaV_it->second);
req->mGroupStatistic.mGrpId = req->mGrpId;
req->mGroupStatistic.mNumMsgs = msgMetaV.size();

View File

@ -658,24 +658,51 @@ QVariant RsFriendListModel::displayRole(const EntryIndex& e, int col) const
break;
case ENTRY_TYPE_PROFILE:
{
const HierarchicalProfileInformation *profile = getProfileInfo(e);
{
const HierarchicalProfileInformation *profile = getProfileInfo(e);
if(!profile)
return QVariant();
if(!profile)
return QVariant();
#ifdef DEBUG_MODEL_INDEX
std::cerr << profile->profile_info.name.c_str() ;
std::cerr << profile->profile_info.name.c_str() ;
#endif
switch(col)
{
case COLUMN_THREAD_NAME: return QVariant(QString::fromUtf8(profile->profile_info.name.c_str()));
case COLUMN_THREAD_ID: return QVariant(QString::fromStdString(profile->profile_info.gpg_id.toStdString()) );
switch(col)
{
case COLUMN_THREAD_NAME: return QVariant(QString::fromUtf8(profile->profile_info.name.c_str()));
case COLUMN_THREAD_ID: return QVariant(QString::fromStdString(profile->profile_info.gpg_id.toStdString()) );
default:
return QVariant();
}
}
case COLUMN_THREAD_IP:
case COLUMN_THREAD_LAST_CONTACT:
{
if(!isProfileExpanded(e))
{
const HierarchicalProfileInformation *hn = getProfileInfo(e);
QDateTime most_recent_time = QDateTime::fromTime_t(0);
QString most_recent_ip("---");
for(uint32_t i=0;i<hn->child_node_indices.size();++i)
{
const HierarchicalNodeInformation& node = mLocations[hn->child_node_indices[i]];
auto node_time = QDateTime::fromTime_t(node.node_info.lastConnect);
if(most_recent_time < node_time)
{
most_recent_time = node_time;
most_recent_ip = (node.node_info.state & RS_PEER_STATE_CONNECTED) ? StatusDefs::connectStateIpString(node.node_info) : QString("---");
}
}
if(col == COLUMN_THREAD_LAST_CONTACT) return QVariant(most_recent_time);
if(col == COLUMN_THREAD_IP) return QVariant(most_recent_ip);
}
}
default:
return QVariant();
}
}
break;
case ENTRY_TYPE_NODE:

View File

@ -283,7 +283,7 @@ void ConfCertDialog::loadInvitePage()
if(ui._shortFormat_CB->isChecked())
{
rsPeers->getShortInvite(invite,detail.id,flags);
ui.stabWidget->setTabText(1, tr("Retroshare ID"));
ui.stabWidget->setTabText(2, tr("Retroshare ID"));
}
else
{

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>658</width>
<height>584</height>
<height>400</height>
</rect>
</property>
<property name="windowTitle">
@ -68,6 +68,12 @@
</item>
<item row="0" column="0">
<widget class="QTabWidget" name="stabWidget">
<property name="minimumSize">
<size>
<width>638</width>
<height>0</height>
</size>
</property>
<property name="currentIndex">
<number>0</number>
</property>
@ -249,6 +255,26 @@
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Connectivity</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
@ -357,19 +383,6 @@
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_4">
@ -428,6 +441,12 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>HeaderFrame</class>
<extends>QFrame</extends>
<header>gui/common/HeaderFrame.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>RSTextBrowser</class>
<extends>QTextBrowser</extends>
@ -439,12 +458,6 @@
<header>gui/common/AvatarWidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>HeaderFrame</class>
<extends>QFrame</extends>
<header>gui/common/HeaderFrame.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>stabWidget</tabstop>
@ -456,12 +469,6 @@
<tabstop>lastcontact</tabstop>
<tabstop>version</tabstop>
<tabstop>statusmessage</tabstop>
<tabstop>localAddress</tabstop>
<tabstop>localPort</tabstop>
<tabstop>extAddress</tabstop>
<tabstop>extPort</tabstop>
<tabstop>dynDNS</tabstop>
<tabstop>ipAddressList</tabstop>
<tabstop>userCertificateText</tabstop>
<tabstop>_shouldAddSignatures_CB</tabstop>
<tabstop>_shortFormat_CB</tabstop>