mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-15 02:44:20 -05:00
sorting on date in messages and showing time only for same day messages
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2659 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
e1ea7cda10
commit
12536efd16
@ -645,17 +645,20 @@ void MessagesDialog::insertMessages()
|
|||||||
|
|
||||||
// Date First.... (for sorting)
|
// Date First.... (for sorting)
|
||||||
{
|
{
|
||||||
QDateTime qtime;
|
QDateTime qdatetime;
|
||||||
qtime.setTime_t(it->ts);
|
qdatetime.setTime_t(it->ts);
|
||||||
if (it->ts < 86400)
|
|
||||||
|
//if the mail is on same date show only time.
|
||||||
|
if (qdatetime.daysTo(QDateTime::currentDateTime()) == 0)
|
||||||
{
|
{
|
||||||
QString timestamp = qtime.toString("hh:mm:ss");
|
QTime qtime = qdatetime.time();
|
||||||
item3 -> setText(timestamp);
|
QVariant varTime(qtime);
|
||||||
|
item3->setData(varTime, Qt::DisplayRole);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QString timestamp = qtime.toString("dd.MM.yyyy hh:mm:ss");
|
QVariant varDateTime(qdatetime);
|
||||||
item3 -> setText(timestamp);
|
item3->setData(varDateTime, Qt::DisplayRole);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user