fix: handle last play of 0
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
parent
1e8c0ac36a
commit
ee1d4acb51
@ -15,7 +15,7 @@
|
||||
|
||||
#include "InstanceProxyModel.h"
|
||||
|
||||
#include "InstanceView.h"
|
||||
#include "InstanceList.h"
|
||||
#include "Application.h"
|
||||
#include <icons/IconList.h>
|
||||
|
||||
@ -34,5 +34,16 @@ QVariant InstanceProxyModel::data(const QModelIndex & index, int role) const
|
||||
if (!data.toString().isEmpty())
|
||||
return APPLICATION->icons()->getIcon(data.toString()); //FIXME: Needs QStyledItemDelegate
|
||||
}
|
||||
|
||||
switch (index.column()) {
|
||||
case InstanceList::LastPlayed: {
|
||||
if (role == Qt::DisplayRole) {
|
||||
QDateTime foo = data.toDateTime();
|
||||
if (foo.isNull() || !foo.isValid() || foo.toMSecsSinceEpoch() == 0)
|
||||
return tr("Never");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user