Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | void QMimeGlobMatchResult::addMatch(const QString &mimeType, int weight, const QString &pattern) | - |
7 | { | - |
8 | | - |
9 | if (weight < m_weightTRUE | evaluated 2432 times by 21 testsEvaluated by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
| FALSE | evaluated 2582 times by 21 testsEvaluated by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
|
) | 2432-2582 |
10 | return;executed 2432 times by 21 tests: return; Executed by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
| 2432 |
11 | bool replace = weight > m_weight; | - |
12 | if (!replaceTRUE | evaluated 13 times by 1 test | FALSE | evaluated 2569 times by 21 testsEvaluated by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
|
) { | 13-2569 |
13 | | - |
14 | if (pattern.length() < m_matchingPatternLengthTRUE | never evaluated | FALSE | evaluated 13 times by 1 test |
) | 0-13 |
15 | return; never executed: return; | 0 |
16 | else if (pattern.length() > m_matchingPatternLengthTRUE | evaluated 6 times by 1 test | FALSE | evaluated 7 times by 1 test |
) { | 6-7 |
17 | | - |
18 | replace = true; | - |
19 | }executed 6 times by 1 test: end of block | 6 |
20 | }executed 13 times by 1 test: end of block | 13 |
21 | if (replaceTRUE | evaluated 2575 times by 21 testsEvaluated by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
| FALSE | evaluated 7 times by 1 test |
) { | 7-2575 |
22 | m_matchingMimeTypes.clear(); | - |
23 | | - |
24 | m_matchingPatternLength = pattern.length(); | - |
25 | m_weight = weight; | - |
26 | }executed 2575 times by 21 tests: end of block Executed by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
| 2575 |
27 | if (!m_matchingMimeTypes.contains(mimeType)TRUE | evaluated 2581 times by 21 testsEvaluated by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
| FALSE | evaluated 1 time by 1 test |
) { | 1-2581 |
28 | m_matchingMimeTypes.append(mimeType); | - |
29 | if (pattern.startsWith(QLatin1String("*."))TRUE | evaluated 2555 times by 21 testsEvaluated by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
| FALSE | evaluated 26 times by 1 test |
) | 26-2555 |
30 | m_foundSuffix = pattern.mid(2);executed 2555 times by 21 tests: m_foundSuffix = pattern.mid(2); Executed by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
| 2555 |
31 | }executed 2581 times by 21 tests: end of block Executed by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
| 2581 |
32 | }executed 2582 times by 21 tests: end of block Executed by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
| 2582 |
33 | bool QMimeGlobPattern::matchFileName(const QString &inputFilename) const | - |
34 | { | - |
35 | | - |
36 | | - |
37 | | - |
38 | const QString filename = m_caseSensitivity == Qt::CaseInsensitiveTRUE | evaluated 47409 times by 22 testsEvaluated by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGraphicsWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
| FALSE | evaluated 2811 times by 22 testsEvaluated by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGraphicsWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
|
? inputFilename.toLower() : inputFilename; | 2811-47409 |
39 | | - |
40 | const int pattern_len = m_pattern.length(); | - |
41 | if (!pattern_lenTRUE | never evaluated | FALSE | evaluated 50220 times by 22 testsEvaluated by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGraphicsWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
|
) | 0-50220 |
42 | return never executed: return false; false;never executed: return false; | 0 |
43 | const int len = filename.length(); | - |
44 | | - |
45 | const int starCount = m_pattern.count(QLatin1Char('*')); | - |
46 | | - |
47 | | - |
48 | if (m_pattern[0] == QLatin1Char('*')TRUE | evaluated 5883 times by 22 testsEvaluated by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGraphicsWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
| FALSE | evaluated 44337 times by 22 testsEvaluated by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGraphicsWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
|
&& m_pattern.indexOf(QLatin1Char('[')) == -1TRUE | evaluated 3264 times by 1 test | FALSE | evaluated 2619 times by 22 testsEvaluated by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGraphicsWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
|
&& starCount == 1TRUE | evaluated 3264 times by 1 test | FALSE | never evaluated |
) | 0-44337 |
49 | { | - |
50 | if (len + 1 < pattern_lenTRUE | evaluated 686 times by 1 test | FALSE | evaluated 2578 times by 1 test |
) returnexecuted 686 times by 1 test: return false; false;executed 686 times by 1 test: return false; | 686-2578 |
51 | | - |
52 | const QChar *c1 = m_pattern.unicode() + pattern_len - 1; | - |
53 | const QChar *c2 = filename.unicode() + len - 1; | - |
54 | int cnt = 1; | - |
55 | while (cnt < pattern_lenTRUE | evaluated 2907 times by 1 test | FALSE | evaluated 10 times by 1 test |
&& *TRUE | evaluated 339 times by 1 test | FALSE | evaluated 2568 times by 1 test |
c1-- == *c2--TRUE | evaluated 339 times by 1 test | FALSE | evaluated 2568 times by 1 test |
) | 10-2907 |
56 | ++executed 339 times by 1 test: ++cnt; cnt;executed 339 times by 1 test: ++cnt; | 339 |
57 | returnexecuted 2578 times by 1 test: return cnt == pattern_len; cnt == pattern_len;executed 2578 times by 1 test: return cnt == pattern_len; | 2578 |
58 | } | - |
59 | | - |
60 | | - |
61 | if (starCount == 1TRUE | evaluated 7857 times by 22 testsEvaluated by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGraphicsWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
| FALSE | evaluated 39099 times by 22 testsEvaluated by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGraphicsWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
|
&& m_pattern.at(pattern_len - 1) == QLatin1Char('*')TRUE | evaluated 5238 times by 22 testsEvaluated by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGraphicsWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
| FALSE | evaluated 2619 times by 22 testsEvaluated by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGraphicsWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
|
) { | 2619-39099 |
62 | if (len + 1 < pattern_lenTRUE | evaluated 112 times by 3 testsEvaluated by:- tst_QIcon
- tst_QMimeDatabase
- tst_QSystemTrayIcon
| FALSE | evaluated 5126 times by 22 testsEvaluated by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGraphicsWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
|
) returnexecuted 112 times by 3 tests: return false; Executed by:- tst_QIcon
- tst_QMimeDatabase
- tst_QSystemTrayIcon
false;executed 112 times by 3 tests: return false; Executed by:- tst_QIcon
- tst_QMimeDatabase
- tst_QSystemTrayIcon
| 112-5126 |
63 | if (m_pattern.at(0) == QLatin1Char('*')TRUE | never evaluated | FALSE | evaluated 5126 times by 22 testsEvaluated by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGraphicsWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
|
) | 0-5126 |
64 | return never executed: return filename.indexOf(m_pattern.mid(1, pattern_len - 2)) != -1; filename.indexOf(m_pattern.mid(1, pattern_len - 2)) != -1;never executed: return filename.indexOf(m_pattern.mid(1, pattern_len - 2)) != -1; | 0 |
65 | | - |
66 | const QChar *c1 = m_pattern.unicode(); | - |
67 | const QChar *c2 = filename.unicode(); | - |
68 | int cnt = 1; | - |
69 | while (cnt < pattern_lenTRUE | evaluated 5512 times by 22 testsEvaluated by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGraphicsWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
| FALSE | evaluated 20 times by 1 test |
&& *TRUE | evaluated 406 times by 9 testsEvaluated by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFiledialog
- tst_QGraphicsProxyWidget
- tst_QIcon
- tst_QMimeDatabase
- tst_languageChange
| FALSE | evaluated 5106 times by 22 testsEvaluated by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGraphicsWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
|
c1++ == *c2++TRUE | evaluated 406 times by 9 testsEvaluated by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFiledialog
- tst_QGraphicsProxyWidget
- tst_QIcon
- tst_QMimeDatabase
- tst_languageChange
| FALSE | evaluated 5106 times by 22 testsEvaluated by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGraphicsWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
|
) | 20-5512 |
70 | ++executed 406 times by 9 tests: ++cnt; Executed by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFiledialog
- tst_QGraphicsProxyWidget
- tst_QIcon
- tst_QMimeDatabase
- tst_languageChange
cnt;executed 406 times by 9 tests: ++cnt; Executed by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFiledialog
- tst_QGraphicsProxyWidget
- tst_QIcon
- tst_QMimeDatabase
- tst_languageChange
| 406 |
71 | returnexecuted 5126 times by 22 tests: return cnt == pattern_len; Executed by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGraphicsWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
cnt == pattern_len;executed 5126 times by 22 tests: return cnt == pattern_len; Executed by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGraphicsWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
| 5126 |
72 | } | - |
73 | | - |
74 | | - |
75 | if (m_pattern.indexOf(QLatin1Char('[')) == -1TRUE | evaluated 36480 times by 22 testsEvaluated by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGraphicsWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
| FALSE | evaluated 5238 times by 22 testsEvaluated by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGraphicsWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
|
&& starCount == 0TRUE | evaluated 36480 times by 22 testsEvaluated by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGraphicsWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
| FALSE | never evaluated |
&& m_pattern.indexOf(QLatin1Char('?'))TRUE | evaluated 36480 times by 22 testsEvaluated by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGraphicsWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
| FALSE | never evaluated |
) | 0-36480 |
76 | returnexecuted 36480 times by 22 tests: return (m_pattern == filename); Executed by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGraphicsWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
(m_pattern == filename);executed 36480 times by 22 tests: return (m_pattern == filename); Executed by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGraphicsWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
| 36480 |
77 | | - |
78 | | - |
79 | QRegExp rx(m_pattern, Qt::CaseSensitive, QRegExp::WildcardUnix); | - |
80 | returnexecuted 5238 times by 22 tests: return rx.exactMatch(filename); Executed by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGraphicsWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
rx.exactMatch(filename);executed 5238 times by 22 tests: return rx.exactMatch(filename); Executed by:- tst_QAccessibility
- tst_QCalendarWidget
- tst_QComboBox
- tst_QCompleter
- tst_QDateTimeEdit
- tst_QFileDialog2
- tst_QFileIconProvider
- tst_QFileSystemModel
- tst_QFiledialog
- tst_QFontComboBox
- tst_QGraphicsProxyWidget
- tst_QGraphicsWidget
- tst_QGuiApplication
- tst_QGuiVariant
- tst_QIcon
- tst_QMimeDatabase
- tst_QPrinter
- tst_QSidebar
- tst_QStyle
- tst_QSystemTrayIcon
- tst_QToolButton
- tst_languageChange
| 5238 |
81 | } | - |
82 | | - |
83 | static bool isFastPattern(const QString &pattern) | - |
84 | { | - |
85 | | - |
86 | returnexecuted 4126 times by 1 test: return pattern.lastIndexOf(QLatin1Char('*')) == 0 && pattern.lastIndexOf(QLatin1Char('.')) == 1 && !pattern.contains(QLatin1Char('?')) && !pattern.contains(QLatin1Char('[')) ; pattern.lastIndexOf(QLatin1Char('*')) == 0executed 4126 times by 1 test: return pattern.lastIndexOf(QLatin1Char('*')) == 0 && pattern.lastIndexOf(QLatin1Char('.')) == 1 && !pattern.contains(QLatin1Char('?')) && !pattern.contains(QLatin1Char('[')) ; | 4126 |
87 | && pattern.lastIndexOf(QLatin1Char('.')) == 1executed 4126 times by 1 test: return pattern.lastIndexOf(QLatin1Char('*')) == 0 && pattern.lastIndexOf(QLatin1Char('.')) == 1 && !pattern.contains(QLatin1Char('?')) && !pattern.contains(QLatin1Char('[')) ; | 4126 |
88 | | 4126 |
89 | && !pattern.contains(QLatin1Char('?'))executed 4126 times by 1 test: return pattern.lastIndexOf(QLatin1Char('*')) == 0 && pattern.lastIndexOf(QLatin1Char('.')) == 1 && !pattern.contains(QLatin1Char('?')) && !pattern.contains(QLatin1Char('[')) ; | 4126 |
90 | && !pattern.contains(QLatin1Char('['))executed 4126 times by 1 test: return pattern.lastIndexOf(QLatin1Char('*')) == 0 && pattern.lastIndexOf(QLatin1Char('.')) == 1 && !pattern.contains(QLatin1Char('?')) && !pattern.contains(QLatin1Char('[')) ; | 4126 |
91 | ;executed 4126 times by 1 test: return pattern.lastIndexOf(QLatin1Char('*')) == 0 && pattern.lastIndexOf(QLatin1Char('.')) == 1 && !pattern.contains(QLatin1Char('?')) && !pattern.contains(QLatin1Char('[')) ; | 4126 |
92 | } | - |
93 | | - |
94 | void QMimeAllGlobPatterns::addGlob(const QMimeGlobPattern &glob) | - |
95 | { | - |
96 | const QString &pattern = glob.pattern(); | - |
97 | ((!(!pattern.isEmpty())) ? qt_assert("!pattern.isEmpty()",__FILE__,160) : qt_noop()); | - |
98 | | - |
99 | | - |
100 | | - |
101 | | - |
102 | | - |
103 | if (glob.weight() == 50TRUE | evaluated 4126 times by 1 test | FALSE | evaluated 10 times by 1 test |
&& isFastPattern(pattern)TRUE | evaluated 3891 times by 1 test | FALSE | evaluated 235 times by 1 test |
&& !glob.isCaseSensitive()TRUE | evaluated 3881 times by 1 test | FALSE | evaluated 10 times by 1 test |
) { | 10-4126 |
104 | | - |
105 | const QString extension = pattern.mid(2).toLower(); | - |
106 | QStringList &patterns = m_fastPatterns[extension]; | - |
107 | if (!patterns.contains(glob.mimeType())TRUE | evaluated 3869 times by 1 test | FALSE | evaluated 12 times by 1 test |
) | 12-3869 |
108 | patterns.append(glob.mimeType());executed 3869 times by 1 test: patterns.append(glob.mimeType()); | 3869 |
109 | }executed 3881 times by 1 test: end of block else { | 3881 |
110 | if (glob.weight() > 50TRUE | never evaluated | FALSE | evaluated 255 times by 1 test |
) { | 0-255 |
111 | if (!m_highWeightGlobs.hasPattern(glob.mimeType(), glob.pattern())TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
112 | m_highWeightGlobs.append(glob); never executed: m_highWeightGlobs.append(glob); | 0 |
113 | } never executed: end of block else { | 0 |
114 | if (!m_lowWeightGlobs.hasPattern(glob.mimeType(), glob.pattern())TRUE | evaluated 255 times by 1 test | FALSE | never evaluated |
) | 0-255 |
115 | m_lowWeightGlobs.append(glob);executed 255 times by 1 test: m_lowWeightGlobs.append(glob); | 255 |
116 | }executed 255 times by 1 test: end of block | 255 |
117 | } | - |
118 | } | - |
119 | | - |
120 | void QMimeAllGlobPatterns::removeMimeType(const QString &mimeType) | - |
121 | { | - |
122 | for (auto &x : m_fastPatterns) | - |
123 | x.removeAll(mimeType); never executed: x.removeAll(mimeType); | 0 |
124 | m_highWeightGlobs.removeMimeType(mimeType); | - |
125 | m_lowWeightGlobs.removeMimeType(mimeType); | - |
126 | } never executed: end of block | 0 |
127 | | - |
128 | void QMimeGlobPatternList::match(QMimeGlobMatchResult &result, | - |
129 | const QString &fileName) const | - |
130 | { | - |
131 | | - |
132 | QMimeGlobPatternList::const_iterator it = this->constBegin(); | - |
133 | const QMimeGlobPatternList::const_iterator endIt = this->constEnd(); | - |
134 | for (; it != endItTRUE | evaluated 4896 times by 1 test | FALSE | evaluated 192 times by 1 test |
; ++it) { | 192-4896 |
135 | const QMimeGlobPattern &glob = *it; | - |
136 | if (glob.matchFileName(fileName)TRUE | evaluated 26 times by 1 test | FALSE | evaluated 4870 times by 1 test |
) | 26-4870 |
137 | result.addMatch(glob.mimeType(), glob.weight(), glob.pattern());executed 26 times by 1 test: result.addMatch(glob.mimeType(), glob.weight(), glob.pattern()); | 26 |
138 | }executed 4896 times by 1 test: end of block | 4896 |
139 | }executed 192 times by 1 test: end of block | 192 |
140 | | - |
141 | QStringList QMimeAllGlobPatterns::matchingGlobs(const QString &fileName, QString *foundSuffix) const | - |
142 | { | - |
143 | | - |
144 | QMimeGlobMatchResult result; | - |
145 | m_highWeightGlobs.match(result, fileName); | - |
146 | if (result.m_matchingMimeTypes.isEmpty()TRUE | evaluated 96 times by 1 test | FALSE | never evaluated |
) { | 0-96 |
147 | | - |
148 | | - |
149 | | - |
150 | const int lastDot = fileName.lastIndexOf(QLatin1Char('.')); | - |
151 | if (lastDot != -1TRUE | evaluated 71 times by 1 test | FALSE | evaluated 25 times by 1 test |
) { | 25-71 |
152 | const int ext_len = fileName.length() - lastDot - 1; | - |
153 | const QString simpleExtension = fileName.right(ext_len).toLower(); | - |
154 | | - |
155 | | - |
156 | const QStringList matchingMimeTypes = m_fastPatterns.value(simpleExtension); | - |
157 | const QString simplePattern = QLatin1String("*.") + simpleExtension; | - |
158 | for (const QString &mime : matchingMimeTypes) | - |
159 | result.addMatch(mime, 50, simplePattern);executed 57 times by 1 test: result.addMatch(mime, 50, simplePattern); | 57 |
160 | | - |
161 | | - |
162 | }executed 71 times by 1 test: end of block | 71 |
163 | | - |
164 | | - |
165 | m_lowWeightGlobs.match(result, fileName); | - |
166 | }executed 96 times by 1 test: end of block | 96 |
167 | if (foundSuffixTRUE | evaluated 8 times by 1 test | FALSE | evaluated 88 times by 1 test |
) | 8-88 |
168 | *executed 8 times by 1 test: *foundSuffix = result.m_foundSuffix; foundSuffix = result.m_foundSuffix;executed 8 times by 1 test: *foundSuffix = result.m_foundSuffix; | 8 |
169 | returnexecuted 96 times by 1 test: return result.m_matchingMimeTypes; result.m_matchingMimeTypes;executed 96 times by 1 test: return result.m_matchingMimeTypes; | 96 |
170 | } | - |
171 | | - |
172 | void QMimeAllGlobPatterns::clear() | - |
173 | { | - |
174 | m_fastPatterns.clear(); | - |
175 | m_highWeightGlobs.clear(); | - |
176 | m_lowWeightGlobs.clear(); | - |
177 | }executed 5 times by 1 test: end of block | 5 |
178 | | - |
179 | | - |
| | |