diff options
-rw-r--r-- | qt-models/divetripmodel.cpp | 30 | ||||
-rw-r--r-- | qt-models/divetripmodel.h | 1 |
2 files changed, 0 insertions, 31 deletions
diff --git a/qt-models/divetripmodel.cpp b/qt-models/divetripmodel.cpp index 453a93c1e..677be21fb 100644 --- a/qt-models/divetripmodel.cpp +++ b/qt-models/divetripmodel.cpp @@ -508,36 +508,6 @@ Qt::ItemFlags DiveTripModelBase::flags(const QModelIndex &index) const return d && index.column() == NR ? base | Qt::ItemIsEditable : base; } -bool DiveTripModelBase::setData(const QModelIndex &index, const QVariant &value, int role) -{ - // We only support setting of data for dives and there, only the number. - dive *d = diveOrNull(index); - if (!d) - return false; - if (role != Qt::EditRole) - return false; - if (index.column() != NR) - return false; - - int v = value.toInt(); - if (v == 0) - return false; - - // Only accept numbers that are not already in use by other dives. - int i; - struct dive *dive; - for_each_dive (i, dive) { - if (dive->number == v) - return false; - } -#if defined(SUBSURFACE_MOBILE) - d->number = v; -#else - Command::editNumber(v, d); -#endif - return true; -} - // Update visibility status of dive and return dives whose visibility changed. // Attention: the changed dives are removed from the original vector! static ShownChange updateShown(QVector<dive *> &dives) diff --git a/qt-models/divetripmodel.h b/qt-models/divetripmodel.h index 97000aa23..0eb78d6a3 100644 --- a/qt-models/divetripmodel.h +++ b/qt-models/divetripmodel.h @@ -70,7 +70,6 @@ public: Qt::ItemFlags flags(const QModelIndex &index) const; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; - bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; DiveTripModelBase(QObject *parent = 0); int columnCount(const QModelIndex&) const; |