Changeset 13720 for trunk/qt/torrent-filter.cc
- Timestamp:
- Dec 30, 2012, 1:28:28 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/qt/torrent-filter.cc
r12653 r13720 11 11 */ 12 12 13 #include <algorithm> 13 14 #include <iostream> 14 15 … … 206 207 } 207 208 208 int 209 TorrentFilter :: count( const FilterMode& mode ) const 210 { 211 int count = 0; 212 213 for( int row=0; ; ++row ) { 214 QModelIndex index = sourceModel()->index( row, 0 ); 215 if( !index.isValid( ) ) 216 break; 217 const Torrent * tor = index.data( TorrentModel::TorrentRole ).value<const Torrent*>(); 218 if( activityFilterAcceptsTorrent( tor, mode ) ) 219 ++count; 220 } 221 222 return count; 223 } 209 void 210 TorrentFilter :: countTorrentsPerMode (int * setmeCounts) const 211 { 212 std::fill_n (setmeCounts, FilterMode::NUM_MODES, 0); 213 214 for (int row(0); ; ++row) 215 { 216 QModelIndex index (sourceModel()->index(row, 0)); 217 if (!index.isValid()) 218 break; 219 220 const Torrent * tor (index.data( TorrentModel::TorrentRole ).value<const Torrent*>()); 221 for (int mode(0); mode<FilterMode::NUM_MODES; ++mode) 222 if (activityFilterAcceptsTorrent (tor, mode)) 223 ++setmeCounts[mode]; 224 } 225 } 226
Note: See TracChangeset
for help on using the changeset viewer.