RetroShare/retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.cpp
thunder2 6e04229d39 Fixed utf8 handling in photo comments.
Some cosmetic changes.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5715 b45a01b8-16f6-495d-af2f-9b41ad6348cc
2012-10-23 00:24:41 +00:00

33 lines
740 B
C++

#include <QDateTime>
#include "PhotoCommentItem.h"
#include "ui_PhotoCommentItem.h"
PhotoCommentItem::PhotoCommentItem(const RsPhotoComment& comment, QWidget *parent):
QWidget(parent),
ui(new Ui::PhotoCommentItem), mComment(comment)
{
ui->setupUi(this);
setUp();
}
PhotoCommentItem::~PhotoCommentItem()
{
delete ui;
}
const RsPhotoComment& PhotoCommentItem::getComment()
{
return mComment;
}
void PhotoCommentItem::setUp()
{
ui->labelComment->setText(QString::fromUtf8(mComment.mComment.c_str()));
QDateTime qtime;
qtime.setTime_t(mComment.mMeta.mPublishTs);
QString timestamp = qtime.toString("dd.MMMM yyyy hh:mm");
ui->datetimelabel->setText(timestamp);
}