summaryrefslogtreecommitdiffstats
path: root/qt-ui/models.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/models.cpp')
-rw-r--r--qt-ui/models.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index ba325e149..80ccf0e73 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -971,7 +971,7 @@ QVariant DiveItem::data(int column, int role) const
case Qt::DisplayRole:
switch (column) {
case NR: retVal = dive->number; break;
- case DATE: retVal = QString(get_dive_date_string(dive->when)); break;
+ case DATE: retVal = displayDate(); break;
case DEPTH: retVal = displayDepth(); break;
case DURATION: retVal = displayDuration(); break;
case TEMPERATURE: retVal = displayTemperature(); break;
@@ -996,6 +996,14 @@ QVariant DiveItem::data(int column, int role) const
return retVal;
}
+QString DiveItem::displayDate() const
+{
+ char *buf = get_dive_date_string(dive->when);
+ QString date(buf);
+ free(buf);
+ return date;
+}
+
QString DiveItem::displayDepth() const
{
const int scale = 1000;