| 682 | } |
| 683 | |
| 684 | int ReadingListModel::addLabelIntoList(LabelItem *item) |
| 685 | { |
| 686 | if (labels.isEmpty()) |
| 687 | labels << item; |
| 688 | else { |
| 689 | int i = 0; |
| 690 | |
| 691 | while (i < labels.count() && (labels.at(i)->colorid() < item->colorid())) |
| 692 | i++; |
| 693 | |
| 694 | if (i < labels.count()) { |
| 695 | if (labels.at(i)->colorid() == item->colorid()) // sort by name |
| 696 | { |
| 697 | while (i < labels.count() && labels.at(i)->colorid() == item->colorid() && naturalSortLessThanCI(labels.at(i)->name(), item->name())) |
| 698 | i++; |
| 699 | } |
| 700 | } |
| 701 | |
| 702 | if (i >= labels.count()) { |
| 703 | QLOG_DEBUG() << "insertando label al final " << item->name(); |
| 704 | labels << item; |
| 705 | } else { |
| 706 | QLOG_DEBUG() << "insertando label en " << i << "-" << item->name(); |
| 707 | labels.insert(i, item); |
| 708 | } |
| 709 | |
| 710 | return i; |
| 711 | } |
| 712 | |
| 713 | return 0; |
| 714 | } |
| 715 | |
| 716 | void ReadingListModel::reorderingChildren(QList<ReadingListItem *> children) |
| 717 | { |
nothing calls this directly
no test coverage detected