diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-01-09 12:38:39 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-01-09 12:42:09 -0800 |
commit | a92484e4edd7ad2609d9d9e09cdb064e370e745d (patch) | |
tree | 7d54a748656feae25c0fe41ccc7c14095f1547bb /qt-ui | |
parent | 4d26e3a0cbb57d9d0d80e68c783dbd69d5cca794 (diff) | |
download | subsurface-a92484e4edd7ad2609d9d9e09cdb064e370e745d.tar.gz |
Dive d/l selection UI: remove setData() method
Since we now track all clicks on the row, having the setData() actually
neutralized the action that we took on the clicked() signal.
Now you can select / deselect a dive, regardless where in the row you
click.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/downloadfromdivecomputer.cpp | 16 | ||||
-rw-r--r-- | qt-ui/downloadfromdivecomputer.h | 1 |
2 files changed, 0 insertions, 17 deletions
diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp index 5ac39ebf3..fb981c9f8 100644 --- a/qt-ui/downloadfromdivecomputer.cpp +++ b/qt-ui/downloadfromdivecomputer.cpp @@ -586,22 +586,6 @@ QVariant DiveImportedModel::data(const QModelIndex &index, int role) const return QVariant(); } -bool DiveImportedModel::setData(const QModelIndex &index, const QVariant &value, int role) -{ - if (!index.isValid()) - return false; - - if (index.row() + firstIndex > lastIndex) - return false; - - if (role != Qt::CheckStateRole) - return false; - - checkStates[index.row()] = value.toBool(); - dataChanged(index, index, QVector<int>() << Qt::CheckStateRole); - return true; -} - void DiveImportedModel::changeSelected(QModelIndex clickedIndex) { checkStates[clickedIndex.row()] = !checkStates[clickedIndex.row()]; diff --git a/qt-ui/downloadfromdivecomputer.h b/qt-ui/downloadfromdivecomputer.h index efec64f80..70b3c8e62 100644 --- a/qt-ui/downloadfromdivecomputer.h +++ b/qt-ui/downloadfromdivecomputer.h @@ -34,7 +34,6 @@ public: int rowCount(const QModelIndex& index = QModelIndex()) const; QVariant data(const QModelIndex& index, int role) const; QVariant headerData(int section, Qt::Orientation orientation, int role) const; - bool setData(const QModelIndex &index, const QVariant &value, int role); void setImportedDivesIndexes(int first, int last); Qt::ItemFlags flags(const QModelIndex &index) const; void removeUnused(); |