Add menu (delete, edit) to journey list items
[harbour-pedalo.git] / src / journeymodel.cpp
index 80a5eb5..5b7b5da 100644 (file)
@@ -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();
 }