2012-10-13 17:10:42 -04:00
|
|
|
#include <QDateTime>
|
|
|
|
|
2012-09-17 18:08:23 -04:00
|
|
|
#include "PhotoCommentItem.h"
|
|
|
|
#include "ui_PhotoCommentItem.h"
|
|
|
|
|
2012-10-13 17:10:42 -04:00
|
|
|
|
2012-09-25 17:04:04 -04:00
|
|
|
PhotoCommentItem::PhotoCommentItem(const RsPhotoComment& comment, QWidget *parent):
|
2012-09-17 18:08:23 -04:00
|
|
|
QWidget(parent),
|
2012-09-25 17:04:04 -04:00
|
|
|
ui(new Ui::PhotoCommentItem), mComment(comment)
|
2012-09-17 18:08:23 -04:00
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
2012-09-25 17:04:04 -04:00
|
|
|
setUp();
|
2012-09-17 18:08:23 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
PhotoCommentItem::~PhotoCommentItem()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
2012-09-25 17:04:04 -04:00
|
|
|
|
|
|
|
const RsPhotoComment& PhotoCommentItem::getComment()
|
|
|
|
{
|
|
|
|
return mComment;
|
|
|
|
}
|
|
|
|
|
|
|
|
void PhotoCommentItem::setUp()
|
|
|
|
{
|
|
|
|
ui->labelComment->setText(QString::fromStdString(mComment.mComment));
|
2012-10-13 17:10:42 -04:00
|
|
|
QDateTime qtime;
|
|
|
|
qtime.setTime_t(mComment.mMeta.mPublishTs);
|
|
|
|
QString timestamp = qtime.toString("dd.MMMM yyyy hh:mm");
|
|
|
|
ui->datetimelabel->setText(timestamp);
|
2012-09-25 17:04:04 -04:00
|
|
|
}
|