diff --git a/libretroshare/src/pqi/p3servicecontrol.cc b/libretroshare/src/pqi/p3servicecontrol.cc index bfcb09031..5207b9829 100644 --- a/libretroshare/src/pqi/p3servicecontrol.cc +++ b/libretroshare/src/pqi/p3servicecontrol.cc @@ -1369,13 +1369,18 @@ RsServiceInfo::RsServiceInfo( const uint16_t min_version_major, const uint16_t min_version_minor) :mServiceName(service_name), - mServiceType((((uint32_t) RS_PKT_VERSION_SERVICE) << 24) + (((uint32_t) service_type) << 8)), + mServiceType(RsServiceInfoUIn16ToFullServiceId(service_type)), mVersionMajor(version_major), mVersionMinor(version_minor), mMinVersionMajor(min_version_major), mMinVersionMinor(min_version_minor) { - return; + return; +} + +unsigned int RsServiceInfo::RsServiceInfoUIn16ToFullServiceId(uint16_t serviceType) +{ + return (((uint32_t) RS_PKT_VERSION_SERVICE) << 24) + (((uint32_t) serviceType) << 8); } diff --git a/libretroshare/src/retroshare/rsservicecontrol.h b/libretroshare/src/retroshare/rsservicecontrol.h index b081e3305..1e22449ae 100644 --- a/libretroshare/src/retroshare/rsservicecontrol.h +++ b/libretroshare/src/retroshare/rsservicecontrol.h @@ -53,6 +53,8 @@ class RsServiceInfo // minimum version can communicate with. uint16_t mMinVersionMajor; uint16_t mMinVersionMinor; + + static unsigned int RsServiceInfoUIn16ToFullServiceId(uint16_t serviceType); }; diff --git a/retroshare-gui/src/gui/statistics/BandwidthStatsWidget.cpp b/retroshare-gui/src/gui/statistics/BandwidthStatsWidget.cpp index 8c04ed9d0..9e7a063f5 100644 --- a/retroshare-gui/src/gui/statistics/BandwidthStatsWidget.cpp +++ b/retroshare-gui/src/gui/statistics/BandwidthStatsWidget.cpp @@ -117,7 +117,7 @@ void BandwidthStatsWidget::updateComboBoxes() { if(*it != ui.service_CB->itemData(indx).toInt()) { - QString sname = QString::fromUtf8(service_info_map.mServiceList[ ((*it)<<8) + 0x02000000].mServiceName.c_str()) ; + QString sname = QString::fromUtf8(service_info_map.mServiceList[RsServiceInfo::RsServiceInfoUIn16ToFullServiceId(*it)].mServiceName.c_str()) ; if(ui.service_CB->count() <= indx) ui.service_CB->addItem(sname + " (0x"+QString::number(*it,16)+")",QVariant(*it)) ; diff --git a/retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp b/retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp index 53c008016..522b5115e 100644 --- a/retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp +++ b/retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp @@ -468,7 +468,7 @@ static QString getServiceNameString(uint16_t service_id) if(ownServices.mServiceList.find(service_id) == ownServices.mServiceList.end()) rsServiceControl->getOwnServices(ownServices); - return QString::fromUtf8(ownServices.mServiceList[service_id].mServiceName.c_str()) ; + return QString::fromUtf8(ownServices.mServiceList[RsServiceInfo::RsServiceInfoUIn16ToFullServiceId(service_id)].mServiceName.c_str()) ; } static QString getVirtualPeerStatusString(uint8_t status) @@ -574,7 +574,7 @@ void GxsNetTunnelsDialog::updateDisplay() for(auto it(groups.begin());it!=groups.end();++it) { painter.drawText(ox+4*cellx,oy+celly,tr("Service: %1 (%2) - Group ID: %3,\t policy: %4, \tstatus: %5, \tlast contact: %6") - .arg(QString::number(it->second.service_id)) + .arg("0x" + QString::number(it->second.service_id, 16)) .arg(getServiceNameString(it->second.service_id)) .arg(QString::fromStdString(it->first.toStdString())) .arg(getGroupPolicyString(it->second.group_policy))