Rev 321 | Rev 349 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 321 | Rev 346 | ||
---|---|---|---|
Line 139... | Line 139... | ||
139 | int Management::kill(int pctfrom, int pctto, int number) |
139 | int Management::kill(int pctfrom, int pctto, int number) |
140 | {
|
140 | {
|
141 | if (mTrees.isEmpty()) |
141 | if (mTrees.isEmpty()) |
142 | return 0; |
142 | return 0; |
143 | int index_from = limit(int(pctfrom/100. * mTrees.count()), 0, mTrees.count()); |
143 | int index_from = limit(int(pctfrom/100. * mTrees.count()), 0, mTrees.count()); |
144 | int index_to = limit(int(pctto/100. * mTrees.count()), 0, mTrees.count()); |
144 | int index_to = limit(int(pctto/100. * mTrees.count()), 0, mTrees.count()-1); |
145 | if (index_from>=index_to) |
145 | if (index_from>=index_to) |
146 | return 0; |
146 | return 0; |
147 | qDebug() << "attempting to remove" << number << "trees between indices" << index_from << "and" << index_to; |
147 | qDebug() << "attempting to remove" << number << "trees between indices" << index_from << "and" << index_to; |
148 | int i; |
148 | int i; |
149 | int count = number; |
149 | int count = number; |