Commit d4bf5912 authored by Michael Pyne's avatar Michael Pyne
Browse files

history: Enforce specific date format that sorts right.

The QTreeWidget we're using sorts by display text by default. This makes
the date column in the history playlist a bit useless to sort by in the
normal format.

The ISO date format is a bit too ugly though, so I manually implement
something more akin to RFC 3339. To properly fix this we should
implement a specific role in each item that can be sorted by the
underlying model. If the underlying model is a QStandardItemModel this
might already be easy but I don't have time now to investigate further.
parent fce79085
Pipeline #54744 passed with stage
in 11 minutes and 1 second
......@@ -88,13 +88,13 @@ HistoryPlaylistItem::HistoryPlaylistItem(CollectionListItem *item, Playlist *par
PlaylistItem(item, parent, after),
m_dateTime(QDateTime::currentDateTime())
{
setText(0, m_dateTime.toString());
setText(0, m_dateTime.toString(QStringLiteral("yyyy-MM-dd HH:mm:ss")));
}
void HistoryPlaylistItem::setDateTime(const QDateTime &dt)
{
m_dateTime = dt;
setText(0, m_dateTime.toString());
setText(0, m_dateTime.toString(QStringLiteral("yyyy-MM-dd HH:mm:ss")));
}
////////////////////////////////////////////////////////////////////////////////
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment