Mercurial > hg > svcore
comparison data/model/ModelDataTableModel.cpp @ 843:e802e550a1f2
Drop std:: from cout, cerr, endl -- pull these in through Debug.h
author | Chris Cannam |
---|---|
date | Tue, 26 Nov 2013 13:35:08 +0000 |
parents | 2b3a8ae04597 |
children | 59e7fe1b1003 |
comparison
equal
deleted
inserted
replaced
842:23d3a6eca5c3 | 843:e802e550a1f2 |
---|---|
203 } | 203 } |
204 m_sortColumn = column; | 204 m_sortColumn = column; |
205 m_sortOrdering = sortOrder; | 205 m_sortOrdering = sortOrder; |
206 int current = getCurrentRow(); | 206 int current = getCurrentRow(); |
207 if (current != prevCurrent) { | 207 if (current != prevCurrent) { |
208 // std::cerr << "Current row changed from " << prevCurrent << " to " << current << " for underlying row " << m_currentRow << std::endl; | 208 // cerr << "Current row changed from " << prevCurrent << " to " << current << " for underlying row " << m_currentRow << endl; |
209 emit currentChanged(createIndex(current, 0, (void *)0)); | 209 emit currentChanged(createIndex(current, 0, (void *)0)); |
210 } | 210 } |
211 emit layoutChanged(); | 211 emit layoutChanged(); |
212 } | 212 } |
213 | 213 |
295 if (!m_model) return; | 295 if (!m_model) return; |
296 | 296 |
297 bool numeric = (m_model->getSortType(m_sortColumn) == | 297 bool numeric = (m_model->getSortType(m_sortColumn) == |
298 TabularModel::SortNumeric); | 298 TabularModel::SortNumeric); |
299 | 299 |
300 // std::cerr << "resort: numeric == " << numeric << std::endl; | 300 // cerr << "resort: numeric == " << numeric << endl; |
301 | 301 |
302 m_sort.clear(); | 302 m_sort.clear(); |
303 m_rsort.clear(); | 303 m_rsort.clear(); |
304 | 304 |
305 if (numeric) resortNumeric(); | 305 if (numeric) resortNumeric(); |
336 QVariant value = m_model->getData(i, m_sortColumn, TabularModel::SortRole); | 336 QVariant value = m_model->getData(i, m_sortColumn, TabularModel::SortRole); |
337 rowMap.insert(MapType::value_type(value.toDouble(), i)); | 337 rowMap.insert(MapType::value_type(value.toDouble(), i)); |
338 } | 338 } |
339 | 339 |
340 for (MapType::iterator i = rowMap.begin(); i != rowMap.end(); ++i) { | 340 for (MapType::iterator i = rowMap.begin(); i != rowMap.end(); ++i) { |
341 // std::cerr << "resortNumeric: " << i->second << ": " << i->first << std::endl; | 341 // cerr << "resortNumeric: " << i->second << ": " << i->first << endl; |
342 m_rsort.push_back(i->second); | 342 m_rsort.push_back(i->second); |
343 } | 343 } |
344 | 344 |
345 // rsort now maps from sorted row number to original row number | 345 // rsort now maps from sorted row number to original row number |
346 } | 346 } |
360 m_model->getData(i, m_sortColumn, TabularModel::SortRole); | 360 m_model->getData(i, m_sortColumn, TabularModel::SortRole); |
361 rowMap.insert(MapType::value_type(value.toString(), i)); | 361 rowMap.insert(MapType::value_type(value.toString(), i)); |
362 } | 362 } |
363 | 363 |
364 for (MapType::iterator i = rowMap.begin(); i != rowMap.end(); ++i) { | 364 for (MapType::iterator i = rowMap.begin(); i != rowMap.end(); ++i) { |
365 // std::cerr << "resortAlphabetical: " << i->second << ": " << i->first << std::endl; | 365 // cerr << "resortAlphabetical: " << i->second << ": " << i->first << endl; |
366 m_rsort.push_back(i->second); | 366 m_rsort.push_back(i->second); |
367 } | 367 } |
368 | 368 |
369 // rsort now maps from sorted row number to original row number | 369 // rsort now maps from sorted row number to original row number |
370 } | 370 } |
386 { | 386 { |
387 // int prevCurrent = getCurrentRow(); | 387 // int prevCurrent = getCurrentRow(); |
388 m_sort.clear(); | 388 m_sort.clear(); |
389 // int current = getCurrentRow(); //!!! no -- not until the sort criteria have changed | 389 // int current = getCurrentRow(); //!!! no -- not until the sort criteria have changed |
390 // if (current != prevCurrent) { | 390 // if (current != prevCurrent) { |
391 // std::cerr << "Current row changed from " << prevCurrent << " to " << current << " for underlying row " << m_currentRow << std::endl; | 391 // cerr << "Current row changed from " << prevCurrent << " to " << current << " for underlying row " << m_currentRow << endl; |
392 // emit currentRowChanged(createIndex(current, 0, 0)); | 392 // emit currentRowChanged(createIndex(current, 0, 0)); |
393 // } | 393 // } |
394 } | 394 } |
395 | 395 |
396 | 396 |