summaryrefslogtreecommitdiffstats
path: root/qt-models/divetripmodel.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-07-22 12:21:58 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2018-07-23 17:05:15 +0300
commit7dd49acf4b996255b9599d4fe3309d78f66a74cb (patch)
tree8a46a695e1b338db9d40c09203872a313cc25f29 /qt-models/divetripmodel.cpp
parentbe50ee2017b726fdb7fc0a023cd32d91a55350fc (diff)
downloadsubsurface-7dd49acf4b996255b9599d4fe3309d78f66a74cb.tar.gz
Cleanup: remove DiveItem::icon_names member array
Each DiveItem (which is a wrapper around diveId with some virtual functions), had a member icon_names, which is an array of four QStrings. These were not used anywhere and must be an obscure oversight and was probably planned as a static cons array?. In any case, remove it. There *was* a function-local analogous icon_names array in DiveItem::data() though. This array would initialize four QStrings from C-string literals on every invocation. Make this array static, local to the translation unit and use the QStringLiteral macro to construct the QString object at compile-time. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/divetripmodel.cpp')
-rw-r--r--qt-models/divetripmodel.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/qt-models/divetripmodel.cpp b/qt-models/divetripmodel.cpp
index 3dcfb7517..31f1a29a2 100644
--- a/qt-models/divetripmodel.cpp
+++ b/qt-models/divetripmodel.cpp
@@ -82,11 +82,16 @@ QVariant TripItem::data(int column, int role) const
return ret;
}
+static const QString icon_names[4] = {
+ QStringLiteral(":zero"),
+ QStringLiteral(":photo-in-icon"),
+ QStringLiteral(":photo-out-icon"),
+ QStringLiteral(":photo-in-out-icon")
+};
QVariant DiveItem::data(int column, int role) const
{
QVariant retVal;
- QString icon_names[4] = {":zero",":photo-in-icon", ":photo-out-icon", ":photo-in-out-icon" };
struct dive *dive = get_dive_by_uniq_id(diveId);
if (!dive)
return QVariant();