diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-06-29 10:39:12 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-06-29 10:44:17 -0700 |
commit | 57bad198cbaaae20a1357377ecfddd72bf697882 (patch) | |
tree | c8124086990f7dfa044bb6683cac813dce1a3466 /qt-models/divetripmodel.cpp | |
parent | 48c79d19b87d87d5e3ddfa1972aefdc99310dfc0 (diff) | |
download | subsurface-57bad198cbaaae20a1357377ecfddd72bf697882.tar.gz |
Show icon in dive list to mark dives that have GPS data
The icon is public domain and came from
https://commons.wikimedia.org/wiki/File:Emblem-earth.svg
(also removed the redundant entry for "edit" from the .qrc file)
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-models/divetripmodel.cpp')
-rw-r--r-- | qt-models/divetripmodel.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/qt-models/divetripmodel.cpp b/qt-models/divetripmodel.cpp index 3b08e6838..fcba4a570 100644 --- a/qt-models/divetripmodel.cpp +++ b/qt-models/divetripmodel.cpp @@ -3,6 +3,7 @@ #include "metrics.h" #include "divelist.h" #include "helpers.h" +#include <QIcon> static int nitrox_sort_value(struct dive *dive) { @@ -178,6 +179,13 @@ QVariant DiveItem::data(int column, int role) const break; } break; + case Qt::DecorationRole: + if (column == LOCATION) + if (dive_has_gps_location(dive)) { + IconMetrics im = defaultIconMetrics(); + retVal = QIcon(":satellite").pixmap(im.sz_small, im.sz_small); + } + break; case Qt::ToolTipRole: switch (column) { case NR: |