From 2802d4296960eb6ad76292baa105075c5427ea67 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 24 Nov 2018 10:01:03 +0100 Subject: Cleanup: Make add_dive_to_table local to divelist.c This function was not used outside of divelist.c, therefore make it local. Moreover rename it to add_to_divetable so that the name is generic and can be generated by a macro. Moreover, remove the special case idx = -1, which would determine the insertion index. Instead let the single caller who used this feature do this. Signed-off-by: Berthold Stoeger --- qt-models/divelistmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qt-models/divelistmodel.cpp') diff --git a/qt-models/divelistmodel.cpp b/qt-models/divelistmodel.cpp index e3934b604..6edb69705 100644 --- a/qt-models/divelistmodel.cpp +++ b/qt-models/divelistmodel.cpp @@ -278,7 +278,7 @@ QString DiveListModel::startAddDive() nr++; d->number = nr; d->dc.model = strdup("manually added dive"); - add_single_dive(-1, d); + add_single_dive(dive_table.nr, d); insertDive(get_idx_by_uniq_id(d->id), new DiveObjectHelper(d)); return QString::number(d->id); } -- cgit v1.2.3-70-g09d2