Mercurial > hg > svcore
diff data/model/SparseModel.h @ 1255:ca9032dd2811 3.0-integration
Merge from branch piper
author | Chris Cannam |
---|---|
date | Sat, 05 Nov 2016 10:41:41 +0000 |
parents | cbdd534f517a |
children | 48e9f538e6e9 |
line wrap: on
line diff
--- a/data/model/SparseModel.h Fri Nov 04 16:44:59 2016 +0000 +++ b/data/model/SparseModel.h Sat Nov 05 10:41:41 2016 +0000 @@ -332,8 +332,13 @@ virtual QVariant getData(int row, int column, int role) const { PointListConstIterator i = getPointListIteratorForRow(row); - if (i == m_points.end()) return QVariant(); + if (i == m_points.end()) { +// cerr << "no iterator for row " << row << " (have " << getRowCount() << " rows)" << endl; + return QVariant(); + } +// cerr << "returning data for row " << row << " col " << column << endl; + switch (column) { case 0: { if (role == SortRole) return int(i->frame); @@ -411,6 +416,7 @@ // This is only used if the model is called on to act in // TabularModel mode mutable std::vector<sv_frame_t> m_rows; // map from row number to frame + void rebuildRowVector() const { m_rows.clear(); @@ -458,7 +464,7 @@ while (ri > 0 && m_rows[ri-1] == m_rows[row]) { --ri; ++indexAtFrame; } int initialIndexAtFrame = indexAtFrame; -// std::cerr << "getPointListIteratorForRow " << row << ": initialIndexAtFrame = " << initialIndexAtFrame << std::endl; +// std::cerr << "getPointListIteratorForRow " << row << ": initialIndexAtFrame = " << initialIndexAtFrame << " for frame " << frame << std::endl; PointListConstIterator i0, i1; getPointIterators(frame, i0, i1); @@ -471,9 +477,13 @@ if (indexAtFrame > 0) { --indexAtFrame; continue; } return i; } - -// std::cerr << "returning i with i->frame = " << i->frame << std::endl; - +/* + if (i == m_points.end()) { + std::cerr << "returning i at end" << std::endl; + } else { + std::cerr << "returning i with i->frame = " << i->frame << std::endl; + } +*/ if (indexAtFrame > 0) { std::cerr << "WARNING: SparseModel::getPointListIteratorForRow: No iterator available for row " << row << " (frame = " << frame << ", index at frame = " << initialIndexAtFrame << ", leftover index " << indexAtFrame << ")" << std::endl; }