qmimeprovider.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/mimetypes/qmimeprovider.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6static void initResources()-
7{-
8 do { extern int qInitResources_mimetypes (); qInitResources_mimetypes (); } while (0);-
9}
executed 2 times by 2 tests: end of block
Executed by:
  • tst_QMimeDatabase
  • tst_qmimetype
2
10-
11-
12-
13static QString fallbackParent(const QString &mimeTypeName)-
14{-
15 const QString myGroup = mimeTypeName.left(mimeTypeName.indexOf(QLatin1Char('/')));-
16-
17 if (myGroup == QLatin1String("text")
myGroup == QLa...String("text")Description
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
&& mimeTypeName != QLatin1String("text/plain")
mimeTypeName !...("text/plain")Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
)
8-40
18 return
executed 8 times by 1 test: return QLatin1String("text/plain");
Executed by:
  • tst_QMimeDatabase
QLatin1String("text/plain");
executed 8 times by 1 test: return QLatin1String("text/plain");
Executed by:
  • tst_QMimeDatabase
8
19-
20 if (myGroup != QLatin1String("inode")
myGroup != QLa...tring("inode")Description
TRUEevaluated 52 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
&&
8-52
21-
22 myGroup != QLatin1String("all")
myGroup != QLa...1String("all")Description
TRUEevaluated 52 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEnever evaluated
&& myGroup != QLatin1String("fonts")
myGroup != QLa...tring("fonts")Description
TRUEevaluated 52 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEnever evaluated
&& myGroup != QLatin1String("print")
myGroup != QLa...tring("print")Description
TRUEevaluated 52 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEnever evaluated
&& myGroup != QLatin1String("uri")
myGroup != QLa...1String("uri")Description
TRUEevaluated 52 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEnever evaluated
0-52
23 && mimeTypeName != QLatin1String("application/octet-stream")
mimeTypeName !...octet-stream")Description
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
) {
16-36
24 return
executed 36 times by 1 test: return QLatin1String("application/octet-stream");
Executed by:
  • tst_QMimeDatabase
QLatin1String("application/octet-stream");
executed 36 times by 1 test: return QLatin1String("application/octet-stream");
Executed by:
  • tst_QMimeDatabase
36
25 }-
26 return
executed 24 times by 1 test: return QString();
Executed by:
  • tst_QMimeDatabase
QString();
executed 24 times by 1 test: return QString();
Executed by:
  • tst_QMimeDatabase
24
27}-
28-
29QMimeProviderBase::QMimeProviderBase(QMimeDatabasePrivate *db)-
30 : m_db(db)-
31{-
32}
executed 27 times by 24 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
  • tst_qmimetype
27
33-
34__attribute__((visibility("default"))) int qmime_secondsBetweenChecks = 5;-
35-
36bool QMimeProviderBase::shouldCheck()-
37{-
38 if (m_lastCheck.isValid()
m_lastCheck.isValid()Description
TRUEevaluated 16372 times by 23 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
FALSEevaluated 25 times by 24 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
  • tst_qmimetype
&& m_lastCheck.elapsed() < qmime_secondsBetweenChecks * 1000
m_lastCheck.el...nChecks * 1000Description
TRUEevaluated 16245 times by 23 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
FALSEevaluated 127 times by 4 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QMimeDatabase
)
25-16372
39 return
executed 16245 times by 23 tests: return false;
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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;
executed 16245 times by 23 tests: return false;
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
16245
40 m_lastCheck.start();-
41 return
executed 152 times by 24 tests: return true;
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
  • tst_qmimetype
true;
executed 152 times by 24 tests: return true;
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
  • tst_qmimetype
152
42}-
43-
44QMimeBinaryProvider::QMimeBinaryProvider(QMimeDatabasePrivate *db)-
45 : QMimeProviderBase(db), m_mimetypeListLoaded(false)-
46{-
47}
executed 25 times by 24 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
  • tst_qmimetype
