| 11 | } |
| 12 | |
| 13 | bool Version::operator<(const Version &other) const |
| 14 | { |
| 15 | const int size = qMax(m_sections.size(), other.m_sections.size()); |
| 16 | for (int i = 0; i < size; ++i) |
| 17 | { |
| 18 | const Section sec1 = (i >= m_sections.size()) ? Section("0") : m_sections.at(i); |
| 19 | const Section sec2 = |
| 20 | (i >= other.m_sections.size()) ? Section("0") : other.m_sections.at(i); |
| 21 | if (sec1 != sec2) |
| 22 | { |
| 23 | return sec1 < sec2; |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | return false; |
| 28 | } |
| 29 | bool Version::operator<=(const Version &other) const |
| 30 | { |
| 31 | return *this < other || *this == other; |