X-Git-Url: https://www.flypig.org.uk/git/?p=harbour-pedalo.git;a=blobdiff_plain;f=src%2Fjourneymodel.cpp;h=5b7b5dab1e9bd1b7d1eb4c6d4ffd952edb62afa7;hp=80a5eb593ec1b48c7de07df2f9cfceb42e35b32a;hb=4248fa25458b2d282d4e0ed4447e4bc7570046eb;hpb=badbb9139e0e5b3bc114ae7c150e6d9ab5183566 diff --git a/src/journeymodel.cpp b/src/journeymodel.cpp index 80a5eb5..5b7b5da 100644 --- a/src/journeymodel.cpp +++ b/src/journeymodel.cpp @@ -30,6 +30,12 @@ void JourneyModel::editJourney(quint32 index, QDateTime start, quint32 duration, emit dataChanged(createIndex(index, 0), createIndex(index, 0)); } +void JourneyModel::deleteJourney(quint32 index) { + beginRemoveRows(QModelIndex(), index, index); + journeys.removeAt(index); + endRemoveRows(); +} + int JourneyModel::rowCount(const QModelIndex & parent) const { Q_UNUSED(parent) return journeys.count(); @@ -99,9 +105,7 @@ void JourneyModel::importFromFile(QFile & file) { QDate JourneyModel::epochToDate(quint64 epoch) { QDateTime date; - qDebug() << "Epoch: " << epoch; date.setMSecsSinceEpoch(epoch); - qDebug() << "Date: " << date.date(); return date.date(); }