25
48-
49-
50-
51-
52-
53struct QMimeBinaryProvider::CacheFile-
54{-
55 CacheFile(const QString &fileName);-
56 ~CacheFile();-
57-
58 bool isValid() const { return
executed 24 times by 23 tests: return m_valid;
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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_valid;
executed 24 times by 23 tests: return m_valid;
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
}
24
59 inline quint16 getUint16(int offset) const-
60 {-
61 return
executed 54 times by 23 tests: return qFromBigEndian(*reinterpret_cast<quint16 *>(data + offset));
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
qFromBigEndian(*reinterpret_cast<quint16 *>(data + offset));
executed 54 times by 23 tests: return qFromBigEndian(*reinterpret_cast<quint16 *>(data + offset));
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
54
62 }-
63 inline quint32 getUint32(int offset) const-
64 {-
65 return
executed 316408 times by 23 tests: return qFromBigEndian(*reinterpret_cast<quint32 *>(data + offset));
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
qFromBigEndian(*reinterpret_cast<quint32 *>(data + offset));
executed 316408 times by 23 tests: return qFromBigEndian(*reinterpret_cast<quint32 *>(data + offset));
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
316408
66 }-
67 inline const char *getCharStar(int offset) const-
68 {-
69 return
executed 143248 times by 23 tests: return reinterpret_cast<const char *>(data + offset);
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
reinterpret_cast<const char *>(data + offset);
executed 143248 times by 23 tests: return reinterpret_cast<const char *>(data + offset);
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
143248
70 }-
71 bool load();-
72 bool reload();-
73-
74 QFile file;-
75 uchar *data;-
76 QDateTime m_mtime;-
77 bool m_valid;-
78};-
79-
80QMimeBinaryProvider::CacheFile::CacheFile(const QString &fileName)-
81 : file(fileName), m_valid(false)-
82{-
83 load();-
84}
executed 24 times by 23 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
24
85-
86QMimeBinaryProvider::CacheFile::~CacheFile()-
87{-
88}-
89-
90bool QMimeBinaryProvider::CacheFile::load()-
91{-
92 if (!file.open(QIODevice::ReadOnly)
!file.open(QIO...ice::ReadOnly)Description
TRUEnever evaluated
FALSEevaluated 27 times by 23 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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-27
93 return
never executed: return false;
false;
never executed: return false;
0
94 data = file.map(0, file.size());-
95 if (data
dataDescription
TRUEevaluated 27 times by 23 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
FALSEnever evaluated
) {
0-27
96 const int major = getUint16(0);-
97 const int minor = getUint16(2);-
98 m_valid = (major == 1
major == 1Description
TRUEevaluated 27 times by 23 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
FALSEnever evaluated
&& minor >= 1
minor >= 1Description
TRUEevaluated 27 times by 23 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
FALSEnever evaluated
&& minor <= 2
minor <= 2Description
TRUEevaluated 27 times by 23 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
FALSEnever evaluated
);
0-27
99 }
executed 27 times by 23 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
27
100 m_mtime = QFileInfo(file).lastModified();-
101 return
executed 27 times by 23 tests: return m_valid;
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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_valid;
executed 27 times by 23 tests: return m_valid;
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
27
102}-
103-
104bool QMimeBinaryProvider::CacheFile::reload()-
105{-
106-
107 m_valid = false;-
108 if (file.isOpen()
file.isOpen()Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEnever evaluated
) {
0-3
109 file.close();-
110 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
3
111 data = 0;-
112 return
executed 3 times by 1 test: return load();
Executed by:
  • tst_QMimeDatabase
load();
executed 3 times by 1 test: return load();
Executed by:
  • tst_QMimeDatabase
3
113}-
114-
115QMimeBinaryProvider::CacheFile *QMimeBinaryProvider::CacheFileList::findCacheFile(const QString &fileName) const-
116{-
117 for (const_iterator it = begin(); it != end()
it != end()Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 24 times by 23 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
; ++it) {
3-24
118 if ((*
(*it)->file.fi...() == fileNameDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QMimeDatabase
it)->file.fileName() == fileName
(*it)->file.fi...() == fileNameDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QMimeDatabase
)
1-2
119 return
executed 2 times by 1 test: return *it;
Executed by:
  • tst_QMimeDatabase
*it;
executed 2 times by 1 test: return *it;
Executed by:
  • tst_QMimeDatabase
2
120 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
1
121 return
executed 24 times by 23 tests: return 0;
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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;
executed 24 times by 23 tests: return 0;
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
24
122}-
123-
124QMimeBinaryProvider::~QMimeBinaryProvider()-
125{-
126 qDeleteAll(m_cacheFiles);-
127}
executed 25 times by 25 tests: end of block
Executed by:
  • tst_QMimeDatabase
  • tst_languagechange - unknown status
  • tst_qaccessibility - unknown status
  • tst_qcalendarwidget - unknown status
  • tst_qcombobox - unknown status
  • tst_qcompleter - unknown status
  • tst_qdatetimeedit - unknown status
  • tst_qdebug - unknown status
  • tst_qfiledialog - unknown status
  • tst_qfiledialog2 - unknown status
  • tst_qfileiconprovider - unknown status
  • tst_qfilesystemmodel - unknown status
  • tst_qfontcombobox - unknown status
  • tst_qgraphicsproxywidget - unknown status
  • tst_qgraphicswidget - unknown status
  • tst_qguiapplication - unknown status
  • tst_qguivariant - unknown status
  • tst_qicon - unknown status
  • tst_qmimedatabase-cache - unknown status
  • tst_qmimetype
  • tst_qprinter - unknown status
  • tst_qsidebar - unknown status
  • tst_qstyle - unknown status
  • tst_qsystemtrayicon - unknown status
  • tst_qtoolbutton - unknown status
25
128-
129-
130enum {-
131 PosAliasListOffset = 4,-
132 PosParentListOffset = 8,-
133 PosLiteralListOffset = 12,-
134 PosReverseSuffixTreeOffset = 16,-
135 PosGlobListOffset = 20,-
136 PosMagicListOffset = 24,-
137-
138 PosIconsListOffset = 32,-
139 PosGenericIconsListOffset = 36-
140};-
141-
142bool QMimeBinaryProvider::isValid()-
143{-
144-
145 if (!qEnvironmentVariableIsEmpty("QT_NO_MIME_CACHE")
!qEnvironmentV...O_MIME_CACHE")Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 24 times by 24 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
  • tst_qmimetype
)
1-24
146 return
executed 1 time by 1 test: return false;
Executed by:
  • tst_QMimeDatabase
false;
executed 1 time by 1 test: return false;
Executed by:
  • tst_QMimeDatabase
1
147-
148 ((!(m_cacheFiles.isEmpty())) ? qt_assert("m_cacheFiles.isEmpty()",__FILE__,199) : qt_noop());-
149 checkCache();-
150-
151 if (m_cacheFiles.count() > 1
m_cacheFiles.count() > 1Description
TRUEnever evaluated
FALSEevaluated 24 times by 24 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
  • tst_qmimetype
)
0-24
152 return
never executed: return true;
true;
never executed: return true;
0
153 if (m_cacheFiles.isEmpty()
m_cacheFiles.isEmpty()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmimetype
FALSEevaluated 23 times by 23 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
)
1-23
154 return
executed 1 time by 1 test: return false;
Executed by:
  • tst_qmimetype
false;
executed 1 time by 1 test: return false;
Executed by:
  • tst_qmimetype
1
155-
156-
157 const QString foundFile = m_cacheFiles.constFirst()->file.fileName();-
158 const QString localCacheFile = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/mime/mime.cache");-
159-
160 return
executed 23 times by 23 tests: return foundFile != localCacheFile;
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
foundFile != localCacheFile;
executed 23 times by 23 tests: return foundFile != localCacheFile;
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
23
161-
162-
163-
164}-
165-
166bool QMimeBinaryProvider::CacheFileList::checkCacheChanged()-
167{-
168 bool somethingChanged = false;-
169 QMutableListIterator<CacheFile *> it(*this);-
170 while (it.hasNext()
it.hasNext()Description
TRUEevaluated 97 times by 4 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QMimeDatabase
FALSEevaluated 96 times by 24 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
  • tst_qmimetype
) {
96-97
171 CacheFile *cacheFile = it.next();-
172 QFileInfo fileInfo(cacheFile->file);-
173 if (!fileInfo.exists()
!fileInfo.exists()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 96 times by 4 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QMimeDatabase
) {
1-96
174 delete cacheFile;-
175 it.remove();-
176 somethingChanged = true;-
177 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
else if (fileInfo.lastModified() > cacheFile->m_mtime
fileInfo.lastM...eFile->m_mtimeDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 93 times by 4 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QMimeDatabase
) {
1-93
178 if (!cacheFile->reload()
!cacheFile->reload()Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
) {
0-3
179 delete cacheFile;-
180 it.remove();-
181 }
never executed: end of block
0
182 somethingChanged = true;-
183 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
3
184 }
executed 97 times by 4 tests: end of block
Executed by:
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QMimeDatabase
97
185 return
executed 96 times by 24 tests: return somethingChanged;
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
  • tst_qmimetype
somethingChanged;
executed 96 times by 24 tests: return somethingChanged;
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
  • tst_qmimetype
96
186}-
187-
188void QMimeBinaryProvider::checkCache()-
189{-
190 if (!shouldCheck()
!shouldCheck()Description
TRUEevaluated 11745 times by 23 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
FALSEevaluated 96 times by 24 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
  • tst_qmimetype
)
96-11745
191 return;
executed 11745 times by 23 tests: return;
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
11745
192-
193-
194 if (m_cacheFiles.checkCacheChanged()
m_cacheFiles.c...CacheChanged()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 92 times by 24 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
  • tst_qmimetype
)
4-92
195 m_mimetypeListLoaded = false;
executed 4 times by 1 test: m_mimetypeListLoaded = false;
Executed by:
  • tst_QMimeDatabase
4
196-
197-
198 const QStringList cacheFileNames = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QLatin1String("mime/mime.cache"));-
199 if (cacheFileNames != m_cacheFileNames
cacheFileNames...cacheFileNamesDescription
TRUEevaluated 25 times by 23 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
FALSEevaluated 71 times by 5 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QMimeDatabase
  • tst_qmimetype
) {
25-71
200 for (const QString &cacheFileName : cacheFileNames) {-
201 CacheFile *cacheFile = m_cacheFiles.findCacheFile(cacheFileName);-
202 if (!cacheFile
!cacheFileDescription
TRUEevaluated 24 times by 23 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
) {
2-24
203-
204 cacheFile = new CacheFile(cacheFileName);-
205 if (cacheFile->isValid()
cacheFile->isValid()Description
TRUEevaluated 24 times by 23 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
FALSEnever evaluated
)
0-24
206 m_cacheFiles.append(cacheFile);
executed 24 times by 23 tests: m_cacheFiles.append(cacheFile);
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
24
207 else-
208 delete cacheFile;
never executed: delete cacheFile;
0
209 }-
210 }
executed 26 times by 23 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
26
211 m_cacheFileNames = cacheFileNames;-
212 m_mimetypeListLoaded = false;-
213 }
executed 25 times by 23 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
25
214}
executed 96 times by 24 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
  • tst_qmimetype
96
215-
216static QMimeType mimeTypeForNameUnchecked(const QString &name)-
217{-
218 QMimeTypePrivate data;-
219 data.name = name;-
220-
221-
222-
223-
224 return
executed 7911 times by 23 tests: return QMimeType(data);
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
QMimeType(data);
executed 7911 times by 23 tests: return QMimeType(data);
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
7911
225}-
226-
227QMimeType QMimeBinaryProvider::mimeTypeForName(const QString &name)-
228{-
229 checkCache();-
230 if (!m_mimetypeListLoaded
!m_mimetypeListLoadedDescription
TRUEevaluated 28 times by 23 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
FALSEevaluated 4553 times by 20 tests
Evaluated 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_languageChange
)
28-4553
231 loadMimeTypeList();
executed 28 times by 23 tests: loadMimeTypeList();
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
28
232 if (!m_mimetypeNames.contains(name)
!m_mimetypeNam...contains(name)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 4573 times by 23 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
)
8-4573
233 return
executed 8 times by 1 test: return QMimeType();
Executed by:
  • tst_QMimeDatabase
QMimeType();
executed 8 times by 1 test: return QMimeType();
Executed by:
  • tst_QMimeDatabase
8
234 return
executed 4573 times by 23 tests: return mimeTypeForNameUnchecked(name);
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
mimeTypeForNameUnchecked(name);
executed 4573 times by 23 tests: return mimeTypeForNameUnchecked(name);
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
4573
235}-
236-
237QStringList QMimeBinaryProvider::findByFileName(const QString &fileName, QString *foundSuffix)-
238{-
239 checkCache();-
240 if (fileName.isEmpty()
fileName.isEmpty()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 2523 times by 22 tests
Evaluated 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
)
2-2523
241 return
executed 2 times by 1 test: return QStringList();
Executed by:
  • tst_QMimeDatabase
QStringList();
executed 2 times by 1 test: return QStringList();
Executed by:
  • tst_QMimeDatabase
2
242 const QString lowerFileName = fileName.toLower();-
243 QMimeGlobMatchResult result;-
244-
245 for (CacheFile *cacheFile : qAsConst(m_cacheFiles)) {-
246 matchGlobList(result, cacheFile, cacheFile->getUint32(PosLiteralListOffset), fileName);-
247 matchGlobList(result, cacheFile, cacheFile->getUint32(PosGlobListOffset), fileName);-
248 const int reverseSuffixTreeOffset = cacheFile->getUint32(PosReverseSuffixTreeOffset);-
249 const int numRoots = cacheFile->getUint32(reverseSuffixTreeOffset);-
250 const int firstRootOffset = cacheFile->getUint32(reverseSuffixTreeOffset + 4);-
251 matchSuffixTree(result, cacheFile, numRoots, firstRootOffset, lowerFileName, fileName.length() - 1, false);-
252 if (result.m_matchingMimeTypes.isEmpty()
result.m_match...ypes.isEmpty()Description
TRUEevaluated 34 times by 3 tests
Evaluated by:
  • tst_QGraphicsWidget
  • tst_QIcon
  • tst_QMimeDatabase
FALSEevaluated 2492 times by 21 tests
Evaluated 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
)
34-2492
253 matchSuffixTree(result, cacheFile, numRoots, firstRootOffset, fileName, fileName.length() - 1, true);
executed 34 times by 3 tests: matchSuffixTree(result, cacheFile, numRoots, firstRootOffset, fileName, fileName.length() - 1, true);
Executed by:
  • tst_QGraphicsWidget
  • tst_QIcon
  • tst_QMimeDatabase
34
254 }
executed 2526 times by 22 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_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QPrinter
  • tst_QSidebar
  • tst_QStyle
  • tst_QSystemTrayIcon
  • tst_QToolButton
  • tst_languageChange
2526
255 if (foundSuffix
foundSuffixDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 2515 times by 22 tests
Evaluated 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
)
8-2515
256 *
executed 8 times by 1 test: *foundSuffix = result.m_foundSuffix;
Executed by:
  • tst_QMimeDatabase
foundSuffix = result.m_foundSuffix;
executed 8 times by 1 test: *foundSuffix = result.m_foundSuffix;
Executed by:
  • tst_QMimeDatabase
8
257 return
executed 2523 times by 22 tests: return result.m_matchingMimeTypes;
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
result.m_matchingMimeTypes;
executed 2523 times by 22 tests: return result.m_matchingMimeTypes;
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
2523
258}-
259-
260void QMimeBinaryProvider::matchGlobList(QMimeGlobMatchResult &result, CacheFile *cacheFile, int off, const QString &fileName)-
261{-
262 const int numGlobs = cacheFile->getUint32(off);-
263-
264 for (int i = 0; i < numGlobs
i < numGlobsDescription
TRUEevaluated 45324 times by 22 tests
Evaluated 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
FALSEevaluated 5052 times by 22 tests
Evaluated 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
; ++i) {
5052-45324
265 const int globOffset = cacheFile->getUint32(off + 4 + 12 * i);-
266 const int mimeTypeOffset = cacheFile->getUint32(off + 4 + 12 * i + 4);-
267 const int flagsAndWeight = cacheFile->getUint32(off + 4 + 12 * i + 8);-
268 const int weight = flagsAndWeight & 0xff;-
269 const bool caseSensitive = flagsAndWeight & 0x100;-
270 const Qt::CaseSensitivity qtCaseSensitive = caseSensitive
caseSensitiveDescription
TRUEevaluated 2523 times by 22 tests
Evaluated 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
FALSEevaluated 42801 times by 22 tests
Evaluated 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
? Qt::CaseSensitive : Qt::CaseInsensitive;
2523-42801
271 const QString pattern = QLatin1String(cacheFile->getCharStar(globOffset));-
272-
273 const char *mimeType = cacheFile->getCharStar(mimeTypeOffset);-
274-
275 QMimeGlobPattern glob(pattern, QString() , weight, qtCaseSensitive);-
276-
277-
278 if (glob.matchFileName(fileName)
glob.matchFileName(fileName)Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 45308 times by 22 tests
Evaluated 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
)
16-45308
279 result.addMatch(QLatin1String(mimeType), weight, pattern);
executed 16 times by 1 test: result.addMatch(QLatin1String(mimeType), weight, pattern);
Executed by:
  • tst_QMimeDatabase
16
280 }
executed 45324 times by 22 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_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QPrinter
  • tst_QSidebar
  • tst_QStyle
  • tst_QSystemTrayIcon
  • tst_QToolButton
  • tst_languageChange
45324
281}
executed 5052 times by 22 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_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QPrinter
  • tst_QSidebar
  • tst_QStyle
  • tst_QSystemTrayIcon
  • tst_QToolButton
  • tst_languageChange
5052
282-
283bool QMimeBinaryProvider::matchSuffixTree(QMimeGlobMatchResult &result, QMimeBinaryProvider::CacheFile *cacheFile, int numEntries, int firstOffset, const QString &fileName, int charPos, bool caseSensitiveCheck)-
284{-
285 QChar fileChar = fileName[charPos];-
286 int min = 0;-
287 int max = numEntries - 1;-
288 while (min <= max
min <= maxDescription
TRUEevaluated 18328 times by 22 tests
Evaluated 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
FALSEevaluated 2554 times by 22 tests
Evaluated 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
) {
2554-18328
289 const int mid = (min + max) / 2;-
290 const int off = firstOffset + 12 * mid;-
291 const QChar ch = cacheFile->getUint32(off);-
292 if (ch < fileChar
ch < fileCharDescription
TRUEevaluated 7882 times by 22 tests
Evaluated 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
FALSEevaluated 10446 times by 22 tests
Evaluated 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
)
7882-10446
293 min = mid + 1;
executed 7882 times by 22 tests: min = mid + 1;
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
7882
294 else if (ch > fileChar
ch > fileCharDescription
TRUEevaluated 354 times by 3 tests
Evaluated by:
  • tst_QGraphicsWidget
  • tst_QIcon
  • tst_QMimeDatabase
FALSEevaluated 10092 times by 22 tests
Evaluated 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
)
354-10092
295 max = mid - 1;
executed 354 times by 3 tests: max = mid - 1;
Executed by:
  • tst_QGraphicsWidget
  • tst_QIcon
  • tst_QMimeDatabase
354
296 else {-
297 --charPos;-
298 int numChildren = cacheFile->getUint32(off + 4);-
299 int childrenOffset = cacheFile->getUint32(off + 8);-
300 bool success = false;-
301 if (charPos > 0
charPos > 0Description
TRUEevaluated 10086 times by 22 tests
Evaluated 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
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
)
6-10086
302 success = matchSuffixTree(result, cacheFile, numChildren, childrenOffset, fileName, charPos, caseSensitiveCheck);
executed 10086 times by 22 tests: success = matchSuffixTree(result, cacheFile, numChildren, childrenOffset, fileName, charPos, caseSensitiveCheck);
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
10086
303 if (!success
!successDescription
TRUEevaluated 2608 times by 22 tests
Evaluated 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
FALSEevaluated 7484 times by 21 tests
Evaluated 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
) {
2608-7484
304 for (int i = 0; i < numChildren
i < numChildrenDescription
TRUEevaluated 5043 times by 22 tests
Evaluated 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
FALSEevaluated 2484 times by 21 tests
Evaluated 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
; ++i) {
2484-5043
305 const int childOff = childrenOffset + 12 * i;-
306 const int mch = cacheFile->getUint32(childOff);-
307 if (mch != 0
mch != 0Description
TRUEevaluated 124 times by 3 tests
Evaluated by:
  • tst_QGraphicsWidget
  • tst_QIcon
  • tst_QMimeDatabase
FALSEevaluated 4919 times by 21 tests
Evaluated 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
)
124-4919
308 break;
executed 124 times by 3 tests: break;
Executed by:
  • tst_QGraphicsWidget
  • tst_QIcon
  • tst_QMimeDatabase
124
309 const int mimeTypeOffset = cacheFile->getUint32(childOff + 4);-
310 const char *mimeType = cacheFile->getCharStar(mimeTypeOffset);-
311 const int flagsAndWeight = cacheFile->getUint32(childOff + 8);-
312 const int weight = flagsAndWeight & 0xff;-
313 const bool caseSensitive = flagsAndWeight & 0x100;-
314 if (caseSensitiveCheck
caseSensitiveCheckDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 4915 times by 21 tests
Evaluated 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
|| !caseSensitive
!caseSensitiveDescription
TRUEevaluated 4911 times by 21 tests
Evaluated 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
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
) {
4-4915
315 result.addMatch(QLatin1String(mimeType), weight, QLatin1Char('*') + fileName.mid(charPos+1));-
316 success = true;-
317 }
executed 4915 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
4915
318 }
executed 4919 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
4919
319 }
executed 2608 times by 22 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_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QPrinter
  • tst_QSidebar
  • tst_QStyle
  • tst_QSystemTrayIcon
  • tst_QToolButton
  • tst_languageChange
2608
320 return
executed 10092 times by 22 tests: return success;
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
success;
executed 10092 times by 22 tests: return success;
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
10092
321 }-
322 }-
323 return
executed 2554 times by 22 tests: return false;
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
false;
executed 2554 times by 22 tests: return false;
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
2554
324}-
325-
326bool QMimeBinaryProvider::matchMagicRule(QMimeBinaryProvider::CacheFile *cacheFile, int numMatchlets, int firstOffset, const QByteArray &data)-
327{-
328 const char *dataPtr = data.constData();-
329 const int dataSize = data.size();-
330 for (int matchlet = 0; matchlet < numMatchlets
matchlet < numMatchletsDescription
TRUEevaluated 10116 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 5890 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
; ++matchlet) {
5890-10116
331 const int off = firstOffset + matchlet * 32;-
332 const int rangeStart = cacheFile->getUint32(off);-
333 const int rangeLength = cacheFile->getUint32(off + 4);-
334-
335 const int valueLength = cacheFile->getUint32(off + 12);-
336 const int valueOffset = cacheFile->getUint32(off + 16);-
337 const int maskOffset = cacheFile->getUint32(off + 20);-
338 const char *mask = maskOffset
maskOffsetDescription
TRUEevaluated 215 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 9901 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
? cacheFile->getCharStar(maskOffset) : __null;
215-9901
339-
340 if (!QMimeMagicRule::matchSubstring(dataPtr, dataSize, rangeStart, rangeLength, valueLength, cacheFile->getCharStar(valueOffset), mask)
!QMimeMagicRul...Offset), mask)Description
TRUEevaluated 10071 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 45 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
)
45-10071
341 continue;
executed 10071 times by 1 test: continue;
Executed by:
  • tst_QMimeDatabase
10071
342-
343 const int numChildren = cacheFile->getUint32(off + 24);-
344 const int firstChildOffset = cacheFile->getUint32(off + 28);-
345 if (numChildren == 0
numChildren == 0Description
TRUEevaluated 23 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
)
22-23
346 return
executed 23 times by 1 test: return true;
Executed by:
  • tst_QMimeDatabase
true;
executed 23 times by 1 test: return true;
Executed by:
  • tst_QMimeDatabase
23
347-
348 if (matchMagicRule(cacheFile, numChildren, firstChildOffset, data)
matchMagicRule...dOffset, data)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
)
4-18
349 return
executed 4 times by 1 test: return true;
Executed by:
  • tst_QMimeDatabase
true;
executed 4 times by 1 test: return true;
Executed by:
  • tst_QMimeDatabase
4
350 }
executed 18 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
18
351 return
executed 5890 times by 1 test: return false;
Executed by:
  • tst_QMimeDatabase
false;
executed 5890 times by 1 test: return false;
Executed by:
  • tst_QMimeDatabase
5890
352}-
353-
354QMimeType QMimeBinaryProvider::findByMagic(const QByteArray &data, int *accuracyPtr)-
355{-
356 checkCache();-
357 for (CacheFile *cacheFile : qAsConst(m_cacheFiles)) {-
358 const int magicListOffset = cacheFile->getUint32(PosMagicListOffset);-
359 const int numMatches = cacheFile->getUint32(magicListOffset);-
360-
361 const int firstMatchOffset = cacheFile->getUint32(magicListOffset + 8);-
362-
363 for (int i = 0; i < numMatches
i < numMatchesDescription
TRUEevaluated 5895 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 9 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
; ++i) {
9-5895
364 const int off = firstMatchOffset + i * 16;-
365 const int numMatchlets = cacheFile->getUint32(off + 8);-
366 const int firstMatchletOffset = cacheFile->getUint32(off + 12);-
367 if (matchMagicRule(cacheFile, numMatchlets, firstMatchletOffset, data)
matchMagicRule...tOffset, data)Description
TRUEevaluated 23 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 5872 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
) {
23-5872
368 const int mimeTypeOffset = cacheFile->getUint32(off + 4);-
369 const char *mimeType = cacheFile->getCharStar(mimeTypeOffset);-
370 *accuracyPtr = cacheFile->getUint32(off);-
371-
372-
373 return
executed 23 times by 1 test: return mimeTypeForNameUnchecked(QLatin1String(mimeType));
Executed by:
  • tst_QMimeDatabase
mimeTypeForNameUnchecked(QLatin1String(mimeType));
executed 23 times by 1 test: return mimeTypeForNameUnchecked(QLatin1String(mimeType));
Executed by:
  • tst_QMimeDatabase
23
374 }-
375 }
executed 5872 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
5872
376 }
executed 9 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
9
377 return
executed 9 times by 1 test: return QMimeType();
Executed by:
  • tst_QMimeDatabase
QMimeType();
executed 9 times by 1 test: return QMimeType();
Executed by:
  • tst_QMimeDatabase
9
378}-
379-
380QStringList QMimeBinaryProvider::parents(const QString &mime)-
381{-
382 checkCache();-
383 const QByteArray mimeStr = mime.toLatin1();-
384 QStringList result;-
385 for (CacheFile *cacheFile : qAsConst(m_cacheFiles)) {-
386 const int parentListOffset = cacheFile->getUint32(PosParentListOffset);-
387 const int numEntries = cacheFile->getUint32(parentListOffset);-
388-
389 int begin = 0;-
390 int end = numEntries - 1;-
391 while (begin <= end
begin <= endDescription
TRUEevaluated 466 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 34 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
) {
34-466
392 const int medium = (begin + end) / 2;-
393 const int off = parentListOffset + 4 + 8 * medium;-
394 const int mimeOffset = cacheFile->getUint32(off);-
395 const char *aMime = cacheFile->getCharStar(mimeOffset);-
396 const int cmp = qstrcmp(aMime, mimeStr);-
397 if (cmp < 0
cmp < 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 236 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
) {
230-236
398 begin = medium + 1;-
399 }
executed 230 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
else if (cmp > 0
cmp > 0Description
TRUEevaluated 210 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
) {
26-230
400 end = medium - 1;-
401 }
executed 210 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
else {
210
402 const int parentsOffset = cacheFile->getUint32(off + 4);-
403 const int numParents = cacheFile->getUint32(parentsOffset);-
404 for (int i = 0; i < numParents
i < numParentsDescription
TRUEevaluated 34 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
; ++i) {
26-34
405 const int parentOffset = cacheFile->getUint32(parentsOffset + 4 + 4 * i);-
406 const char *aParent = cacheFile->getCharStar(parentOffset);-
407 result.append(QString::fromLatin1(aParent));-
408 }
executed 34 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
34
409 break;
executed 26 times by 1 test: break;
Executed by:
  • tst_QMimeDatabase
26
410 }-
411 }-
412 }
executed 60 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
60
413 if (result.isEmpty()
result.isEmpty()Description
TRUEevaluated 34 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
) {
26-34
414 const QString parent = fallbackParent(mime);-
415 if (!parent.isEmpty()
!parent.isEmpty()Description
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
)
12-22
416 result.append(parent);
executed 22 times by 1 test: result.append(parent);
Executed by:
  • tst_QMimeDatabase
22
417 }
executed 34 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
34
418 return
executed 60 times by 1 test: return result;
Executed by:
  • tst_QMimeDatabase
result;
executed 60 times by 1 test: return result;
Executed by:
  • tst_QMimeDatabase
60
419}-
420-
421QString QMimeBinaryProvider::resolveAlias(const QString &name)-
422{-
423 checkCache();-
424 const QByteArray input = name.toLatin1();-
425 for (CacheFile *cacheFile : qAsConst(m_cacheFiles)) {-
426 const int aliasListOffset = cacheFile->getUint32(PosAliasListOffset);-
427 const int numEntries = cacheFile->getUint32(aliasListOffset);-
428 int begin = 0;-
429 int end = numEntries - 1;-
430 while (begin <= end
begin <= endDescription
TRUEevaluated 36002 times by 23 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
FALSEevaluated 4609 times by 23 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
) {
4609-36002
431 const int medium = (begin + end) / 2;-
432 const int off = aliasListOffset + 4 + 8 * medium;-
433 const int aliasOffset = cacheFile->getUint32(off);-
434 const char *alias = cacheFile->getCharStar(aliasOffset);-
435 const int cmp = qstrcmp(alias, input);-
436 if (cmp < 0
cmp < 0Description
TRUEevaluated 18281 times by 23 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
FALSEevaluated 17721 times by 23 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
) {
17721-18281
437 begin = medium + 1;-
438 }
executed 18281 times by 23 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
else if (cmp > 0
cmp > 0Description
TRUEevaluated 17712 times by 23 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
FALSEevaluated 9 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
) {
9-18281
439 end = medium - 1;-
440 }
executed 17712 times by 23 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
else {
17712
441 const int mimeOffset = cacheFile->getUint32(off + 4);-
442 const char *mimeType = cacheFile->getCharStar(mimeOffset);-
443 return
executed 9 times by 1 test: return QLatin1String(mimeType);
Executed by:
  • tst_QMimeDatabase
QLatin1String(mimeType);
executed 9 times by 1 test: return QLatin1String(mimeType);
Executed by:
  • tst_QMimeDatabase
9
444 }-
445 }-
446 }
executed 4609 times by 23 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
4609
447-
448 return
executed 4598 times by 23 tests: return name;
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
name;
executed 4598 times by 23 tests: return name;
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
4598
449}-
450-
451QStringList QMimeBinaryProvider::listAliases(const QString &name)-
452{-
453 checkCache();-
454 QStringList result;-
455 const QByteArray input = name.toLatin1();-
456 for (CacheFile *cacheFile : qAsConst(m_cacheFiles)) {-
457 const int aliasListOffset = cacheFile->getUint32(PosAliasListOffset);-
458 const int numEntries = cacheFile->getUint32(aliasListOffset);-
459 for (int pos = 0; pos < numEntries
pos < numEntriesDescription
TRUEevaluated 776 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
; ++pos) {
4-776
460 const int off = aliasListOffset + 4 + 8 * pos;-
461 const int mimeOffset = cacheFile->getUint32(off + 4);-
462 const char *mimeType = cacheFile->getCharStar(mimeOffset);-
463-
464 if (input == mimeType
input == mimeTypeDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 772 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
) {
4-772
465 const int aliasOffset = cacheFile->getUint32(off);-
466 const char *alias = cacheFile->getCharStar(aliasOffset);-
467 result.append(QString::fromLatin1(alias));-
468 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
4
469 }
executed 776 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
776
470 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
4
471 return
executed 4 times by 1 test: return result;
Executed by:
  • tst_QMimeDatabase
result;
executed 4 times by 1 test: return result;
Executed by:
  • tst_QMimeDatabase
4
472}-
473-
474void QMimeBinaryProvider::loadMimeTypeList()-
475{-
476 if (!m_mimetypeListLoaded
!m_mimetypeListLoadedDescription
TRUEevaluated 28 times by 23 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
) {
5-28
477 m_mimetypeListLoaded = true;-
478 m_mimetypeNames.clear();-
479-
480-
481 const QStringList typesFilenames = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QLatin1String("mime/types"));-
482 for (const QString &typeFilename : typesFilenames) {-
483 QFile file(typeFilename);-
484 if (file.open(QIODevice::ReadOnly)
file.open(QIODevice::ReadOnly)Description
TRUEevaluated 31 times by 23 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
FALSEnever evaluated
) {
0-31
485 while (!file.atEnd()
!file.atEnd()Description
TRUEevaluated 19818 times by 23 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
FALSEevaluated 31 times by 23 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
) {
31-19818
486 QByteArray line = file.readLine();-
487 line.chop(1);-
488 m_mimetypeNames.insert(QString::fromLatin1(line.constData(), line.size()));-
489 }
executed 19818 times by 23 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
19818
490 }
executed 31 times by 23 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
31
491 }
executed 31 times by 23 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
31
492 }
executed 28 times by 23 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
28
493}
executed 33 times by 23 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • 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
33
494-
495QList<QMimeType> QMimeBinaryProvider::allMimeTypes()-
496{-
497 QList<QMimeType> result;-
498 loadMimeTypeList();-
499 result.reserve(m_mimetypeNames.count());-
500-
501 for (QSet<QString>::const_iterator it = m_mimetypeNames.constBegin();-
502 it != m_mimetypeNames.constEnd()
it != m_mimety...mes.constEnd()Description
TRUEevaluated 3315 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
; ++it)
5-3315
503 result.append(mimeTypeForNameUnchecked(*it));
executed 3315 times by 1 test: result.append(mimeTypeForNameUnchecked(*it));
Executed by:
  • tst_QMimeDatabase
3315
504-
505 return
executed 5 times by 1 test: return result;
Executed by:
  • tst_QMimeDatabase
result;
executed 5 times by 1 test: return result;
Executed by:
  • tst_QMimeDatabase
5
506}-
507-
508void QMimeBinaryProvider::loadMimeTypePrivate(QMimeTypePrivate &data)-
509{-
510-
511-
512-
513-
514 if (data.loaded
data.loadedDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 2447 times by 22 tests
Evaluated 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
)
10-2447
515 return;
executed 10 times by 1 test: return;
Executed by:
  • tst_QMimeDatabase
10
516 data.loaded = true;-
517-
518-
519 const QString file = data.name + QLatin1String(".xml");-
520-
521 QStringList mimeFiles = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QString::fromLatin1("mime/") + file.toLower());-
522 if (mimeFiles.isEmpty()
mimeFiles.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 2447 times by 22 tests
Evaluated 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-2447
523 mimeFiles = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QString::fromLatin1("mime/") + file);-
524 }
never executed: end of block
0
525 if (mimeFiles.isEmpty()
mimeFiles.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 2447 times by 22 tests
Evaluated 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-2447
526 QMessageLogger(__FILE__, 577, __PRETTY_FUNCTION__).warning() << "No file found for" << file << ", even though update-mime-info said it would exist.\n"-
527 "Either it was just removed, or the directory doesn't have executable permission..."-
528 << QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QLatin1String("mime"), QStandardPaths::LocateDirectory);-
529 return;
never executed: return;
0
530 }-
531-
532 QString mainPattern;-
533-
534 for (QStringList::const_reverse_iterator it = mimeFiles.crbegin(), end = mimeFiles.crend(); it != end
it != endDescription
TRUEevaluated 2447 times by 22 tests
Evaluated 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
FALSEevaluated 2447 times by 22 tests
Evaluated 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
; ++it) {
2447
535 QFile qfile(*it);-
536 if (!qfile.open(QFile::ReadOnly)
!qfile.open(QFile::ReadOnly)Description
TRUEnever evaluated
FALSEevaluated 2447 times by 22 tests
Evaluated 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-2447
537 continue;
never executed: continue;
0
538-
539 QXmlStreamReader xml(&qfile);-
540 if (xml.readNextStartElement()
xml.readNextStartElement()Description
TRUEevaluated 2447 times by 22 tests
Evaluated 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
FALSEnever evaluated
) {
0-2447
541 if (xml.name() != QLatin1String("mime-type")
xml.name() != ...g("mime-type")Description
TRUEnever evaluated
FALSEevaluated 2447 times by 22 tests
Evaluated 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-2447
542 continue;
never executed: continue;
0
543 }-
544 const QStringRef name = xml.attributes().value(QLatin1String("type"));-
545 if (name.isEmpty()
name.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 2447 times by 22 tests
Evaluated 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-2447
546 continue;
never executed: continue;
0
547 if (name.compare(data.name, Qt::CaseInsensitive)
name.compare(d...seInsensitive)Description
TRUEnever evaluated
FALSEevaluated 2447 times by 22 tests
Evaluated 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-2447
548 QMessageLogger(__FILE__, 599, __PRETTY_FUNCTION__).warning() << "Got name" << name << "in file" << file << "expected" << data.name;
never executed: QMessageLogger(__FILE__, 599, __PRETTY_FUNCTION__).warning() << "Got name" << name << "in file" << file << "expected" << data.name;
0
549-
550 while (xml.readNextStartElement()
xml.readNextStartElement()Description
TRUEevaluated 117409 times by 22 tests
Evaluated 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
FALSEevaluated 2447 times by 22 tests
Evaluated 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
) {
2447-117409
551 const QStringRef tag = xml.name();-
552 if (tag == QLatin1String("comment")
tag == QLatin1...ing("comment")Description
TRUEevaluated 114909 times by 22 tests
Evaluated 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
FALSEevaluated 2500 times by 22 tests
Evaluated 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
) {
2500-114909
553 QString lang = xml.attributes().value(QLatin1String("xml:lang")).toString();-
554 const QString text = xml.readElementText();-
555 if (lang.isEmpty()
lang.isEmpty()Description
TRUEevaluated 2447 times by 22 tests
Evaluated 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
FALSEevaluated 112462 times by 22 tests
Evaluated 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
) {
2447-112462
556 lang = QLatin1String("en_US");-
557 }
executed 2447 times by 22 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_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QPrinter
  • tst_QSidebar
  • tst_QStyle
  • tst_QSystemTrayIcon
  • tst_QToolButton
  • tst_languageChange
2447
558 data.localeComments.insert(lang, text);-
559 continue;
executed 114909 times by 22 tests: continue;
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
114909
560 } else if (tag == QLatin1String("icon")
tag == QLatin1String("icon")Description
TRUEnever evaluated
FALSEevaluated 2500 times by 22 tests
Evaluated 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-2500
561 data.iconName = xml.attributes().value(QLatin1String("name")).toString();-
562 }
never executed: end of block
else if (tag == QLatin1String("glob-deleteall")
tag == QLatin1...ob-deleteall")Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 2499 times by 22 tests
Evaluated 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-2499
563 data.globPatterns.clear();-
564 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
else if (tag == QLatin1String("glob")
tag == QLatin1String("glob")Description
TRUEevaluated 2463 times by 22 tests
Evaluated 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
FALSEevaluated 36 times by 2 tests
Evaluated by:
  • tst_QIcon
  • tst_QMimeDatabase
) {
1-2463
565 const QString pattern = xml.attributes().value(QLatin1String("pattern")).toString();-
566 if (mainPattern.isEmpty()
mainPattern.isEmpty()Description
TRUEevaluated 2443 times by 22 tests
Evaluated 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
FALSEevaluated 20 times by 2 tests
Evaluated by:
  • tst_QIcon
  • tst_QMimeDatabase
&& pattern.startsWith(QLatin1Char('*'))
pattern.starts...tin1Char('*'))Description
TRUEevaluated 2442 times by 22 tests
Evaluated 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
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QMimeDatabase
) {
1-2443
567 mainPattern = pattern;-
568 }
executed 2442 times by 22 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_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QPrinter
  • tst_QSidebar
  • tst_QStyle
  • tst_QSystemTrayIcon
  • tst_QToolButton
  • tst_languageChange
2442
569 if (!data.globPatterns.contains(pattern)
!data.globPatt...tains(pattern)Description
TRUEevaluated 2463 times by 22 tests
Evaluated 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
FALSEnever evaluated
)
0-2463
570 data.globPatterns.append(pattern);
executed 2463 times by 22 tests: data.globPatterns.append(pattern);
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
2463
571 }
executed 2463 times by 22 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_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QPrinter
  • tst_QSidebar
  • tst_QStyle
  • tst_QSystemTrayIcon
  • tst_QToolButton
  • tst_languageChange
2463
572 xml.skipCurrentElement();-
573 }
executed 2500 times by 22 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_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QPrinter
  • tst_QSidebar
  • tst_QStyle
  • tst_QSystemTrayIcon
  • tst_QToolButton
  • tst_languageChange
2500
574 ((!(xml.name() == QLatin1String("mime-type"))) ? qt_assert("xml.name() == QLatin1String(\"mime-type\")",__FILE__,625) : qt_noop());-
575 }
executed 2447 times by 22 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_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QPrinter
  • tst_QSidebar
  • tst_QStyle
  • tst_QSystemTrayIcon
  • tst_QToolButton
  • tst_languageChange
2447
576 }
executed 2447 times by 22 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_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QPrinter
  • tst_QSidebar
  • tst_QStyle
  • tst_QSystemTrayIcon
  • tst_QToolButton
  • tst_languageChange
2447
577-
578-
579-
580-
581 if (!mainPattern.isEmpty()
!mainPattern.isEmpty()Description
TRUEevaluated 2442 times by 22 tests
Evaluated 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
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
&& (data.globPatterns.isEmpty()
data.globPatterns.isEmpty()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 2441 times by 22 tests
Evaluated 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
|| data.globPatterns.constFirst() != mainPattern
data.globPatte...!= mainPatternDescription
TRUEnever evaluated
FALSEevaluated 2441 times by 22 tests
Evaluated 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-2442
582-
583 data.globPatterns.removeAll(mainPattern);-
584 data.globPatterns.prepend(mainPattern);-
585 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
1
586}
executed 2447 times by 22 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_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QPrinter
  • tst_QSidebar
  • tst_QStyle
  • tst_QSystemTrayIcon
  • tst_QToolButton
  • tst_languageChange
2447
587-
588-
589QString QMimeBinaryProvider::iconForMime(CacheFile *cacheFile, int posListOffset, const QByteArray &inputMime)-
590{-
591 const int iconsListOffset = cacheFile->getUint32(posListOffset);-
592 const int numIcons = cacheFile->getUint32(iconsListOffset);-
593 int begin = 0;-
594 int end = numIcons - 1;-
595 while (begin <= end
begin <= endDescription
TRUEevaluated 34 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
) {
6-34
596 const int medium = (begin + end) / 2;-
597 const int off = iconsListOffset + 4 + 8 * medium;-
598 const int mimeOffset = cacheFile->getUint32(off);-
599 const char *mime = cacheFile->getCharStar(mimeOffset);-
600 const int cmp = qstrcmp(mime, inputMime);-
601 if (cmp < 0
cmp < 0Description
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
)
16-18
602 begin = medium + 1;
executed 18 times by 1 test: begin = medium + 1;
Executed by:
  • tst_QMimeDatabase
18
603 else if (cmp > 0
cmp > 0Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
)
2-14
604 end = medium - 1;
executed 14 times by 1 test: end = medium - 1;
Executed by:
  • tst_QMimeDatabase
14
605 else {-
606 const int iconOffset = cacheFile->getUint32(off + 4);-
607 return
executed 2 times by 1 test: return QLatin1String(cacheFile->getCharStar(iconOffset));
Executed by:
  • tst_QMimeDatabase
QLatin1String(cacheFile->getCharStar(iconOffset));
executed 2 times by 1 test: return QLatin1String(cacheFile->getCharStar(iconOffset));
Executed by:
  • tst_QMimeDatabase
2
608 }-
609 }-
610 return
executed 6 times by 1 test: return QString();
Executed by:
  • tst_QMimeDatabase
QString();
executed 6 times by 1 test: return QString();
Executed by:
  • tst_QMimeDatabase
6
611}-
612-
613void QMimeBinaryProvider::loadIcon(QMimeTypePrivate &data)-
614{-
615 checkCache();-
616 const QByteArray inputMime = data.name.toLatin1();-
617 for (CacheFile *cacheFile : qAsConst(m_cacheFiles)) {-
618 const QString icon = iconForMime(cacheFile, PosIconsListOffset, inputMime);-
619 if (!icon.isEmpty()
!icon.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
) {
0-4
620 data.iconName = icon;-
621 return;
never executed: return;
0
622 }-
623 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
4
624}
executed 4 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
4
625-
626void QMimeBinaryProvider::loadGenericIcon(QMimeTypePrivate &data)-
627{-
628 checkCache();-
629 const QByteArray inputMime = data.name.toLatin1();-
630 for (CacheFile *cacheFile : qAsConst(m_cacheFiles)) {-
631 const QString icon = iconForMime(cacheFile, PosGenericIconsListOffset, inputMime);-
632 if (!icon.isEmpty()
!icon.isEmpty()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
) {
2
633 data.genericIconName = icon;-
634 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_QMimeDatabase
2
635 }-
636 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
2
637}
executed 2 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
2
638-
639-
640-
641QMimeXMLProvider::QMimeXMLProvider(QMimeDatabasePrivate *db)-
642 : QMimeProviderBase(db), m_loaded(false)-
643{-
644 initResources();-
645}
executed 2 times by 2 tests: end of block
Executed by:
  • tst_QMimeDatabase
  • tst_qmimetype
2
646-
647QMimeXMLProvider::~QMimeXMLProvider()-
648{-
649}-
650-
651bool QMimeXMLProvider::isValid()-
652{-
653 return
never executed: return true;
true;
never executed: return true;
0
654}-
655-
656QMimeType QMimeXMLProvider::mimeTypeForName(const QString &name)-
657{-
658 ensureLoaded();-
659-
660 return
executed 2183 times by 1 test: return m_nameMimeTypeMap.value(name);
Executed by:
  • tst_QMimeDatabase
m_nameMimeTypeMap.value(name);
executed 2183 times by 1 test: return m_nameMimeTypeMap.value(name);
Executed by:
  • tst_QMimeDatabase
2183
661}-
662-
663QStringList QMimeXMLProvider::findByFileName(const QString &fileName, QString *foundSuffix)-
664{-
665 ensureLoaded();-
666-
667 const QStringList matchingMimeTypes = m_mimeTypeGlobs.matchingGlobs(fileName, foundSuffix);-
668 return
executed 96 times by 1 test: return matchingMimeTypes;
Executed by:
  • tst_QMimeDatabase
matchingMimeTypes;
executed 96 times by 1 test: return matchingMimeTypes;
Executed by:
  • tst_QMimeDatabase
96
669}-
670-
671QMimeType QMimeXMLProvider::findByMagic(const QByteArray &data, int *accuracyPtr)-
672{-
673 ensureLoaded();-
674-
675 QString candidate;-
676-
677 for (const QMimeMagicRuleMatcher &matcher : qAsConst(m_magicMatchers)) {-
678 if (matcher.matches(data)
matcher.matches(data)Description
TRUEevaluated 37 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 11003 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
) {
37-11003
679 const int priority = matcher.priority();-
680 if (priority > *accuracyPtr
priority > *accuracyPtrDescription
TRUEevaluated 23 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
) {
14-23
681 *accuracyPtr = priority;-
682 candidate = matcher.mimetype();-
683 }
executed 23 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
23
684 }
executed 37 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
37
685 }
executed 11040 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
11040
686 return
executed 32 times by 1 test: return mimeTypeForName(candidate);
Executed by:
  • tst_QMimeDatabase
mimeTypeForName(candidate);
executed 32 times by 1 test: return mimeTypeForName(candidate);
Executed by:
  • tst_QMimeDatabase
32
687}-
688-
689void QMimeXMLProvider::ensureLoaded()-
690{-
691 if (!m_loaded
!m_loadedDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 4556 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
|| shouldCheck()
shouldCheck()Description
TRUEevaluated 56 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 4500 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
) {
1-4556
692 bool fdoXmlFound = false;-
693 QStringList allFiles;-
694-
695 const QStringList packageDirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QLatin1String("mime/packages"), QStandardPaths::LocateDirectory);-
696-
697 for (const QString &packageDir : packageDirs) {-
698 QDir dir(packageDir);-
699 const QStringList files = dir.entryList(QDir::Files | QDir::NoDotAndDotDot);-
700-
701 if (!fdoXmlFound
!fdoXmlFoundDescription
TRUEevaluated 88 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEnever evaluated
)
0-88
702 fdoXmlFound = files.contains(QLatin1String("freedesktop.org.xml"));
executed 88 times by 1 test: fdoXmlFound = files.contains(QLatin1String("freedesktop.org.xml"));
Executed by:
  • tst_QMimeDatabase
88
703 QStringList::const_iterator endIt(files.constEnd());-
704 for (QStringList::const_iterator it(files.constBegin()); it != endIt
it != endItDescription
TRUEevaluated 261 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 88 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
; ++it) {
88-261
705 allFiles.append(packageDir + QLatin1Char('/') + *it);-
706 }
executed 261 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
261
707 }
executed 88 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
88
708-
709 if (!fdoXmlFound
!fdoXmlFoundDescription
TRUEnever evaluated
FALSEevaluated 57 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
) {
0-57
710-
711 allFiles.prepend(QLatin1String(":/qt-project.org/qmime/freedesktop.org.xml"));-
712 }
never executed: end of block
0
713-
714 if (m_allFiles == allFiles
m_allFiles == allFilesDescription
TRUEevaluated 52 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
)
5-52
715 return;
executed 52 times by 1 test: return;
Executed by:
  • tst_QMimeDatabase
52
716 m_allFiles = allFiles;-
717-
718 m_nameMimeTypeMap.clear();-
719 m_aliases.clear();-
720 m_parents.clear();-
721 m_mimeTypeGlobs.clear();-
722 m_magicMatchers.clear();-
723-
724-
725-
726 for (const QString &file : qAsConst(allFiles))-
727 load(file);
executed 17 times by 1 test: load(file);
Executed by:
  • tst_QMimeDatabase
17
728 }
executed 5 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
5
729}
executed 4505 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
4505
730-
731void QMimeXMLProvider::load(const QString &fileName)-
732{-
733 QString errorMessage;-
734 if (!load(fileName, &errorMessage)
!load(fileName, &errorMessage)Description
TRUEnever evaluated
FALSEevaluated 17 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
)
0-17
735 QMessageLogger(__FILE__, 801, __PRETTY_FUNCTION__).warning("QMimeDatabase: Error loading %s\n%s", QString(fileName).toLocal8Bit().constData(), QString(errorMessage).toLocal8Bit().constData());
never executed: QMessageLogger(__FILE__, 801, __PRETTY_FUNCTION__).warning("QMimeDatabase: Error loading %s\n%s", QString(fileName).toLocal8Bit().constData(), QString(errorMessage).toLocal8Bit().constData());
0
736}
executed 17 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
17
737-
738bool QMimeXMLProvider::load(const QString &fileName, QString *errorMessage)-
739{-
740 m_loaded = true;-
741-
742 QFile file(fileName);-
743 if (!file.open(QIODevice::ReadOnly | QIODevice::Text)
!file.open(QIO...ODevice::Text)Description
TRUEnever evaluated
FALSEevaluated 17 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
) {
0-17
744 if (errorMessage
errorMessageDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
745 *
never executed: *errorMessage = QString::fromLatin1("Cannot open %1: %2").arg(fileName, file.errorString());
errorMessage = QString::fromLatin1("Cannot open %1: %2").arg(fileName, file.errorString());
never executed: *errorMessage = QString::fromLatin1("Cannot open %1: %2").arg(fileName, file.errorString());
0
746 return
never executed: return false;
false;
never executed: return false;
0
747 }-
748-
749 if (errorMessage
errorMessageDescription
TRUEevaluated 17 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEnever evaluated
)
0-17
750 errorMessage->clear();
executed 17 times by 1 test: errorMessage->clear();
Executed by:
  • tst_QMimeDatabase
17
751-
752 QMimeTypeParser parser(*this);-
753 return
executed 17 times by 1 test: return parser.parse(&file, fileName, errorMessage);
Executed by:
  • tst_QMimeDatabase
parser.parse(&file, fileName, errorMessage);
executed 17 times by 1 test: return parser.parse(&file, fileName, errorMessage);
Executed by:
  • tst_QMimeDatabase
17
754}-
755-
756void QMimeXMLProvider::addGlobPattern(const QMimeGlobPattern &glob)-
757{-
758 m_mimeTypeGlobs.addGlob(glob);-
759}
executed 4136 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
4136
760-
761void QMimeXMLProvider::addMimeType(const QMimeType &mt)-
762{-
763 m_nameMimeTypeMap.insert(mt.name(), mt);-
764}
executed 3319 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
3319
765-
766QStringList QMimeXMLProvider::parents(const QString &mime)-
767{-
768 ensureLoaded();-
769 QStringList result = m_parents.value(mime);-
770 if (result.isEmpty()
result.isEmpty()Description
TRUEevaluated 34 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
) {
26-34
771 const QString parent = fallbackParent(mime);-
772 if (!parent.isEmpty()
!parent.isEmpty()Description
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_QMimeDatabase
)
12-22
773 result.append(parent);
executed 22 times by 1 test: result.append(parent);
Executed by:
  • tst_QMimeDatabase
22
774 }
executed 34 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
34
775 return
executed 60 times by 1 test: return result;
Executed by:
  • tst_QMimeDatabase
result;
executed 60 times by 1 test: return result;
Executed by:
  • tst_QMimeDatabase
60
776}-
777-
778void QMimeXMLProvider::addParent(const QString &child, const QString &parent)-
779{-
780 m_parents[child].append(parent);-
781}
executed 1560 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
1560
782-
783QStringList QMimeXMLProvider::listAliases(const QString &name)-
784{-
785 ensureLoaded();-
786-
787 return
executed 4 times by 1 test: return m_aliases.keys(name);
Executed by:
  • tst_QMimeDatabase
m_aliases.keys(name);
executed 4 times by 1 test: return m_aliases.keys(name);
Executed by:
  • tst_QMimeDatabase
4
788}-
789-
790QString QMimeXMLProvider::resolveAlias(const QString &name)-
791{-
792 ensureLoaded();-
793 return
executed 2177 times by 1 test: return m_aliases.value(name, name);
Executed by:
  • tst_QMimeDatabase
m_aliases.value(name, name);
executed 2177 times by 1 test: return m_aliases.value(name, name);
Executed by:
  • tst_QMimeDatabase
2177
794}-
795-
796void QMimeXMLProvider::addAlias(const QString &alias, const QString &name)-
797{-
798 m_aliases.insert(alias, name);-
799}
executed 975 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
975
800-
801QList<QMimeType> QMimeXMLProvider::allMimeTypes()-
802{-
803 ensureLoaded();-
804 return
executed 5 times by 1 test: return m_nameMimeTypeMap.values();
Executed by:
  • tst_QMimeDatabase
m_nameMimeTypeMap.values();
executed 5 times by 1 test: return m_nameMimeTypeMap.values();
Executed by:
  • tst_QMimeDatabase
5
805}-
806-
807void QMimeXMLProvider::addMagicMatcher(const QMimeMagicRuleMatcher &matcher)-
808{-
809 m_magicMatchers.append(matcher);-
810}
executed 1733 times by 1 test: end of block
Executed by:
  • tst_QMimeDatabase
1733
811-
812-
Switch to Source codePreprocessed file

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