| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/corelib/tools/qcollator.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | QCollator::QCollator(const QLocale &locale) | - | ||||||||||||
| 5 | : d(new QCollatorPrivate) | - | ||||||||||||
| 6 | { | - | ||||||||||||
| 7 | d->locale = locale; | - | ||||||||||||
| 8 | d->init(); | - | ||||||||||||
| 9 | } executed 193 times by 13 tests: end of blockExecuted by:
| 193 | ||||||||||||
| 10 | - | |||||||||||||
| 11 | - | |||||||||||||
| 12 | - | |||||||||||||
| 13 | - | |||||||||||||
| 14 | QCollator::QCollator(const QCollator &other) | - | ||||||||||||
| 15 | : d(other.d) | - | ||||||||||||
| 16 | { | - | ||||||||||||
| 17 | d->ref.ref(); | - | ||||||||||||
| 18 | } executed 4777 times by 12 tests: end of blockExecuted by:
| 4777 | ||||||||||||
| 19 | - | |||||||||||||
| 20 | - | |||||||||||||
| 21 | - | |||||||||||||
| 22 | - | |||||||||||||
| 23 | QCollator::~QCollator() | - | ||||||||||||
| 24 | { | - | ||||||||||||
| 25 | if (d
| 1-4970 | ||||||||||||
| 26 | delete d; executed 193 times by 13 tests: delete d;Executed by:
| 193 | ||||||||||||
| 27 | } executed 4971 times by 19 tests: end of blockExecuted by:
| 4971 | ||||||||||||
| 28 | - | |||||||||||||
| 29 | - | |||||||||||||
| 30 | - | |||||||||||||
| 31 | - | |||||||||||||
| 32 | QCollator &QCollator::operator=(const QCollator &other) | - | ||||||||||||
| 33 | { | - | ||||||||||||
| 34 | if (this != &other
| 0 | ||||||||||||
| 35 | if (d
| 0 | ||||||||||||
| 36 | delete d; never executed: delete d; | 0 | ||||||||||||
| 37 | d = other.d; | - | ||||||||||||
| 38 | if (d
never executed: d->ref.ref(); | 0 | ||||||||||||
| 39 | } never executed: end of block | 0 | ||||||||||||
| 40 | return never executed: *this;return *this;never executed: return *this; | 0 | ||||||||||||
| 41 | } | - | ||||||||||||
| 42 | void QCollator::detach() | - | ||||||||||||
| 43 | { | - | ||||||||||||
| 44 | if (d->ref.load() != 1
| 0-352 | ||||||||||||
| 45 | QCollatorPrivate *x = new QCollatorPrivate; | - | ||||||||||||
| 46 | x->ref.store(1); | - | ||||||||||||
| 47 | x->locale = d->locale; | - | ||||||||||||
| 48 | x->collator = 0; | - | ||||||||||||
| 49 | if (!d->ref.deref()
| 0 | ||||||||||||
| 50 | delete d; never executed: delete d; | 0 | ||||||||||||
| 51 | d = x; | - | ||||||||||||
| 52 | d->init(); | - | ||||||||||||
| 53 | } never executed: end of block | 0 | ||||||||||||
| 54 | } executed 352 times by 7 tests: end of blockExecuted by:
| 352 | ||||||||||||
| 55 | - | |||||||||||||
| 56 | - | |||||||||||||
| 57 | - | |||||||||||||
| 58 | - | |||||||||||||
| 59 | void QCollator::setLocale(const QLocale &locale) | - | ||||||||||||
| 60 | { | - | ||||||||||||
| 61 | if (locale == d->locale
| 0-3 | ||||||||||||
| 62 | return; never executed: return; | 0 | ||||||||||||
| 63 | - | |||||||||||||
| 64 | detach(); | - | ||||||||||||
| 65 | d->locale = locale; | - | ||||||||||||
| 66 | d->dirty = true; | - | ||||||||||||
| 67 | } executed 3 times by 1 test: end of blockExecuted by:
| 3 | ||||||||||||
| 68 | - | |||||||||||||
| 69 | - | |||||||||||||
| 70 | - | |||||||||||||
| 71 | - | |||||||||||||
| 72 | QLocale QCollator::locale() const | - | ||||||||||||
| 73 | { | - | ||||||||||||
| 74 | return executed 5 times by 1 test: d->locale;return d->locale;Executed by:
executed 5 times by 1 test: return d->locale;Executed by:
| 5 | ||||||||||||
| 75 | } | - | ||||||||||||
| 76 | void QCollator::setCaseSensitivity(Qt::CaseSensitivity cs) | - | ||||||||||||
| 77 | { | - | ||||||||||||
| 78 | if (d->caseSensitivity == cs
| 0-186 | ||||||||||||
| 79 | return; never executed: return; | 0 | ||||||||||||
| 80 | - | |||||||||||||
| 81 | detach(); | - | ||||||||||||
| 82 | d->caseSensitivity = cs; | - | ||||||||||||
| 83 | d->dirty = true; | - | ||||||||||||
| 84 | } executed 186 times by 7 tests: end of blockExecuted by:
| 186 | ||||||||||||
| 85 | Qt::CaseSensitivity QCollator::caseSensitivity() const | - | ||||||||||||
| 86 | { | - | ||||||||||||
| 87 | return executed 2 times by 1 test: d->caseSensitivity;return d->caseSensitivity;Executed by:
executed 2 times by 1 test: return d->caseSensitivity;Executed by:
| 2 | ||||||||||||
| 88 | } | - | ||||||||||||
| 89 | void QCollator::setNumericMode(bool on) | - | ||||||||||||
| 90 | { | - | ||||||||||||
| 91 | if (d->numericMode == on
| 0-162 | ||||||||||||
| 92 | return; never executed: return; | 0 | ||||||||||||
| 93 | - | |||||||||||||
| 94 | detach(); | - | ||||||||||||
| 95 | d->numericMode = on; | - | ||||||||||||
| 96 | d->dirty = true; | - | ||||||||||||
| 97 | } executed 162 times by 7 tests: end of blockExecuted by:
| 162 | ||||||||||||
| 98 | bool QCollator::numericMode() const | - | ||||||||||||
| 99 | { | - | ||||||||||||
| 100 | return executed 1 time by 1 test: d->numericMode;return d->numericMode;Executed by:
executed 1 time by 1 test: return d->numericMode;Executed by:
| 1 | ||||||||||||
| 101 | } | - | ||||||||||||
| 102 | void QCollator::setIgnorePunctuation(bool on) | - | ||||||||||||
| 103 | { | - | ||||||||||||
| 104 | if (d->ignorePunctuation == on
| 0-1 | ||||||||||||
| 105 | return; never executed: return; | 0 | ||||||||||||
| 106 | - | |||||||||||||
| 107 | detach(); | - | ||||||||||||
| 108 | d->ignorePunctuation = on; | - | ||||||||||||
| 109 | d->dirty = true; | - | ||||||||||||
| 110 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||
| 111 | bool QCollator::ignorePunctuation() const | - | ||||||||||||
| 112 | { | - | ||||||||||||
| 113 | return executed 1 time by 1 test: d->ignorePunctuation;return d->ignorePunctuation;Executed by:
executed 1 time by 1 test: return d->ignorePunctuation;Executed by:
| 1 | ||||||||||||
| 114 | } | - | ||||||||||||
| 115 | QCollatorSortKey::QCollatorSortKey(QCollatorSortKeyPrivate *d) | - | ||||||||||||
| 116 | : d(d) | - | ||||||||||||
| 117 | { | - | ||||||||||||
| 118 | } never executed: end of block | 0 | ||||||||||||
| 119 | - | |||||||||||||
| 120 | - | |||||||||||||
| 121 | - | |||||||||||||
| 122 | - | |||||||||||||
| 123 | QCollatorSortKey::QCollatorSortKey(const QCollatorSortKey &other) | - | ||||||||||||
| 124 | : d(other.d) | - | ||||||||||||
| 125 | { | - | ||||||||||||
| 126 | } never executed: end of block | 0 | ||||||||||||
| 127 | - | |||||||||||||
| 128 | - | |||||||||||||
| 129 | - | |||||||||||||
| 130 | - | |||||||||||||
| 131 | QCollatorSortKey::~QCollatorSortKey() | - | ||||||||||||
| 132 | { | - | ||||||||||||
| 133 | } | - | ||||||||||||
| 134 | - | |||||||||||||
| 135 | - | |||||||||||||
| 136 | - | |||||||||||||
| 137 | - | |||||||||||||
| 138 | QCollatorSortKey& QCollatorSortKey::operator=(const QCollatorSortKey &other) | - | ||||||||||||
| 139 | { | - | ||||||||||||
| 140 | if (this != &other
| 0 | ||||||||||||
| 141 | d = other.d; | - | ||||||||||||
| 142 | } never executed: end of block | 0 | ||||||||||||
| 143 | return never executed: *this;return *this;never executed: return *this; | 0 | ||||||||||||
| 144 | } | - | ||||||||||||
| 145 | - | |||||||||||||
| Switch to Source code | Preprocessed file |