qcollator.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/tools/qcollator.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4QCollator::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 block
Executed by:
  • tst_ModelTest
  • tst_QCollator
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QListWidget
  • tst_QPrinter
  • tst_QTableWidget
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
  • tst_languageChange
193
10-
11-
12-
13-
14QCollator::QCollator(const QCollator &other)-
15 : d(other.d)-
16{-
17 d->ref.ref();-
18}
executed 4777 times by 12 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QListWidget
  • tst_QPrinter
  • tst_QTableWidget
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
  • tst_languageChange
4777
19-
20-
21-
22-
23QCollator::~QCollator()-
24{-
25 if (d
dDescription
TRUEevaluated 4970 times by 19 tests
Evaluated by:
  • tst_ModelTest
  • tst_QCollator
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QListWidget
  • tst_QPrinter
  • tst_QTableWidget
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
  • tst_languageChange
  • tst_modeltest - unknown status
  • tst_qitemmodel - unknown status
  • tst_qlistwidget - unknown status
  • tst_qtablewidget - unknown status
  • tst_qtreewidget - unknown status
  • tst_qtreewidgetitemiterator - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QCollator
&& !d->ref.deref()
!d->ref.deref()Description
TRUEevaluated 193 times by 13 tests
Evaluated by:
  • tst_QCollator
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QPrinter
  • tst_languageChange
  • tst_modeltest - unknown status
  • tst_qitemmodel - unknown status
  • tst_qlistwidget - unknown status
  • tst_qtablewidget - unknown status
  • tst_qtreewidget - unknown status
  • tst_qtreewidgetitemiterator - unknown status
FALSEevaluated 4777 times by 12 tests
Evaluated by:
  • tst_ModelTest
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QListWidget
  • tst_QPrinter
  • tst_QTableWidget
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
  • tst_languageChange
)
1-4970
26 delete d;
executed 193 times by 13 tests: delete d;
Executed by:
  • tst_QCollator
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QPrinter
  • tst_languageChange
  • tst_modeltest - unknown status
  • tst_qitemmodel - unknown status
  • tst_qlistwidget - unknown status
  • tst_qtablewidget - unknown status
  • tst_qtreewidget - unknown status
  • tst_qtreewidgetitemiterator - unknown status
193
27}
executed 4971 times by 19 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QCollator
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QListWidget
  • tst_QPrinter
  • tst_QTableWidget
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
  • tst_languageChange
  • tst_modeltest - unknown status
  • tst_qitemmodel - unknown status
  • tst_qlistwidget - unknown status
  • tst_qtablewidget - unknown status
  • tst_qtreewidget - unknown status
  • tst_qtreewidgetitemiterator - unknown status
4971
28-
29-
30-
31-
32QCollator &QCollator::operator=(const QCollator &other)-
33{-
34 if (this != &other
this != &otherDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
35 if (d
dDescription
TRUEnever evaluated
FALSEnever evaluated
&& !d->ref.deref()
!d->ref.deref()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
36 delete d;
never executed: delete d;
0
37 d = other.d;-
38 if (d
dDescription
TRUEnever evaluated
FALSEnever evaluated
) d->ref.ref();
never executed: d->ref.ref();
0
39 }
never executed: end of block
0
40 return
never executed: return *this;
*this;
never executed: return *this;
0
41}-
42void QCollator::detach()-
43{-
44 if (d->ref.load() != 1
d->ref.load() != 1Description
TRUEnever evaluated
FALSEevaluated 352 times by 7 tests
Evaluated by:
  • tst_QCollator
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QPrinter
  • tst_languageChange
) {
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()
!d->ref.deref()Description
TRUEnever evaluated
FALSEnever evaluated
)
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 block
Executed by:
  • tst_QCollator
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QPrinter
  • tst_languageChange
352
55-
56-
57-
58-
59void QCollator::setLocale(const QLocale &locale)-
60{-
61 if (locale == d->locale
locale == d->localeDescription
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QCollator
)
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 block
Executed by:
  • tst_QCollator
3
68-
69-
70-
71-
72QLocale QCollator::locale() const-
73{-
74 return
executed 5 times by 1 test: return d->locale;
Executed by:
  • tst_QCollator
d->locale;
executed 5 times by 1 test: return d->locale;
Executed by:
  • tst_QCollator
5
75}-
76void QCollator::setCaseSensitivity(Qt::CaseSensitivity cs)-
77{-
78 if (d->caseSensitivity == cs
d->caseSensitivity == csDescription
TRUEnever evaluated
FALSEevaluated 186 times by 7 tests
Evaluated by:
  • tst_QCollator
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QPrinter
  • tst_languageChange
)
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 block
Executed by:
  • tst_QCollator
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QPrinter
  • tst_languageChange
186
85Qt::CaseSensitivity QCollator::caseSensitivity() const-
86{-
87 return
executed 2 times by 1 test: return d->caseSensitivity;
Executed by:
  • tst_QCollator
d->caseSensitivity;
executed 2 times by 1 test: return d->caseSensitivity;
Executed by:
  • tst_QCollator
2
88}-
89void QCollator::setNumericMode(bool on)-
90{-
91 if (d->numericMode == on
d->numericMode == onDescription
TRUEnever evaluated
FALSEevaluated 162 times by 7 tests
Evaluated by:
  • tst_QCollator
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QPrinter
  • tst_languageChange
)
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 block
Executed by:
  • tst_QCollator
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QPrinter
  • tst_languageChange
162
98bool QCollator::numericMode() const-
99{-
100 return
executed 1 time by 1 test: return d->numericMode;
Executed by:
  • tst_QCollator
d->numericMode;
executed 1 time by 1 test: return d->numericMode;
Executed by:
  • tst_QCollator
1
101}-
102void QCollator::setIgnorePunctuation(bool on)-
103{-
104 if (d->ignorePunctuation == on
d->ignorePunctuation == onDescription
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QCollator
)
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 block
Executed by:
  • tst_QCollator
1
111bool QCollator::ignorePunctuation() const-
112{-
113 return
executed 1 time by 1 test: return d->ignorePunctuation;
Executed by:
  • tst_QCollator
d->ignorePunctuation;
executed 1 time by 1 test: return d->ignorePunctuation;
Executed by:
  • tst_QCollator
1
114}-
115QCollatorSortKey::QCollatorSortKey(QCollatorSortKeyPrivate *d)-
116 : d(d)-
117{-
118}
never executed: end of block
0
119-
120-
121-
122-
123QCollatorSortKey::QCollatorSortKey(const QCollatorSortKey &other)-
124 : d(other.d)-
125{-
126}
never executed: end of block
0
127-
128-
129-
130-
131QCollatorSortKey::~QCollatorSortKey()-
132{-
133}-
134-
135-
136-
137-
138QCollatorSortKey& QCollatorSortKey::operator=(const QCollatorSortKey &other)-
139{-
140 if (this != &other
this != &otherDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
141 d = other.d;-
142 }
never executed: end of block
0
143 return
never executed: return *this;
*this;
never executed: return *this;
0
144}-
145-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9