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 "util/misc.h"
#include "util/QtVersion.h"
#include "util/rstime.h"
#include "retroshare/rsgxsflags.h"
#include "retroshare/rsmsgs.h"
@ -1944,11 +1945,11 @@ void IdDialog::insertIdDetails(uint32_t token)
rsIdentity->getIdDetails(RsGxsId(data.mMeta.mGroupId),det) ;
QString usage_txt ;
std::map<time_t,RsIdentityUsage> rmap ;
for(std::map<RsIdentityUsage,time_t>::const_iterator it(det.mUseCases.begin());it!=det.mUseCases.end();++it)
rmap.insert(std::make_pair(it->second,it->first)) ;
std::map<rstime_t,RsIdentityUsage> rmap;
for(auto it(det.mUseCases.begin()); it!=det.mUseCases.end(); ++it)
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/>" ;
if(usage_txt.isNull())

View File

@ -574,7 +574,7 @@ void ChatLobbyDialog::updateParticipantsList()
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() );

View File

@ -792,7 +792,7 @@ void ChatWidget::completeNickname(bool reverse)
std::list<QString> participants;
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))
participants.push_front(QString::fromUtf8(details.mNickname.c_str()));
@ -859,7 +859,7 @@ QAbstractItemModel *ChatWidget::modelFromPeers()
// Get participants list
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 ;
rsIdentity->getIdDetails(it->first,details) ;

View File

@ -266,7 +266,7 @@ void GxsTransportStatistics::updateContent()
groupTreeWidget->addTopLevelItem(item);
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_GRP_ID, Qt::DisplayRole, QString::fromStdString(it->first.toStdString())) ;

View File

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