retroshare-gui fix windows compilation error due to time_t usage

This commit is contained in:
Gioacchino Mazzurco 2018-10-07 14:34:28 +02:00
parent 72d8364370
commit 6db23267c3
No known key found for this signature in database
GPG Key ID: A1FBCA3872E87051
5 changed files with 11 additions and 9 deletions

View File

@ -44,6 +44,7 @@
#include "retroshare-gui/RsAutoUpdatePage.h" #include "retroshare-gui/RsAutoUpdatePage.h"
#include "util/misc.h" #include "util/misc.h"
#include "util/QtVersion.h" #include "util/QtVersion.h"
#include "util/rstime.h"
#include "retroshare/rsgxsflags.h" #include "retroshare/rsgxsflags.h"
#include "retroshare/rsmsgs.h" #include "retroshare/rsmsgs.h"
@ -1944,11 +1945,11 @@ void IdDialog::insertIdDetails(uint32_t token)
rsIdentity->getIdDetails(RsGxsId(data.mMeta.mGroupId),det) ; rsIdentity->getIdDetails(RsGxsId(data.mMeta.mGroupId),det) ;
QString usage_txt ; QString usage_txt ;
std::map<time_t,RsIdentityUsage> rmap ; std::map<rstime_t,RsIdentityUsage> rmap;
for(std::map<RsIdentityUsage,time_t>::const_iterator it(det.mUseCases.begin());it!=det.mUseCases.end();++it) for(auto it(det.mUseCases.begin()); it!=det.mUseCases.end(); ++it)
rmap.insert(std::make_pair(it->second,it->first)) ; rmap.insert(std::make_pair(it->second,it->first));
for(std::map<time_t,RsIdentityUsage>::const_iterator it(rmap.begin());it!=rmap.end();++it) for(auto it(rmap.begin()); it!=rmap.end(); ++it)
usage_txt += QString("<b>")+ getHumanReadableDuration(now - data.mLastUsageTS) + "</b> \t: " + createUsageString(it->second) + "<br/>" ; usage_txt += QString("<b>")+ getHumanReadableDuration(now - data.mLastUsageTS) + "</b> \t: " + createUsageString(it->second) + "<br/>" ;
if(usage_txt.isNull()) if(usage_txt.isNull())

View File

@ -574,7 +574,7 @@ void ChatLobbyDialog::updateParticipantsList()
delete ui.participantsList->takeTopLevelItem(index); delete ui.participantsList->takeTopLevelItem(index);
} }
for (std::map<RsGxsId,time_t>::const_iterator it2(linfo.gxs_ids.begin()); it2 != linfo.gxs_ids.end(); ++it2) for (auto it2(linfo.gxs_ids.begin()); it2 != linfo.gxs_ids.end(); ++it2)
{ {
QString participant = QString::fromUtf8( (it2->first).toStdString().c_str() ); QString participant = QString::fromUtf8( (it2->first).toStdString().c_str() );

View File

@ -792,7 +792,7 @@ void ChatWidget::completeNickname(bool reverse)
std::list<QString> participants; std::list<QString> participants;
RsIdentityDetails details ; RsIdentityDetails details ;
for ( std::map<RsGxsId,time_t>::const_iterator it = lobby.gxs_ids.begin(); it != lobby.gxs_ids.end(); ++it) for (auto it = lobby.gxs_ids.begin(); it != lobby.gxs_ids.end(); ++it)
{ {
if(rsIdentity->getIdDetails(it->first,details)) if(rsIdentity->getIdDetails(it->first,details))
participants.push_front(QString::fromUtf8(details.mNickname.c_str())); participants.push_front(QString::fromUtf8(details.mNickname.c_str()));
@ -859,7 +859,7 @@ QAbstractItemModel *ChatWidget::modelFromPeers()
// Get participants list // Get participants list
QStringList participants; QStringList participants;
for (std::map<RsGxsId,time_t>::const_iterator it = lobby.gxs_ids.begin(); it != lobby.gxs_ids.end(); ++it) for (auto it = lobby.gxs_ids.begin(); it != lobby.gxs_ids.end(); ++it)
{ {
RsIdentityDetails details ; RsIdentityDetails details ;
rsIdentity->getIdDetails(it->first,details) ; rsIdentity->getIdDetails(it->first,details) ;

View File

@ -266,7 +266,7 @@ void GxsTransportStatistics::updateContent()
groupTreeWidget->addTopLevelItem(item); groupTreeWidget->addTopLevelItem(item);
groupTreeWidget->setItemExpanded(item,openned_groups.find(it->first) != openned_groups.end()); groupTreeWidget->setItemExpanded(item,openned_groups.find(it->first) != openned_groups.end());
QString msg_time_string = (stat.last_publish_TS>0)?QString(" (Last msg: %1)").arg(QDateTime::fromTime_t(stat.last_publish_TS).toString()):"" ; QString msg_time_string = (stat.last_publish_TS>0)?QString(" (Last msg: %1)").arg(QDateTime::fromTime_t((uint)stat.last_publish_TS).toString()):"" ;
item->setData(COL_GROUP_NUM_MSGS, Qt::DisplayRole, QString::number(stat.mNumMsgs) + msg_time_string) ; item->setData(COL_GROUP_NUM_MSGS, Qt::DisplayRole, QString::number(stat.mNumMsgs) + msg_time_string) ;
item->setData(COL_GROUP_GRP_ID, Qt::DisplayRole, QString::fromStdString(it->first.toStdString())) ; item->setData(COL_GROUP_GRP_ID, Qt::DisplayRole, QString::fromStdString(it->first.toStdString())) ;

View File

@ -31,6 +31,7 @@
#include "RsAutoUpdatePage.h" #include "RsAutoUpdatePage.h"
#include "ui_GxsTransportStatistics.h" #include "ui_GxsTransportStatistics.h"
#include "gui/gxs/RsGxsUpdateBroadcastPage.h" #include "gui/gxs/RsGxsUpdateBroadcastPage.h"
#include "util/rstime.h"
class GxsTransportStatisticsWidget ; class GxsTransportStatisticsWidget ;
class UIStateHelper; class UIStateHelper;
@ -55,7 +56,7 @@ public:
bool subscribed ; bool subscribed ;
int popularity ; int popularity ;
time_t last_publish_TS; rstime_t last_publish_TS;
std::map<RsGxsMessageId,RsMsgMetaData> messages_metas ; std::map<RsGxsMessageId,RsMsgMetaData> messages_metas ;
}; };