Fix SEGV when adding/deleting metadata fields

.. model header data updates need to trigger a reset
   of the views and internal state e.g. index of the
   calendar text and the headings_ string list.
This commit is contained in:
Mark Liversedge
2015-01-05 20:10:42 +00:00
parent 011ad14e6f
commit 86a599bfb8
3 changed files with 26 additions and 8 deletions

View File

@@ -174,6 +174,7 @@ RideCacheModel::configChanged(qint32)
// 5 bool isRun;
columns_ = 5 + factory->metricCount() + metadata.count();
headings_.clear();
for (int section=0; section<columns_; section++) {
@@ -206,10 +207,10 @@ RideCacheModel::configChanged(qint32)
}
}
headerDataChanged (Qt::Horizontal, 0, columns_-1);
// all good
endResetModel();
headerDataChanged (Qt::Horizontal, 0, columns_-1);
}
// catch ridecache refreshes