From 2dd0187fe827130dbe5a487cd08070fc7c3ae2a4 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Thu, 27 Dec 2018 13:49:40 +0100 Subject: Cleanup: remove getDiveId() functions These functions in DiveListSortModel and DiveListModel had no users. Remove them. Signed-off-by: Berthold Stoeger --- qt-models/divelistmodel.cpp | 13 ------------- qt-models/divelistmodel.h | 2 -- 2 files changed, 15 deletions(-) diff --git a/qt-models/divelistmodel.cpp b/qt-models/divelistmodel.cpp index 953229c45..e3934b604 100644 --- a/qt-models/divelistmodel.cpp +++ b/qt-models/divelistmodel.cpp @@ -61,12 +61,6 @@ int DiveListSortModel::shown() return rowCount(); } -int DiveListSortModel::getDiveId(int idx) -{ - DiveListModel *mySourceModel = qobject_cast(sourceModel()); - return mySourceModel->getDiveId(mapToSource(index(idx,0)).row()); -} - int DiveListSortModel::getIdxForId(int id) { for (int i = 0; i < rowCount(); i++) { @@ -231,13 +225,6 @@ int DiveListModel::rowCount(const QModelIndex &) const return m_dives.count(); } -int DiveListModel::getDiveId(int idx) const -{ - if (idx < 0 || idx >= m_dives.count()) - return -1; - return m_dives[idx]->id(); -} - int DiveListModel::getDiveIdx(int id) const { int i; diff --git a/qt-models/divelistmodel.h b/qt-models/divelistmodel.h index 64d1e7ddc..50b45caa9 100644 --- a/qt-models/divelistmodel.h +++ b/qt-models/divelistmodel.h @@ -19,7 +19,6 @@ public: Q_INVOKABLE QString tripTitle(const QVariant &trip); Q_INVOKABLE QString tripShortDate(const QVariant &trip); public slots: - int getDiveId(int idx); int getIdxForId(int id); void setFilter(QString f); void resetFilter(); @@ -53,7 +52,6 @@ public: void updateDive(int i, dive *d); void clear(); int rowCount(const QModelIndex &parent = QModelIndex()) const; - int getDiveId(int idx) const; int getDiveIdx(int id) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; QHash roleNames() const; -- cgit v1.2.3-70-g09d2