summaryrefslogtreecommitdiffstats
path: root/qt-models
diff options
context:
space:
mode:
Diffstat (limited to 'qt-models')
-rw-r--r--qt-models/divelistmodel.cpp3
-rw-r--r--qt-models/divelistmodel.h2
2 files changed, 3 insertions, 2 deletions
diff --git a/qt-models/divelistmodel.cpp b/qt-models/divelistmodel.cpp
index fcdc0dfab..56205e26a 100644
--- a/qt-models/divelistmodel.cpp
+++ b/qt-models/divelistmodel.cpp
@@ -120,7 +120,7 @@ QHash<int, QByteArray> DiveListModel::roleNames() const
}
// create a new dive. set the current time and add it to the end of the dive list
-void DiveListModel::startAddDive()
+QString DiveListModel::startAddDive()
{
struct dive *d;
d = alloc_dive();
@@ -132,6 +132,7 @@ void DiveListModel::startAddDive()
d->number = nr;
add_single_dive(-1, d);
addDive(d);
+ return QString::number(d->id);
}
DiveListModel *DiveListModel::instance()
diff --git a/qt-models/divelistmodel.h b/qt-models/divelistmodel.h
index b75a0f182..f050faab3 100644
--- a/qt-models/divelistmodel.h
+++ b/qt-models/divelistmodel.h
@@ -41,7 +41,7 @@ public:
int rowCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
QHash<int, QByteArray> roleNames() const;
- void startAddDive();
+ QString startAddDive();
private:
QList<Dive> m_dives;
static DiveListModel *m_instance;