From a6a5cf61e2f45eb54721c7ee2dbcc05afe8939f9 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 9 Dec 2018 19:10:55 +0100 Subject: Cleanup: make DiveImportedModel::checkStates a std::vector To not have to bother with memory-management. Moreover, the old code was in principle wrong, since it assumed that sizeof(bool) == 1. Of course, this is true for all supported platforms, but let's not depend on such implementation-defined behavior anyway. Signed-off-by: Berthold Stoeger --- qt-models/diveimportedmodel.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'qt-models/diveimportedmodel.h') diff --git a/qt-models/diveimportedmodel.h b/qt-models/diveimportedmodel.h index eeea0b82c..fc4d9147b 100644 --- a/qt-models/diveimportedmodel.h +++ b/qt-models/diveimportedmodel.h @@ -2,6 +2,7 @@ #define DIVEIMPORTEDMODEL_H #include +#include class DiveImportedModel : public QAbstractTableModel { @@ -31,7 +32,7 @@ slots: private: int firstIndex; int lastIndex; - bool *checkStates; + std::vector checkStates; // char instead of bool to avoid silly pessimization of std::vector. struct dive_table *diveTable; }; -- cgit v1.2.3-70-g09d2