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 <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-12-09 19:10:55 +01:00 committed by Dirk Hohndel
parent 6febe22b6b
commit a6a5cf61e2
2 changed files with 6 additions and 7 deletions

View file

@ -2,6 +2,7 @@
#define DIVEIMPORTEDMODEL_H
#include <QAbstractTableModel>
#include <vector>
class DiveImportedModel : public QAbstractTableModel
{
@ -31,7 +32,7 @@ slots:
private:
int firstIndex;
int lastIndex;
bool *checkStates;
std::vector<char> checkStates; // char instead of bool to avoid silly pessimization of std::vector.
struct dive_table *diveTable;
};