qfileinfo.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/io/qfileinfo.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtCore module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#include "qplatformdefs.h"-
41#include "qfileinfo.h"-
42#include "qglobal.h"-
43#include "qdir.h"-
44#include "qfileinfo_p.h"-
45-
46QT_BEGIN_NAMESPACE-
47-
48QString QFileInfoPrivate::getFileName(QAbstractFileEngine::FileName name) const-
49{-
50 if (cache_enabled && !fileNames[(int)name].isNull())
cache_enabledDescription
TRUEevaluated 42573 times by 168 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QCssParser
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDataStream
  • tst_QDateTimeEdit
  • ...
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFileInfo
!fileNames[(int)name].isNull()Description
TRUEevaluated 3182 times by 32 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QItemModel
  • tst_QMimeDatabase
  • tst_QPrinter
  • tst_QSidebar
  • tst_QSslCertificate
  • ...
FALSEevaluated 39391 times by 168 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QCssParser
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDataStream
  • tst_QDateTimeEdit
  • ...
1-42573
51 return fileNames[(int)name];
executed 3182 times by 32 tests: return fileNames[(int)name];
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QItemModel
  • tst_QMimeDatabase
  • tst_QPrinter
  • tst_QSidebar
  • tst_QSslCertificate
  • ...
3182
52-
53 QString ret;-
54 if (fileEngine == 0) { // local file; use the QFileSystemEngine directly
fileEngine == 0Description
TRUEevaluated 35988 times by 168 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QCssParser
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDataStream
  • tst_QDateTimeEdit
  • ...
FALSEevaluated 3404 times by 37 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGroupBox
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QLineEdit
  • tst_QMdiSubWindow
  • tst_QMessageBox
  • tst_QMimeDatabase
  • ...
3404-35988
55 switch (name) {-
56 case QAbstractFileEngine::CanonicalName:
executed 24371 times by 143 tests: case QAbstractFileEngine::CanonicalName:
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDirIterator
  • ...
24371
57 case QAbstractFileEngine::CanonicalPathName: {
executed 1 time by 1 test: case QAbstractFileEngine::CanonicalPathName:
Executed by:
  • tst_QFileInfo
1
58 QFileSystemEntry entry = QFileSystemEngine::canonicalName(fileEntry, metaData);-
59 if (cache_enabled) { // be smart and store both
cache_enabledDescription
TRUEevaluated 24372 times by 143 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDirIterator
  • ...
FALSEnever evaluated
0-24372
60 fileNames[QAbstractFileEngine::CanonicalName] = entry.filePath();-
61 fileNames[QAbstractFileEngine::CanonicalPathName] = entry.path();-
62 }
executed 24372 times by 143 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDirIterator
  • ...
24372
63 if (name == QAbstractFileEngine::CanonicalName)
name == QAbstr...:CanonicalNameDescription
TRUEevaluated 24371 times by 143 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDirIterator
  • ...
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFileInfo
1-24371
64 ret = entry.filePath();
executed 24371 times by 143 tests: ret = entry.filePath();
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDirIterator
  • ...
24371
65 else-
66 ret = entry.path();
executed 1 time by 1 test: ret = entry.path();
Executed by:
  • tst_QFileInfo
1
67 break;
executed 24372 times by 143 tests: break;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDirIterator
  • ...
24372
68 }-
69 case QAbstractFileEngine::LinkName:
executed 403 times by 10 tests: case QAbstractFileEngine::LinkName:
Executed by:
  • tst_QApplication
  • tst_QDirModel
  • tst_QFile
  • tst_QFileInfo
  • tst_QGuiApplication
  • tst_QItemModel
  • tst_QSaveFile
  • tst_qapplication - unknown status
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
403
70 ret = QFileSystemEngine::getLinkTarget(fileEntry, metaData).filePath();-
71 break;
executed 403 times by 10 tests: break;
Executed by:
  • tst_QApplication
  • tst_QDirModel
  • tst_QFile
  • tst_QFileInfo
  • tst_QGuiApplication
  • tst_QItemModel
  • tst_QSaveFile
  • tst_qapplication - unknown status
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
403
72 case QAbstractFileEngine::BundleName:
executed 2 times by 1 test: case QAbstractFileEngine::BundleName:
Executed by:
  • tst_QFileInfo
2
73 ret = QFileSystemEngine::bundleName(fileEntry);-
74 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_QFileInfo
2
75 case QAbstractFileEngine::AbsoluteName:
executed 9629 times by 54 tests: case QAbstractFileEngine::AbsoluteName:
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QIcon
  • tst_QImageReader
  • ...
9629
76 case QAbstractFileEngine::AbsolutePathName: {
executed 1582 times by 31 tests: case QAbstractFileEngine::AbsolutePathName:
Executed by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QDir
  • tst_QDirIterator
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QLocalSocket
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QObject
  • tst_QProcess
  • tst_QSettings
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QTemporaryDir
  • tst_QTemporaryFile
  • tst_QTextBrowser
  • tst_QTextStream
  • tst_QTranslator
  • tst_QUuid
  • ...
1582
77 QFileSystemEntry entry = QFileSystemEngine::absoluteName(fileEntry);-
78 if (cache_enabled) { // be smart and store both
cache_enabledDescription
TRUEevaluated 11210 times by 70 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QCalendarWidget
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFactoryLoader
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • ...
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFileInfo
1-11210
79 fileNames[QAbstractFileEngine::AbsoluteName] = entry.filePath();-
80 fileNames[QAbstractFileEngine::AbsolutePathName] = entry.path();-
81 }
executed 11210 times by 70 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QCalendarWidget
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFactoryLoader
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • ...
11210
82 if (name == QAbstractFileEngine::AbsoluteName)
name == QAbstr...::AbsoluteNameDescription
TRUEevaluated 9629 times by 54 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QIcon
  • tst_QImageReader
  • ...
FALSEevaluated 1582 times by 31 tests
Evaluated by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QDir
  • tst_QDirIterator
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QLocalSocket
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QObject
  • tst_QProcess
  • tst_QSettings
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QTemporaryDir
  • tst_QTemporaryFile
  • tst_QTextBrowser
  • tst_QTextStream
  • tst_QTranslator
  • tst_QUuid
  • ...
1582-9629
83 ret = entry.filePath();
executed 9629 times by 54 tests: ret = entry.filePath();
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QIcon
  • tst_QImageReader
  • ...
9629
84 else-
85 ret = entry.path();
executed 1582 times by 31 tests: ret = entry.path();
Executed by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QDir
  • tst_QDirIterator
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QLocalSocket
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QObject
  • tst_QProcess
  • tst_QSettings
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QTemporaryDir
  • tst_QTemporaryFile
  • tst_QTextBrowser
  • tst_QTextStream
  • tst_QTranslator
  • tst_QUuid
  • ...
1582
86 break;
executed 11211 times by 70 tests: break;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QCalendarWidget
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFactoryLoader
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • ...
11211
87 }-
88 default: break;
never executed: break;
never executed: default:
0
89 }-
90 } else {-
91 ret = fileEngine->fileName(name);-
92 }
executed 3404 times by 37 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGroupBox
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QLineEdit
  • tst_QMdiSubWindow
  • tst_QMessageBox
  • tst_QMimeDatabase
  • ...
3404
93 if (ret.isNull())
ret.isNull()Description
TRUEevaluated 647 times by 6 tests
Evaluated by:
  • tst_QFileInfo
  • tst_QSslCertificate
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QStorageInfo
  • tst_qmakelib
FALSEevaluated 38745 times by 168 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QCssParser
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDataStream
  • tst_QDateTimeEdit
  • ...
647-38745
94 ret = QLatin1String("");
executed 647 times by 6 tests: ret = QLatin1String("");
Executed by:
  • tst_QFileInfo
  • tst_QSslCertificate
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QStorageInfo
  • tst_qmakelib
647
95 if (cache_enabled)
cache_enabledDescription
TRUEevaluated 39391 times by 168 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QCssParser
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDataStream
  • tst_QDateTimeEdit
  • ...
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFileInfo
1-39391
96 fileNames[(int)name] = ret;
executed 39391 times by 168 tests: fileNames[(int)name] = ret;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QCssParser
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDataStream
  • tst_QDateTimeEdit
  • ...
39391
97 return ret;
executed 39392 times by 168 tests: return ret;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QCssParser
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDataStream
  • tst_QDateTimeEdit
  • ...
39392
98}-
99-
100QString QFileInfoPrivate::getFileOwner(QAbstractFileEngine::FileOwner own) const-
101{-
102 if (cache_enabled && !fileOwners[(int)own].isNull())
cache_enabledDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QFileInfo
FALSEnever evaluated
!fileOwners[(int)own].isNull()Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QFileInfo
0-2
103 return fileOwners[(int)own];
never executed: return fileOwners[(int)own];
0
104 QString ret;-
105 if (fileEngine == 0) {
fileEngine == 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QFileInfo
FALSEnever evaluated
0-2
106 switch (own) {-
107 case QAbstractFileEngine::OwnerUser:
executed 1 time by 1 test: case QAbstractFileEngine::OwnerUser:
Executed by:
  • tst_QFileInfo
1
108 ret = QFileSystemEngine::resolveUserName(fileEntry, metaData);-
109 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QFileInfo
1
110 case QAbstractFileEngine::OwnerGroup:
executed 1 time by 1 test: case QAbstractFileEngine::OwnerGroup:
Executed by:
  • tst_QFileInfo
1
111 ret = QFileSystemEngine::resolveGroupName(fileEntry, metaData);-
112 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QFileInfo
1
113 }-
114 } else {
executed 2 times by 1 test: end of block
Executed by:
  • tst_QFileInfo
2
115 ret = fileEngine->owner(own);-
116 }
never executed: end of block
0
117 if (ret.isNull())
ret.isNull()Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QFileInfo
0-2
118 ret = QLatin1String("");
never executed: ret = QLatin1String("");
0
119 if (cache_enabled)
cache_enabledDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QFileInfo
FALSEnever evaluated
0-2
120 fileOwners[(int)own] = ret;
executed 2 times by 1 test: fileOwners[(int)own] = ret;
Executed by:
  • tst_QFileInfo
2
121 return ret;
executed 2 times by 1 test: return ret;
Executed by:
  • tst_QFileInfo
2
122}-
123-
124uint QFileInfoPrivate::getFileFlags(QAbstractFileEngine::FileFlags request) const-
125{-
126 Q_ASSERT(fileEngine); // should never be called when using the native FS-
127 // We split the testing into tests for for LinkType, BundleType, PermsMask-
128 // and the rest.-
129 // Tests for file permissions on Windows can be slow, expecially on network-
130 // paths and NTFS drives.-
131 // In order to determine if a file is a symlink or not, we have to lstat().-
132 // If we're not interested in that information, we might as well avoid one-
133 // extra syscall. Bundle detecton on Mac can be slow, expecially on network-
134 // paths, so we separate out that as well.-
135-
136 QAbstractFileEngine::FileFlags req = 0;-
137 uint cachedFlags = 0;-
138-
139 if (request & (QAbstractFileEngine::FlagsMask | QAbstractFileEngine::TypesMask)) {
request & (QAb...ne::TypesMask)Description
TRUEevaluated 10733 times by 79 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDnsLookup_Appless
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSelector
  • tst_QFileSystemModel
  • tst_QFiledialog
  • ...
FALSEevaluated 222 times by 4 tests
Evaluated by:
  • tst_QFileInfo
  • tst_QKeySequence
  • tst_QResourceEngine
  • tst_QTranslator
222-10733
140 if (!getCachedFlag(CachedFileFlags)) {
!getCachedFlag...chedFileFlags)Description
TRUEevaluated 8670 times by 79 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDnsLookup_Appless
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSelector
  • tst_QFileSystemModel
  • tst_QFiledialog
  • ...
FALSEevaluated 2063 times by 7 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QDir
  • tst_QDirIterator
  • tst_QFileInfo
  • tst_QResourceEngine
  • tst_QVariant
  • tst_rcc
2063-8670
141 req |= QAbstractFileEngine::FlagsMask;-
142 req |= QAbstractFileEngine::TypesMask;-
143 req &= (~QAbstractFileEngine::LinkType);-
144 req &= (~QAbstractFileEngine::BundleType);-
145-
146 cachedFlags |= CachedFileFlags;-
147 }
executed 8670 times by 79 tests: end of block
Executed by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDnsLookup_Appless
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSelector
  • tst_QFileSystemModel
  • tst_QFiledialog
  • ...
8670
148-
149 if (request & QAbstractFileEngine::LinkType) {
request & QAbs...gine::LinkTypeDescription
TRUEevaluated 81 times by 3 tests
Evaluated by:
  • tst_QDirIterator
  • tst_QFileInfo
  • tst_rcc
FALSEevaluated 10652 times by 79 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDnsLookup_Appless
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSelector
  • tst_QFileSystemModel
  • tst_QFiledialog
  • ...
81-10652
150 if (!getCachedFlag(CachedLinkTypeFlag)) {
!getCachedFlag...dLinkTypeFlag)Description
TRUEevaluated 81 times by 3 tests
Evaluated by:
  • tst_QDirIterator
  • tst_QFileInfo
  • tst_rcc
FALSEnever evaluated
0-81
151 req |= QAbstractFileEngine::LinkType;-
152 cachedFlags |= CachedLinkTypeFlag;-
153 }
executed 81 times by 3 tests: end of block
Executed by:
  • tst_QDirIterator
  • tst_QFileInfo
  • tst_rcc
81
154 }
executed 81 times by 3 tests: end of block
Executed by:
  • tst_QDirIterator
  • tst_QFileInfo
  • tst_rcc
81
155-
156 if (request & QAbstractFileEngine::BundleType) {
request & QAbs...ne::BundleTypeDescription
TRUEnever evaluated
FALSEevaluated 10733 times by 79 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDnsLookup_Appless
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSelector
  • tst_QFileSystemModel
  • tst_QFiledialog
  • ...
0-10733
157 if (!getCachedFlag(CachedBundleTypeFlag)) {
!getCachedFlag...undleTypeFlag)Description
TRUEnever evaluated
FALSEnever evaluated
0
158 req |= QAbstractFileEngine::BundleType;-
159 cachedFlags |= CachedBundleTypeFlag;-
160 }
never executed: end of block
0
161 }
never executed: end of block
0
162 }
executed 10733 times by 79 tests: end of block
Executed by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDnsLookup_Appless
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSelector
  • tst_QFileSystemModel
  • tst_QFiledialog
  • ...
10733
163-
164 if (request & QAbstractFileEngine::PermsMask) {
request & QAbs...ine::PermsMaskDescription
TRUEevaluated 222 times by 4 tests
Evaluated by:
  • tst_QFileInfo
  • tst_QKeySequence
  • tst_QResourceEngine
  • tst_QTranslator
FALSEevaluated 10733 times by 79 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDnsLookup_Appless
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSelector
  • tst_QFileSystemModel
  • tst_QFiledialog
  • ...
222-10733
165 if (!getCachedFlag(CachedPerms)) {
!getCachedFlag(CachedPerms)Description
TRUEevaluated 80 times by 4 tests
Evaluated by:
  • tst_QFileInfo
  • tst_QKeySequence
  • tst_QResourceEngine
  • tst_QTranslator
FALSEevaluated 142 times by 1 test
Evaluated by:
  • tst_QResourceEngine
80-142
166 req |= QAbstractFileEngine::PermsMask;-
167 cachedFlags |= CachedPerms;-
168 }
executed 80 times by 4 tests: end of block
Executed by:
  • tst_QFileInfo
  • tst_QKeySequence
  • tst_QResourceEngine
  • tst_QTranslator
80
169 }
executed 222 times by 4 tests: end of block
Executed by:
  • tst_QFileInfo
  • tst_QKeySequence
  • tst_QResourceEngine
  • tst_QTranslator
222
170-
171 if (req) {
reqDescription
TRUEevaluated 8831 times by 79 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDnsLookup_Appless
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSelector
  • tst_QFileSystemModel
  • tst_QFiledialog
  • ...
FALSEevaluated 2124 times by 7 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QDir
  • tst_QDirIterator
  • tst_QFileInfo
  • tst_QResourceEngine
  • tst_QVariant
  • tst_rcc
2124-8831
172 if (cache_enabled)
cache_enabledDescription
TRUEevaluated 8830 times by 79 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDnsLookup_Appless
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSelector
  • tst_QFileSystemModel
  • tst_QFiledialog
  • ...
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QResourceEngine
1-8830
173 req &= (~QAbstractFileEngine::Refresh);
executed 8830 times by 79 tests: req &= (~QAbstractFileEngine::Refresh);
Executed by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDnsLookup_Appless
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSelector
  • tst_QFileSystemModel
  • tst_QFiledialog
  • ...
8830
174 else-
175 req |= QAbstractFileEngine::Refresh;
executed 1 time by 1 test: req |= QAbstractFileEngine::Refresh;
Executed by:
  • tst_QResourceEngine
1
176-
177 QAbstractFileEngine::FileFlags flags = fileEngine->fileFlags(req);-
178 fileFlags |= uint(flags);-
179 setCachedFlag(cachedFlags);-
180 }
executed 8831 times by 79 tests: end of block
Executed by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDnsLookup_Appless
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSelector
  • tst_QFileSystemModel
  • tst_QFiledialog
  • ...
8831
181-
182 return fileFlags & request;
executed 10955 times by 79 tests: return fileFlags & request;
Executed by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDnsLookup_Appless
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSelector
  • tst_QFileSystemModel
  • tst_QFiledialog
  • ...
10955
183}-
184-
185QDateTime &QFileInfoPrivate::getFileTime(QAbstractFileEngine::FileTime request) const-
186{-
187 Q_ASSERT(fileEngine); // should never be called when using the native FS-
188 if (fileTimes.size() != 3)
fileTimes.size() != 3Description
TRUEevaluated 998 times by 29 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGroupBox
  • tst_QIcon
  • tst_QLineEdit
  • tst_QMdiSubWindow
  • tst_QMessageBox
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QPrinter
  • tst_QSettings
  • tst_QSidebar
  • tst_QStyle
  • tst_QStyleSheetStyle
  • tst_QTextBrowser
  • ...
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QIcon
1-998
189 fileTimes.resize(3);
executed 998 times by 29 tests: fileTimes.resize(3);
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGroupBox
  • tst_QIcon
  • tst_QLineEdit
  • tst_QMdiSubWindow
  • tst_QMessageBox
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QPrinter
  • tst_QSettings
  • tst_QSidebar
  • tst_QStyle
  • tst_QStyleSheetStyle
  • tst_QTextBrowser
  • ...
998
190 if (!cache_enabled)
!cache_enabledDescription
TRUEnever evaluated
FALSEevaluated 999 times by 29 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGroupBox
  • tst_QIcon
  • tst_QLineEdit
  • tst_QMdiSubWindow
  • tst_QMessageBox
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QPrinter
  • tst_QSettings
  • tst_QSidebar
  • tst_QStyle
  • tst_QStyleSheetStyle
  • tst_QTextBrowser
  • ...
0-999
191 clearFlags();
never executed: clearFlags();
0
192 uint cf;-
193 if (request == QAbstractFileEngine::CreationTime)
request == QAb...::CreationTimeDescription
TRUEnever evaluated
FALSEevaluated 999 times by 29 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGroupBox
  • tst_QIcon
  • tst_QLineEdit
  • tst_QMdiSubWindow
  • tst_QMessageBox
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QPrinter
  • tst_QSettings
  • tst_QSidebar
  • tst_QStyle
  • tst_QStyleSheetStyle
  • tst_QTextBrowser
  • ...
0-999
194 cf = CachedCTime;
never executed: cf = CachedCTime;
0
195 else if (request == QAbstractFileEngine::ModificationTime)
request == QAb...dificationTimeDescription
TRUEevaluated 999 times by 29 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGroupBox
  • tst_QIcon
  • tst_QLineEdit
  • tst_QMdiSubWindow
  • tst_QMessageBox
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QPrinter
  • tst_QSettings
  • tst_QSidebar
  • tst_QStyle
  • tst_QStyleSheetStyle
  • tst_QTextBrowser
  • ...
FALSEnever evaluated
0-999
196 cf = CachedMTime;
executed 999 times by 29 tests: cf = CachedMTime;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGroupBox
  • tst_QIcon
  • tst_QLineEdit
  • tst_QMdiSubWindow
  • tst_QMessageBox
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QPrinter
  • tst_QSettings
  • tst_QSidebar
  • tst_QStyle
  • tst_QStyleSheetStyle
  • tst_QTextBrowser
  • ...
999
197 else-
198 cf = CachedATime;
never executed: cf = CachedATime;
0
199 if (!getCachedFlag(cf)) {
!getCachedFlag(cf)Description
TRUEevaluated 998 times by 29 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGroupBox
  • tst_QIcon
  • tst_QLineEdit
  • tst_QMdiSubWindow
  • tst_QMessageBox
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QPrinter
  • tst_QSettings
  • tst_QSidebar
  • tst_QStyle
  • tst_QStyleSheetStyle
  • tst_QTextBrowser
  • ...
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QIcon
1-998
200 fileTimes[request] = fileEngine->fileTime(request);-
201 setCachedFlag(cf);-
202 }
executed 998 times by 29 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGroupBox
  • tst_QIcon
  • tst_QLineEdit
  • tst_QMdiSubWindow
  • tst_QMessageBox
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QPrinter
  • tst_QSettings
  • tst_QSidebar
  • tst_QStyle
  • tst_QStyleSheetStyle
  • tst_QTextBrowser
  • ...
998
203 return fileTimes[request];
executed 999 times by 29 tests: return fileTimes[request];
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGroupBox
  • tst_QIcon
  • tst_QLineEdit
  • tst_QMdiSubWindow
  • tst_QMessageBox
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QPrinter
  • tst_QSettings
  • tst_QSidebar
  • tst_QStyle
  • tst_QStyleSheetStyle
  • tst_QTextBrowser
  • ...
999
204}-
205-
206//************* QFileInfo-
207-
208/*!-
209 \class QFileInfo-
210 \inmodule QtCore-
211 \reentrant-
212 \brief The QFileInfo class provides system-independent file information.-
213-
214 \ingroup io-
215 \ingroup shared-
216-
217 QFileInfo provides information about a file's name and position-
218 (path) in the file system, its access rights and whether it is a-
219 directory or symbolic link, etc. The file's size and last-
220 modified/read times are also available. QFileInfo can also be-
221 used to obtain information about a Qt \l{resource-
222 system}{resource}.-
223-
224 A QFileInfo can point to a file with either a relative or an-
225 absolute file path. Absolute file paths begin with the directory-
226 separator "/" (or with a drive specification on Windows). Relative-
227 file names begin with a directory name or a file name and specify-
228 a path relative to the current working directory. An example of an-
229 absolute path is the string "/tmp/quartz". A relative path might-
230 look like "src/fatlib". You can use the function isRelative() to-
231 check whether a QFileInfo is using a relative or an absolute file-
232 path. You can call the function makeAbsolute() to convert a-
233 relative QFileInfo's path to an absolute path.-
234-
235 The file that the QFileInfo works on is set in the constructor or-
236 later with setFile(). Use exists() to see if the file exists and-
237 size() to get its size.-
238-
239 The file's type is obtained with isFile(), isDir() and-
240 isSymLink(). The symLinkTarget() function provides the name of the file-
241 the symlink points to.-
242-
243 On Unix (including \macos and iOS), the symlink has the same size() has-
244 the file it points to, because Unix handles symlinks-
245 transparently; similarly, opening a symlink using QFile-
246 effectively opens the link's target. For example:-
247-
248 \snippet code/src_corelib_io_qfileinfo.cpp 0-
249-
250 On Windows, symlinks (shortcuts) are \c .lnk files. The reported-
251 size() is that of the symlink (not the link's target), and-
252 opening a symlink using QFile opens the \c .lnk file. For-
253 example:-
254-
255 \snippet code/src_corelib_io_qfileinfo.cpp 1-
256-
257 Elements of the file's name can be extracted with path() and-
258 fileName(). The fileName()'s parts can be extracted with-
259 baseName(), suffix() or completeSuffix(). QFileInfo objects to-
260 directories created by Qt classes will not have a trailing file-
261 separator. If you wish to use trailing separators in your own file-
262 info objects, just append one to the file name given to the constructors-
263 or setFile().-
264-
265 The file's dates are returned by created(), lastModified() and-
266 lastRead(). Information about the file's access permissions is-
267 obtained with isReadable(), isWritable() and isExecutable(). The-
268 file's ownership is available from owner(), ownerId(), group() and-
269 groupId(). You can examine a file's permissions and ownership in a-
270 single statement using the permission() function.-
271-
272 \target NTFS permissions-
273 \note On NTFS file systems, ownership and permissions checking is-
274 disabled by default for performance reasons. To enable it,-
275 include the following line:-
276-
277 \snippet ntfsp.cpp 0-
278-
279 Permission checking is then turned on and off by incrementing and-
280 decrementing \c qt_ntfs_permission_lookup by 1.-
281-
282 \snippet ntfsp.cpp 1-
283-
284 \section1 Performance Issues-
285-
286 Some of QFileInfo's functions query the file system, but for-
287 performance reasons, some functions only operate on the-
288 file name itself. For example: To return the absolute path of-
289 a relative file name, absolutePath() has to query the file system.-
290 The path() function, however, can work on the file name directly,-
291 and so it is faster.-
292-
293 \note To speed up performance, QFileInfo caches information about-
294 the file.-
295-
296 Because files can be changed by other users or programs, or-
297 even by other parts of the same program, there is a function that-
298 refreshes the file information: refresh(). If you want to switch-
299 off a QFileInfo's caching and force it to access the file system-
300 every time you request information from it call setCaching(false).-
301-
302 \sa QDir, QFile-
303*/-
304-
305/*!-
306 \fn QFileInfo &QFileInfo::operator=(QFileInfo &&other)-
307-
308 Move-assigns \a other to this QFileInfo instance.-
309-
310 \since 5.2-
311*/-
312-
313/*!-
314 \internal-
315*/-
316QFileInfo::QFileInfo(QFileInfoPrivate *p) : d_ptr(p)-
317{-
318}
executed 110212 times by 189 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QCssParser
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • ...
110212
319-
320/*!-
321 Constructs an empty QFileInfo object.-
322-
323 Note that an empty QFileInfo object contain no file reference.-
324-
325 \sa setFile()-
326*/-
327QFileInfo::QFileInfo() : d_ptr(new QFileInfoPrivate())-
328{-
329}
executed 38000 times by 173 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • ...
38000
330-
331/*!-
332 Constructs a new QFileInfo that gives information about the given-
333 file. The \a file can also include an absolute or relative path.-
334-
335 \sa setFile(), isRelative(), QDir::setCurrent(), QDir::isRelativePath()-
336*/-
337QFileInfo::QFileInfo(const QString &file) : d_ptr(new QFileInfoPrivate(file))-
338{-
339}
executed 96060 times by 290 tests: end of block
Executed by:
  • tst_Gestures
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QCheckBox
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QColumnView
  • ...
96060
340-
341/*!-
342 Constructs a new QFileInfo that gives information about file \a-
343 file.-
344-
345 If the \a file has a relative path, the QFileInfo will also have a-
346 relative path.-
347-
348 \sa isRelative()-
349*/-
350QFileInfo::QFileInfo(const QFile &file) : d_ptr(new QFileInfoPrivate(file.fileName()))-
351{-
352}
executed 240 times by 29 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QImageReader
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QProcess
  • tst_QSidebar
  • tst_QStyle
  • ...
240
353-
354/*!-
355 Constructs a new QFileInfo that gives information about the given-
356 \a file in the directory \a dir.-
357-
358 If \a dir has a relative path, the QFileInfo will also have a-
359 relative path.-
360-
361 If \a file is an absolute path, then the directory specified-
362 by \a dir will be disregarded.-
363-
364 \sa isRelative()-
365*/-
366QFileInfo::QFileInfo(const QDir &dir, const QString &file)-
367 : d_ptr(new QFileInfoPrivate(dir.filePath(file)))-
368{-
369}
executed 260 times by 7 tests: end of block
Executed by:
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QUrl
  • tst_languageChange
  • tst_rcc
260
370-
371/*!-
372 Constructs a new QFileInfo that is a copy of the given \a fileinfo.-
373*/-
374QFileInfo::QFileInfo(const QFileInfo &fileinfo)-
375 : d_ptr(fileinfo.d_ptr)-
376{-
377-
378}
executed 125956 times by 154 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • ...
125956
379-
380/*!-
381 Destroys the QFileInfo and frees its resources.-
382*/-
383-
384QFileInfo::~QFileInfo()-
385{-
386}-
387-
388/*!-
389 \fn bool QFileInfo::operator!=(const QFileInfo &fileinfo) const-
390-
391 Returns \c true if this QFileInfo object refers to a different file-
392 than the one specified by \a fileinfo; otherwise returns \c false.-
393-
394 \sa operator==()-
395*/-
396-
397/*!-
398 Returns \c true if this QFileInfo object refers to a file in the same-
399 location as \a fileinfo; otherwise returns \c false.-
400-
401 Note that the result of comparing two empty QFileInfo objects,-
402 containing no file references (file paths that do not exist or-
403 are empty), is undefined.-
404-
405 \warning This will not compare two different symbolic links-
406 pointing to the same file.-
407-
408 \warning Long and short file names that refer to the same file on Windows-
409 are treated as if they referred to different files.-
410-
411 \sa operator!=()-
412*/-
413bool QFileInfo::operator==(const QFileInfo &fileinfo) const-
414{-
415 Q_D(const QFileInfo);-
416 // ### Qt 5: understand long and short file names on Windows-
417 // ### (GetFullPathName()).-
418 if (fileinfo.d_ptr == d_ptr)
fileinfo.d_ptr == d_ptrDescription
TRUEevaluated 2729 times by 7 tests
Evaluated by:
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QPrinter
  • tst_languageChange
FALSEevaluated 690 times by 9 tests
Evaluated by:
  • tst_QCompleter
  • tst_QDirIterator
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QPrinter
  • tst_languageChange
690-2729
419 return true;
executed 2729 times by 7 tests: return true;
Executed by:
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QPrinter
  • tst_languageChange
2729
420 if (d->isDefaultConstructed || fileinfo.d_ptr->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QFileInfo
FALSEevaluated 688 times by 9 tests
Evaluated by:
  • tst_QCompleter
  • tst_QDirIterator
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QPrinter
  • tst_languageChange
fileinfo.d_ptr...ultConstructedDescription
TRUEnever evaluated
FALSEevaluated 688 times by 9 tests
Evaluated by:
  • tst_QCompleter
  • tst_QDirIterator
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QPrinter
  • tst_languageChange
0-688
421 return false;
executed 2 times by 1 test: return false;
Executed by:
  • tst_QFileInfo
2
422-
423 // Assume files are the same if path is the same-
424 if (d->fileEntry.filePath() == fileinfo.d_ptr->fileEntry.filePath())
d->fileEntry.f...try.filePath()Description
TRUEevaluated 642 times by 9 tests
Evaluated by:
  • tst_QCompleter
  • tst_QDirIterator
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QPrinter
  • tst_languageChange
FALSEevaluated 46 times by 5 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_languageChange
46-642
425 return true;
executed 642 times by 9 tests: return true;
Executed by:
  • tst_QCompleter
  • tst_QDirIterator
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QPrinter
  • tst_languageChange
642
426-
427 Qt::CaseSensitivity sensitive;-
428 if (d->fileEngine == 0 || fileinfo.d_ptr->fileEngine == 0) {
d->fileEngine == 0Description
TRUEevaluated 46 times by 5 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_languageChange
FALSEnever evaluated
fileinfo.d_ptr...ileEngine == 0Description
TRUEnever evaluated
FALSEnever evaluated
0-46
429 if (d->fileEngine != fileinfo.d_ptr->fileEngine) // one is native, the other is a custom file-engine
d->fileEngine ...tr->fileEngineDescription
TRUEnever evaluated
FALSEevaluated 46 times by 5 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_languageChange
0-46
430 return false;
never executed: return false;
0
431-
432 sensitive = QFileSystemEngine::isCaseSensitive() ? Qt::CaseSensitive : Qt::CaseInsensitive;
QFileSystemEng...aseSensitive()Description
TRUEevaluated 46 times by 5 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_languageChange
FALSEnever evaluated
0-46
433 } else {
executed 46 times by 5 tests: end of block
Executed by:
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_languageChange
46
434 if (d->fileEngine->caseSensitive() != fileinfo.d_ptr->fileEngine->caseSensitive())
d->fileEngine-...aseSensitive()Description
TRUEnever evaluated
FALSEnever evaluated
0
435 return false;
never executed: return false;
0
436 sensitive = d->fileEngine->caseSensitive() ? Qt::CaseSensitive : Qt::CaseInsensitive;
d->fileEngine->caseSensitive()Description
TRUEnever evaluated
FALSEnever evaluated
0
437 }
never executed: end of block
0
438-
439 // Fallback to expensive canonical path computation-
440 return canonicalFilePath().compare(fileinfo.canonicalFilePath(), sensitive) == 0;
executed 46 times by 5 tests: return canonicalFilePath().compare(fileinfo.canonicalFilePath(), sensitive) == 0;
Executed by:
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_languageChange
46
441}-
442-
443/*!-
444 Makes a copy of the given \a fileinfo and assigns it to this QFileInfo.-
445*/-
446QFileInfo &QFileInfo::operator=(const QFileInfo &fileinfo)-
447{-
448 d_ptr = fileinfo.d_ptr;-
449 return *this;
executed 131904 times by 169 tests: return *this;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • ...
131904
450}-
451-
452/*!-
453 \fn void QFileInfo::swap(QFileInfo &other)-
454 \since 5.0-
455-
456 Swaps this file info with \a other. This function is very fast and-
457 never fails.-
458*/-
459-
460/*!-
461 Sets the file that the QFileInfo provides information about to \a-
462 file.-
463-
464 The \a file can also include an absolute or relative file path.-
465 Absolute paths begin with the directory separator (e.g. "/" under-
466 Unix) or a drive specification (under Windows). Relative file-
467 names begin with a directory name or a file name and specify a-
468 path relative to the current directory.-
469-
470 Example:-
471 \snippet code/src_corelib_io_qfileinfo.cpp 2-
472-
473 \sa isRelative(), QDir::setCurrent(), QDir::isRelativePath()-
474*/-
475void QFileInfo::setFile(const QString &file)-
476{-
477 bool caching = d_ptr.constData()->cache_enabled;-
478 *this = QFileInfo(file);-
479 d_ptr->cache_enabled = caching;-
480}
executed 1740 times by 25 tests: end of block
Executed by:
  • tst_QAbstractFileEngine
  • tst_QApplication
  • tst_QChar
  • tst_QDir
  • tst_QDirIterator
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGlyphRun
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QKeySequence
  • tst_QLocalSocket
  • tst_QMimeDatabase
  • tst_QPluginLoader
  • tst_QRawFont
  • tst_QResourceEngine
  • tst_QSaveFile
  • tst_QTranslator
  • tst_QVariant
  • tst_qdbuscpp2xml
  • tst_qstandardpaths
  • tst_rcc
  • tst_selftests - unknown status
1740
481-
482/*!-
483 \overload-
484-
485 Sets the file that the QFileInfo provides information about to \a-
486 file.-
487-
488 If \a file includes a relative path, the QFileInfo will also have-
489 a relative path.-
490-
491 \sa isRelative()-
492*/-
493void QFileInfo::setFile(const QFile &file)-
494{-
495 setFile(file.fileName());-
496}
executed 1 time by 1 test: end of block
Executed by:
  • tst_QFileInfo
1
497-
498/*!-
499 \overload-
500-
501 Sets the file that the QFileInfo provides information about to \a-
502 file in directory \a dir.-
503-
504 If \a file includes a relative path, the QFileInfo will also-
505 have a relative path.-
506-
507 \sa isRelative()-
508*/-
509void QFileInfo::setFile(const QDir &dir, const QString &file)-
510{-
511 setFile(dir.filePath(file));-
512}
executed 740 times by 2 tests: end of block
Executed by:
  • tst_QFileInfo
  • tst_selftests - unknown status
740
513-
514/*!-
515 Returns an absolute path including the file name.-
516-
517 The absolute path name consists of the full path and the file-
518 name. On Unix this will always begin with the root, '/',-
519 directory. On Windows this will always begin 'D:/' where D is a-
520 drive letter, except for network shares that are not mapped to a-
521 drive letter, in which case the path will begin '//sharename/'.-
522 QFileInfo will uppercase drive letters. Note that QDir does not do-
523 this. The code snippet below shows this.-
524-
525 \snippet code/src_corelib_io_qfileinfo.cpp newstuff-
526-
527 This function returns the same as filePath(), unless isRelative()-
528 is true. In contrast to canonicalFilePath(), symbolic links or-
529 redundant "." or ".." elements are not necessarily removed.-
530-
531 \warning If filePath() is empty the behavior of this function-
532 is undefined.-
533-
534 \sa filePath(), canonicalFilePath(), isRelative()-
535*/-
536QString QFileInfo::absoluteFilePath() const-
537{-
538 Q_D(const QFileInfo);-
539 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEnever evaluated
FALSEevaluated 16039 times by 65 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • ...
0-16039
540 return QLatin1String("");
never executed: return QLatin1String("");
0
541 return d->getFileName(QAbstractFileEngine::AbsoluteName);
executed 16039 times by 65 tests: return d->getFileName(QAbstractFileEngine::AbsoluteName);
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • ...
16039
542}-
543-
544/*!-
545 Returns the canonical path including the file name, i.e. an absolute-
546 path without symbolic links or redundant "." or ".." elements.-
547-
548 If the file does not exist, canonicalFilePath() returns an empty-
549 string.-
550-
551 \sa filePath(), absoluteFilePath(), dir()-
552*/-
553QString QFileInfo::canonicalFilePath() const-
554{-
555 Q_D(const QFileInfo);-
556 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEnever evaluated
FALSEevaluated 24539 times by 143 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDirIterator
  • ...
0-24539
557 return QLatin1String("");
never executed: return QLatin1String("");
0
558 return d->getFileName(QAbstractFileEngine::CanonicalName);
executed 24539 times by 143 tests: return d->getFileName(QAbstractFileEngine::CanonicalName);
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDirIterator
  • ...
24539
559}-
560-
561-
562/*!-
563 Returns a file's path absolute path. This doesn't include the-
564 file name.-
565-
566 On Unix the absolute path will always begin with the root, '/',-
567 directory. On Windows this will always begin 'D:/' where D is a-
568 drive letter, except for network shares that are not mapped to a-
569 drive letter, in which case the path will begin '//sharename/'.-
570-
571 In contrast to canonicalPath() symbolic links or redundant "." or-
572 ".." elements are not necessarily removed.-
573-
574 \warning If filePath() is empty the behavior of this function-
575 is undefined.-
576-
577 \sa absoluteFilePath(), path(), canonicalPath(), fileName(), isRelative()-
578*/-
579QString QFileInfo::absolutePath() const-
580{-
581 Q_D(const QFileInfo);-
582-
583 if (d->isDefaultConstructed) {
d->isDefaultConstructedDescription
TRUEnever evaluated
FALSEevaluated 1590 times by 32 tests
Evaluated by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QDir
  • tst_QDirIterator
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QLocalSocket
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QObject
  • tst_QProcess
  • tst_QSettings
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QTemporaryDir
  • tst_QTemporaryFile
  • tst_QTextBrowser
  • tst_QTextStream
  • tst_QTranslator
  • tst_QUuid
  • ...
0-1590
584 return QLatin1String("");
never executed: return QLatin1String("");
0
585 } else if (d->fileEntry.isEmpty()) {
d->fileEntry.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 1590 times by 32 tests
Evaluated by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QDir
  • tst_QDirIterator
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QLocalSocket
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QObject
  • tst_QProcess
  • tst_QSettings
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QTemporaryDir
  • tst_QTemporaryFile
  • tst_QTextBrowser
  • tst_QTextStream
  • tst_QTranslator
  • tst_QUuid
  • ...
0-1590
586 qWarning("QFileInfo::absolutePath: Constructed with empty filename");-
587 return QLatin1String("");
never executed: return QLatin1String("");
0
588 }-
589 return d->getFileName(QAbstractFileEngine::AbsolutePathName);
executed 1590 times by 32 tests: return d->getFileName(QAbstractFileEngine::AbsolutePathName);
Executed by:
  • tst_QApplication
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QDir
  • tst_QDirIterator
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QLocalSocket
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QObject
  • tst_QProcess
  • tst_QSettings
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QTemporaryDir
  • tst_QTemporaryFile
  • tst_QTextBrowser
  • tst_QTextStream
  • tst_QTranslator
  • tst_QUuid
  • ...
1590
590}-
591-
592/*!-
593 Returns the file's path canonical path (excluding the file name),-
594 i.e. an absolute path without symbolic links or redundant "." or ".." elements.-
595-
596 If the file does not exist, canonicalPath() returns an empty string.-
597-
598 \sa path(), absolutePath()-
599*/-
600QString QFileInfo::canonicalPath() const-
601{-
602 Q_D(const QFileInfo);-
603 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFileInfo
0-1
604 return QLatin1String("");
never executed: return QLatin1String("");
0
605 return d->getFileName(QAbstractFileEngine::CanonicalPathName);
executed 1 time by 1 test: return d->getFileName(QAbstractFileEngine::CanonicalPathName);
Executed by:
  • tst_QFileInfo
1
606}-
607-
608/*!-
609 Returns the file's path. This doesn't include the file name.-
610-
611 Note that, if this QFileInfo object is given a path ending in a-
612 slash, the name of the file is considered empty and this function-
613 will return the entire path.-
614-
615 \sa filePath(), absolutePath(), canonicalPath(), dir(), fileName(), isRelative()-
616*/-
617QString QFileInfo::path() const-
618{-
619 Q_D(const QFileInfo);-
620 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEnever evaluated
FALSEevaluated 2186 times by 40 tests
Evaluated by:
  • tst_QApplication
  • tst_QChar
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QFile
  • tst_QFileInfo
  • tst_QFileSelector
  • tst_QFontDialog
  • tst_QGlobal
  • tst_QGlyphRun
  • tst_QGraphicsScene
  • tst_QGuiApplication
  • tst_QIcon
  • tst_QImageReader
  • tst_QLocalSocket
  • tst_QMimeDatabase
  • tst_QNetworkConfigurationManager
  • tst_QPluginLoader
  • tst_QRawFont
  • tst_QSql
  • tst_QTemporaryFile
  • ...
0-2186
621 return QLatin1String("");
never executed: return QLatin1String("");
0
622 return d->fileEntry.path();
executed 2186 times by 40 tests: return d->fileEntry.path();
Executed by:
  • tst_QApplication
  • tst_QChar
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QFile
  • tst_QFileInfo
  • tst_QFileSelector
  • tst_QFontDialog
  • tst_QGlobal
  • tst_QGlyphRun
  • tst_QGraphicsScene
  • tst_QGuiApplication
  • tst_QIcon
  • tst_QImageReader
  • tst_QLocalSocket
  • tst_QMimeDatabase
  • tst_QNetworkConfigurationManager
  • tst_QPluginLoader
  • tst_QRawFont
  • tst_QSql
  • tst_QTemporaryFile
  • ...
2186
623}-
624-
625/*!-
626 \fn bool QFileInfo::isAbsolute() const-
627-
628 Returns \c true if the file path name is absolute, otherwise returns-
629 false if the path is relative.-
630-
631 \sa isRelative()-
632*/-
633-
634/*!-
635 Returns \c true if the file path name is relative, otherwise returns-
636 false if the path is absolute (e.g. under Unix a path is absolute-
637 if it begins with a "/").-
638-
639 \sa isAbsolute()-
640*/-
641bool QFileInfo::isRelative() const-
642{-
643 Q_D(const QFileInfo);-
644 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEnever evaluated
FALSEevaluated 20613 times by 253 tests
Evaluated by:
  • tst_Gestures
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • ...
0-20613
645 return true;
never executed: return true;
0
646 if (d->fileEngine == 0)
d->fileEngine == 0Description
TRUEevaluated 20600 times by 252 tests
Evaluated by:
  • tst_Gestures
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • ...
FALSEevaluated 13 times by 5 tests
Evaluated by:
  • tst_QDir
  • tst_QGuiApplication
  • tst_QKeySequence
  • tst_QTextBrowser
  • tst_QTranslator
13-20600
647 return d->fileEntry.isRelative();
executed 20600 times by 252 tests: return d->fileEntry.isRelative();
Executed by:
  • tst_Gestures
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • ...
20600
648 return d->fileEngine->isRelativePath();
executed 13 times by 5 tests: return d->fileEngine->isRelativePath();
Executed by:
  • tst_QDir
  • tst_QGuiApplication
  • tst_QKeySequence
  • tst_QTextBrowser
  • tst_QTranslator
13
649}-
650-
651/*!-
652 Converts the file's path to an absolute path if it is not already in that form.-
653 Returns \c true to indicate that the path was converted; otherwise returns \c false-
654 to indicate that the path was already absolute.-
655-
656 \sa filePath(), isRelative()-
657*/-
658bool QFileInfo::makeAbsolute()-
659{-
660 if (d_ptr.constData()->isDefaultConstructed
d_ptr.constDat...ultConstructedDescription
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFileInfo
0-1
661 || !d_ptr.constData()->fileEntry.isRelative())
!d_ptr.constDa...y.isRelative()Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFileInfo
0-1
662 return false;
never executed: return false;
0
663-
664 setFile(absoluteFilePath());-
665 return true;
executed 1 time by 1 test: return true;
Executed by:
  • tst_QFileInfo
1
666}-
667-
668/*!-
669 Returns \c true if the file exists; otherwise returns \c false.-
670-
671 \note If the file is a symlink that points to a non-existing-
672 file, false is returned.-
673*/-
674bool QFileInfo::exists() const-
675{-
676 Q_D(const QFileInfo);-
677 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEevaluated 80 times by 2 tests
Evaluated by:
  • tst_QFileInfo
  • tst_qdbuscpp2xml - unknown status
FALSEevaluated 56301 times by 167 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QCssParser
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDataStream
  • tst_QDateTimeEdit
  • ...
80-56301
678 return false;
executed 80 times by 2 tests: return false;
Executed by:
  • tst_QFileInfo
  • tst_qdbuscpp2xml - unknown status
80
679 if (d->fileEngine == 0) {
d->fileEngine == 0Description
TRUEevaluated 50179 times by 162 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QCssParser
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDataStream
  • tst_QDateTimeEdit
  • ...
FALSEevaluated 6122 times by 64 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QButtonGroup
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDir
  • tst_QDirIterator
  • tst_QDnsLookup_Appless
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSelector
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGlobal
  • tst_QGlyphRun
  • tst_QGraphicsProxyWidget
  • ...
6122-50179
680 if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::ExistsAttribute))
!d->cache_enabledDescription
TRUEnever evaluated
FALSEevaluated 50179 times by 162 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QCssParser
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDataStream
  • tst_QDateTimeEdit
  • ...
!d->metaData.h...istsAttribute)Description
TRUEevaluated 10490 times by 77 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDnsLookup_Appless
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSelector
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • ...
FALSEevaluated 39689 times by 138 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • ...
0-50179
681 QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::ExistsAttribute);
executed 10490 times by 77 tests: QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::ExistsAttribute);
Executed by:
  • tst_LargeFile
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDnsLookup_Appless
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSelector
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • ...
10490
682 return d->metaData.exists();
executed 50179 times by 162 tests: return d->metaData.exists();
Executed by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QCssParser
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDataStream
  • tst_QDateTimeEdit
  • ...
50179
683 }-
684 return d->getFileFlags(QAbstractFileEngine::ExistsFlag);
executed 6122 times by 64 tests: return d->getFileFlags(QAbstractFileEngine::ExistsFlag);
Executed by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QApplication
  • tst_QButtonGroup
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDir
  • tst_QDirIterator
  • tst_QDnsLookup_Appless
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSelector
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGlobal
  • tst_QGlyphRun
  • tst_QGraphicsProxyWidget
  • ...
6122
685}-
686-
687/*!-
688 \since 5.2-
689-
690 Returns \c true if the \a file exists; otherwise returns \c false.-
691-
692 \note If \a file is a symlink that points to a non-existing-
693 file, false is returned.-
694-
695 \note Using this function is faster than using-
696 \c QFileInfo(file).exists() for file system access.-
697*/-
698bool QFileInfo::exists(const QString &file)-
699{-
700 QFileSystemEntry entry(file);-
701 QFileSystemMetaData data;-
702 QAbstractFileEngine *engine =-
703 QFileSystemEngine::resolveEntryAndCreateLegacyEngine(entry, data);-
704 // Expensive fallback to non-QFileSystemEngine implementation-
705 if (engine)
engineDescription
TRUEevaluated 4525 times by 35 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDir
  • tst_QDnsLookup_Appless
  • tst_QFileInfo
  • tst_QFileSelector
  • tst_QFontDialog
  • tst_QGlobal
  • tst_QGlyphRun
  • tst_QGuiApplication
  • tst_QIcon
  • tst_QLocalSocket
  • tst_QMimeDatabase
  • tst_QNetworkConfigurationManager
  • tst_QPluginLoader
  • tst_QRawFont
  • tst_QResourceEngine
  • tst_QSql
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • ...
FALSEevaluated 12770 times by 221 tests
Evaluated by:
  • tst_Gestures
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • ...
4525-12770
706 return QFileInfo(new QFileInfoPrivate(entry, data, engine)).exists();
executed 4525 times by 35 tests: return QFileInfo(new QFileInfoPrivate(entry, data, engine)).exists();
Executed by:
  • tst_QAbstractFileEngine
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDir
  • tst_QDnsLookup_Appless
  • tst_QFileInfo
  • tst_QFileSelector
  • tst_QFontDialog
  • tst_QGlobal
  • tst_QGlyphRun
  • tst_QGuiApplication
  • tst_QIcon
  • tst_QLocalSocket
  • tst_QMimeDatabase
  • tst_QNetworkConfigurationManager
  • tst_QPluginLoader
  • tst_QRawFont
  • tst_QResourceEngine
  • tst_QSql
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • ...
4525
707-
708 QFileSystemEngine::fillMetaData(entry, data, QFileSystemMetaData::ExistsAttribute);-
709 return data.exists();
executed 12770 times by 221 tests: return data.exists();
Executed by:
  • tst_Gestures
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • ...
12770
710}-
711-
712/*!-
713 Refreshes the information about the file, i.e. reads in information-
714 from the file system the next time a cached property is fetched.-
715*/-
716void QFileInfo::refresh()-
717{-
718 Q_D(QFileInfo);-
719 d->clear();-
720}
executed 8 times by 2 tests: end of block
Executed by:
  • tst_QFileInfo
  • tst_QFileSystemWatcher
8
721-
722/*!-
723 Returns the file name, including the path (which may be absolute-
724 or relative).-
725-
726 \sa absoluteFilePath(), canonicalFilePath(), isRelative()-
727*/-
728QString QFileInfo::filePath() const-
729{-
730 Q_D(const QFileInfo);-
731 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEevaluated 176 times by 8 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QDir
  • tst_QDirIterator
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QResourceEngine
  • tst_QVariant
  • tst_rcc
FALSEevaluated 59686 times by 175 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDoubleSpinBox
  • ...
176-59686
732 return QLatin1String("");
executed 176 times by 8 tests: return QLatin1String("");
Executed by:
  • tst_QAbstractFileEngine
  • tst_QDir
  • tst_QDirIterator
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QResourceEngine
  • tst_QVariant
  • tst_rcc
176
733 return d->fileEntry.filePath();
executed 59686 times by 175 tests: return d->fileEntry.filePath();
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDoubleSpinBox
  • ...
59686
734}-
735-
736/*!-
737 Returns the name of the file, excluding the path.-
738-
739 Example:-
740 \snippet code/src_corelib_io_qfileinfo.cpp 3-
741-
742 Note that, if this QFileInfo object is given a path ending in a-
743 slash, the name of the file is considered empty.-
744-
745 \sa isRelative(), filePath(), baseName(), suffix()-
746*/-
747QString QFileInfo::fileName() const-
748{-
749 Q_D(const QFileInfo);-
750 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEnever evaluated
FALSEevaluated 48786 times by 136 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • ...
0-48786
751 return QLatin1String("");
never executed: return QLatin1String("");
0
752 return d->fileEntry.fileName();
executed 48786 times by 136 tests: return d->fileEntry.fileName();
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • ...
48786
753}-
754-
755/*!-
756 \since 4.3-
757 Returns the name of the bundle.-
758-
759 On \macos and iOS this returns the proper localized name for a bundle if the-
760 path isBundle(). On all other platforms an empty QString is returned.-
761-
762 Example:-
763 \snippet code/src_corelib_io_qfileinfo.cpp 4-
764-
765 \sa isBundle(), filePath(), baseName(), suffix()-
766*/-
767QString QFileInfo::bundleName() const-
768{-
769 Q_D(const QFileInfo);-
770 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QFileInfo
0-2
771 return QLatin1String("");
never executed: return QLatin1String("");
0
772 return d->getFileName(QAbstractFileEngine::BundleName);
executed 2 times by 1 test: return d->getFileName(QAbstractFileEngine::BundleName);
Executed by:
  • tst_QFileInfo
2
773}-
774-
775/*!-
776 Returns the base name of the file without the path.-
777-
778 The base name consists of all characters in the file up to (but-
779 not including) the \e first '.' character.-
780-
781 Example:-
782 \snippet code/src_corelib_io_qfileinfo.cpp 5-
783-
784-
785 The base name of a file is computed equally on all platforms, independent-
786 of file naming conventions (e.g., ".bashrc" on Unix has an empty base-
787 name, and the suffix is "bashrc").-
788-
789 \sa fileName(), suffix(), completeSuffix(), completeBaseName()-
790*/-
791QString QFileInfo::baseName() const-
792{-
793 Q_D(const QFileInfo);-
794 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEnever evaluated
FALSEevaluated 11952 times by 82 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFrame
  • ...
0-11952
795 return QLatin1String("");
never executed: return QLatin1String("");
0
796 return d->fileEntry.baseName();
executed 11952 times by 82 tests: return d->fileEntry.baseName();
Executed by:
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFrame
  • ...
11952
797}-
798-
799/*!-
800 Returns the complete base name of the file without the path.-
801-
802 The complete base name consists of all characters in the file up-
803 to (but not including) the \e last '.' character.-
804-
805 Example:-
806 \snippet code/src_corelib_io_qfileinfo.cpp 6-
807-
808 \sa fileName(), suffix(), completeSuffix(), baseName()-
809*/-
810QString QFileInfo::completeBaseName() const-
811{-
812 Q_D(const QFileInfo);-
813 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • tst_QFileInfo
0-7
814 return QLatin1String("");
never executed: return QLatin1String("");
0
815 return d->fileEntry.completeBaseName();
executed 7 times by 1 test: return d->fileEntry.completeBaseName();
Executed by:
  • tst_QFileInfo
7
816}-
817-
818/*!-
819 Returns the complete suffix (extension) of the file.-
820-
821 The complete suffix consists of all characters in the file after-
822 (but not including) the first '.'.-
823-
824 Example:-
825 \snippet code/src_corelib_io_qfileinfo.cpp 7-
826-
827 \sa fileName(), suffix(), baseName(), completeBaseName()-
828*/-
829QString QFileInfo::completeSuffix() const-
830{-
831 Q_D(const QFileInfo);-
832 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEnever evaluated
FALSEevaluated 1112 times by 35 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsView
  • tst_QGroupBox
  • tst_QIcon
  • tst_QLabel
  • tst_QLineEdit
  • tst_QMdiSubWindow
  • tst_QMessageBox
  • tst_QPixmap
  • tst_QPixmapFilter
  • tst_QPlugin
  • ...
0-1112
833 return QLatin1String("");
never executed: return QLatin1String("");
0
834 return d->fileEntry.completeSuffix();
executed 1112 times by 35 tests: return d->fileEntry.completeSuffix();
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsView
  • tst_QGroupBox
  • tst_QIcon
  • tst_QLabel
  • tst_QLineEdit
  • tst_QMdiSubWindow
  • tst_QMessageBox
  • tst_QPixmap
  • tst_QPixmapFilter
  • tst_QPlugin
  • ...
1112
835}-
836-
837/*!-
838 Returns the suffix (extension) of the file.-
839-
840 The suffix consists of all characters in the file after (but not-
841 including) the last '.'.-
842-
843 Example:-
844 \snippet code/src_corelib_io_qfileinfo.cpp 8-
845-
846 The suffix of a file is computed equally on all platforms, independent of-
847 file naming conventions (e.g., ".bashrc" on Unix has an empty base name,-
848 and the suffix is "bashrc").-
849-
850 \sa fileName(), completeSuffix(), baseName(), completeBaseName()-
851*/-
852QString QFileInfo::suffix() const-
853{-
854 Q_D(const QFileInfo);-
855 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEnever evaluated
FALSEevaluated 17087 times by 77 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDir
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFrame
  • tst_QGraphicsEffect
  • ...
0-17087
856 return QLatin1String("");
never executed: return QLatin1String("");
0
857 return d->fileEntry.suffix();
executed 17087 times by 77 tests: return d->fileEntry.suffix();
Executed by:
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDir
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFrame
  • tst_QGraphicsEffect
  • ...
17087
858}-
859-
860-
861/*!-
862 Returns the path of the object's parent directory as a QDir object.-
863-
864 \b{Note:} The QDir returned always corresponds to the object's-
865 parent directory, even if the QFileInfo represents a directory.-
866-
867 For each of the following, dir() returns a QDir for-
868 \c{"~/examples/191697"}.-
869-
870 \snippet fileinfo/main.cpp 0-
871-
872 For each of the following, dir() returns a QDir for-
873 \c{"."}.-
874-
875 \snippet fileinfo/main.cpp 1-
876-
877 \sa absolutePath(), filePath(), fileName(), isRelative(), absoluteDir()-
878*/-
879QDir QFileInfo::dir() const-
880{-
881 Q_D(const QFileInfo);-
882 // ### Qt 6: Maybe rename this to parentDirectory(), considering what it actually does?-
883 return QDir(d->fileEntry.path());
executed 15 times by 3 tests: return QDir(d->fileEntry.path());
Executed by:
  • tst_QDirModel
  • tst_QFileInfo
  • tst_QSettings
15
884}-
885-
886/*!-
887 Returns the file's absolute path as a QDir object.-
888-
889 \sa dir(), filePath(), fileName(), isRelative()-
890*/-
891QDir QFileInfo::absoluteDir() const-
892{-
893 return QDir(absolutePath());
executed 41 times by 5 tests: return QDir(absolutePath());
Executed by:
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemWatcher
  • tst_QFiledialog
41
894}-
895-
896/*!-
897 Returns \c true if the user can read the file; otherwise returns \c false.-
898-
899 \note If the \l{NTFS permissions} check has not been enabled, the result-
900 on Windows will merely reflect whether the file exists.-
901-
902 \sa isWritable(), isExecutable(), permission()-
903*/-
904bool QFileInfo::isReadable() const-
905{-
906 Q_D(const QFileInfo);-
907 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEnever evaluated
FALSEevaluated 200 times by 6 tests
Evaluated by:
  • tst_QDir
  • tst_QKeySequence
  • tst_QResourceEngine
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QTranslator
0-200
908 return false;
never executed: return false;
0
909 if (d->fileEngine == 0) {
d->fileEngine == 0Description
TRUEevaluated 125 times by 4 tests
Evaluated by:
  • tst_QDir
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QTranslator
FALSEevaluated 75 times by 3 tests
Evaluated by:
  • tst_QKeySequence
  • tst_QResourceEngine
  • tst_QTranslator
75-125
910 if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::UserReadPermission))
!d->cache_enabledDescription
TRUEnever evaluated
FALSEevaluated 125 times by 4 tests
Evaluated by:
  • tst_QDir
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QTranslator
!d->metaData.h...eadPermission)Description
TRUEevaluated 125 times by 4 tests
Evaluated by:
  • tst_QDir
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QTranslator
FALSEnever evaluated
0-125
911 QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::UserReadPermission);
executed 125 times by 4 tests: QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::UserReadPermission);
Executed by:
  • tst_QDir
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QTranslator
125
912 return (d->metaData.permissions() & QFile::ReadUser) != 0;
executed 125 times by 4 tests: return (d->metaData.permissions() & QFile::ReadUser) != 0;
Executed by:
  • tst_QDir
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QTranslator
125
913 }-
914 return d->getFileFlags(QAbstractFileEngine::ReadUserPerm);
executed 75 times by 3 tests: return d->getFileFlags(QAbstractFileEngine::ReadUserPerm);
Executed by:
  • tst_QKeySequence
  • tst_QResourceEngine
  • tst_QTranslator
75
915}-
916-
917/*!-
918 Returns \c true if the user can write to the file; otherwise returns \c false.-
919-
920 \note If the \l{NTFS permissions} check has not been enabled, the result on-
921 Windows will merely reflect whether the file is marked as Read Only.-
922-
923 \sa isReadable(), isExecutable(), permission()-
924*/-
925bool QFileInfo::isWritable() const-
926{-
927 Q_D(const QFileInfo);-
928 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEnever evaluated
FALSEevaluated 538 times by 11 tests
Evaluated by:
  • tst_QColorDialog
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QResourceEngine
  • tst_QSaveFile
  • tst_QSettings
  • tst_QTemporaryDir
  • tst_languageChange
0-538
929 return false;
never executed: return false;
0
930 if (d->fileEngine == 0) {
d->fileEngine == 0Description
TRUEevaluated 467 times by 10 tests
Evaluated by:
  • tst_QColorDialog
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QSaveFile
  • tst_QSettings
  • tst_QTemporaryDir
  • tst_languageChange
FALSEevaluated 71 times by 1 test
Evaluated by:
  • tst_QResourceEngine
71-467
931 if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::UserWritePermission))
!d->cache_enabledDescription
TRUEnever evaluated
FALSEevaluated 467 times by 10 tests
Evaluated by:
  • tst_QColorDialog
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QSaveFile
  • tst_QSettings
  • tst_QTemporaryDir
  • tst_languageChange
!d->metaData.h...itePermission)Description
TRUEevaluated 467 times by 10 tests
Evaluated by:
  • tst_QColorDialog
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QSaveFile
  • tst_QSettings
  • tst_QTemporaryDir
  • tst_languageChange
FALSEnever evaluated
0-467
932 QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::UserWritePermission);
executed 467 times by 10 tests: QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::UserWritePermission);
Executed by:
  • tst_QColorDialog
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QSaveFile
  • tst_QSettings
  • tst_QTemporaryDir
  • tst_languageChange
467
933 return (d->metaData.permissions() & QFile::WriteUser) != 0;
executed 467 times by 10 tests: return (d->metaData.permissions() & QFile::WriteUser) != 0;
Executed by:
  • tst_QColorDialog
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QSaveFile
  • tst_QSettings
  • tst_QTemporaryDir
  • tst_languageChange
467
934 }-
935 return d->getFileFlags(QAbstractFileEngine::WriteUserPerm);
executed 71 times by 1 test: return d->getFileFlags(QAbstractFileEngine::WriteUserPerm);
Executed by:
  • tst_QResourceEngine
71
936}-
937-
938/*!-
939 Returns \c true if the file is executable; otherwise returns \c false.-
940-
941 \sa isReadable(), isWritable(), permission()-
942*/-
943bool QFileInfo::isExecutable() const-
944{-
945 Q_D(const QFileInfo);-
946 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEnever evaluated
FALSEevaluated 89 times by 6 tests
Evaluated by:
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QResourceEngine
  • tst_QThreadStorage
  • tst_qstandardpaths
0-89
947 return false;
never executed: return false;
0
948 if (d->fileEngine == 0) {
d->fileEngine == 0Description
TRUEevaluated 18 times by 5 tests
Evaluated by:
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QThreadStorage
  • tst_qstandardpaths
FALSEevaluated 71 times by 1 test
Evaluated by:
  • tst_QResourceEngine
18-71
949 if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::UserExecutePermission))
!d->cache_enabledDescription
TRUEnever evaluated
FALSEevaluated 18 times by 5 tests
Evaluated by:
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QThreadStorage
  • tst_qstandardpaths
!d->metaData.h...utePermission)Description
TRUEevaluated 18 times by 5 tests
Evaluated by:
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QThreadStorage
  • tst_qstandardpaths
FALSEnever evaluated
0-18
950 QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::UserExecutePermission);
executed 18 times by 5 tests: QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::UserExecutePermission);
Executed by:
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QThreadStorage
  • tst_qstandardpaths
18
951 return (d->metaData.permissions() & QFile::ExeUser) != 0;
executed 18 times by 5 tests: return (d->metaData.permissions() & QFile::ExeUser) != 0;
Executed by:
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QThreadStorage
  • tst_qstandardpaths
18
952 }-
953 return d->getFileFlags(QAbstractFileEngine::ExeUserPerm);
executed 71 times by 1 test: return d->getFileFlags(QAbstractFileEngine::ExeUserPerm);
Executed by:
  • tst_QResourceEngine
71
954}-
955-
956/*!-
957 Returns \c true if this is a `hidden' file; otherwise returns \c false.-
958-
959 \b{Note:} This function returns \c true for the special entries-
960 "." and ".." on Unix, even though QDir::entryList threats them as shown.-
961*/-
962bool QFileInfo::isHidden() const-
963{-
964 Q_D(const QFileInfo);-
965 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEnever evaluated
FALSEevaluated 41811 times by 138 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • ...
0-41811
966 return false;
never executed: return false;
0
967 if (d->fileEngine == 0) {
d->fileEngine == 0Description
TRUEevaluated 41224 times by 135 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFile
  • ...
FALSEevaluated 587 times by 7 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QDir
  • tst_QDirIterator
  • tst_QFileInfo
  • tst_QResourceEngine
  • tst_QVariant
  • tst_rcc
587-41224
968 if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::HiddenAttribute))
!d->cache_enabledDescription
TRUEnever evaluated
FALSEevaluated 41224 times by 135 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFile
  • ...
!d->metaData.h...ddenAttribute)Description
TRUEevaluated 38803 times by 135 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFile
  • ...
FALSEevaluated 2421 times by 9 tests
Evaluated by:
  • tst_QCompleter
  • tst_QDirIterator
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QNetworkDiskCache
  • tst_QPrinter
  • tst_QSslCertificate
  • tst_languageChange
0-41224
969 QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::HiddenAttribute);
executed 38803 times by 135 tests: QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::HiddenAttribute);
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFile
  • ...
38803
970 return d->metaData.isHidden();
executed 41224 times by 135 tests: return d->metaData.isHidden();
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFile
  • ...
41224
971 }-
972 return d->getFileFlags(QAbstractFileEngine::HiddenFlag);
executed 587 times by 7 tests: return d->getFileFlags(QAbstractFileEngine::HiddenFlag);
Executed by:
  • tst_QAbstractFileEngine
  • tst_QDir
  • tst_QDirIterator
  • tst_QFileInfo
  • tst_QResourceEngine
  • tst_QVariant
  • tst_rcc
587
973}-
974-
975/*!-
976 \since 5.0-
977 Returns \c true if the file path can be used directly with native APIs.-
978 Returns \c false if the file is otherwise supported by a virtual file system-
979 inside Qt, such as \l{the Qt Resource System}.-
980-
981 \b{Note:} Native paths may still require conversion of path separators-
982 and character encoding, depending on platform and input requirements of the-
983 native API.-
984-
985 \sa QDir::toNativeSeparators(), QFile::encodeName(), filePath(),-
986 absoluteFilePath(), canonicalFilePath()-
987*/-
988bool QFileInfo::isNativePath() const-
989{-
990 Q_D(const QFileInfo);-
991 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFileInfo
FALSEevaluated 444 times by 124 tests
Evaluated by:
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • ...
1-444
992 return false;
executed 1 time by 1 test: return false;
Executed by:
  • tst_QFileInfo
1
993 if (d->fileEngine == 0)
d->fileEngine == 0Description
TRUEevaluated 401 times by 124 tests
Evaluated by:
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • ...
FALSEevaluated 43 times by 5 tests
Evaluated by:
  • tst_QFileInfo
  • tst_QFontDialog
  • tst_QFontMetrics
  • tst_QGlyphRun
  • tst_QRawFont
43-401
994 return true;
executed 401 times by 124 tests: return true;
Executed by:
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • tst_QFileDialog2
  • ...
401
995 return d->getFileFlags(QAbstractFileEngine::LocalDiskFlag);
executed 43 times by 5 tests: return d->getFileFlags(QAbstractFileEngine::LocalDiskFlag);
Executed by:
  • tst_QFileInfo
  • tst_QFontDialog
  • tst_QFontMetrics
  • tst_QGlyphRun
  • tst_QRawFont
43
996}-
997-
998/*!-
999 Returns \c true if this object points to a file or to a symbolic-
1000 link to a file. Returns \c false if the-
1001 object points to something which isn't a file, such as a directory.-
1002-
1003 \sa isDir(), isSymLink(), isBundle()-
1004*/-
1005bool QFileInfo::isFile() const-
1006{-
1007 Q_D(const QFileInfo);-
1008 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEnever evaluated
FALSEevaluated 93735 times by 165 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QCssParser
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDataStream
  • tst_QDateTimeEdit
  • ...
0-93735
1009 return false;
never executed: return false;
0
1010 if (d->fileEngine == 0) {
d->fileEngine == 0Description
TRUEevaluated 93159 times by 162 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QCssParser
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDataStream
  • tst_QDateTimeEdit
  • ...
FALSEevaluated 576 times by 9 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QDir
  • tst_QDirIterator
  • tst_QFileInfo
  • tst_QKeySequence
  • tst_QResourceEngine
  • tst_QTranslator
  • tst_QVariant
  • tst_rcc
576-93159
1011 if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::FileType))
!d->cache_enabledDescription
TRUEnever evaluated
FALSEevaluated 93159 times by 162 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QCssParser
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDataStream
  • tst_QDateTimeEdit
  • ...
!d->metaData.h...ata::FileType)Description
TRUEevaluated 40041 times by 75 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QApplication
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDnsLookup_Appless
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • ...
FALSEevaluated 53118 times by 132 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDoubleSpinBox
  • ...
0-93159
1012 QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::FileType);
executed 40041 times by 75 tests: QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::FileType);
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QApplication
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDnsLookup_Appless
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • ...
40041
1013 return d->metaData.isFile();
executed 93159 times by 162 tests: return d->metaData.isFile();
Executed by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QCssParser
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDataStream
  • tst_QDateTimeEdit
  • ...
93159
1014 }-
1015 return d->getFileFlags(QAbstractFileEngine::FileType);
executed 576 times by 9 tests: return d->getFileFlags(QAbstractFileEngine::FileType);
Executed by:
  • tst_QAbstractFileEngine
  • tst_QDir
  • tst_QDirIterator
  • tst_QFileInfo
  • tst_QKeySequence
  • tst_QResourceEngine
  • tst_QTranslator
  • tst_QVariant
  • tst_rcc
576
1016}-
1017-
1018/*!-
1019 Returns \c true if this object points to a directory or to a symbolic-
1020 link to a directory; otherwise returns \c false.-
1021-
1022 \sa isFile(), isSymLink(), isBundle()-
1023*/-
1024bool QFileInfo::isDir() const-
1025{-
1026 Q_D(const QFileInfo);-
1027 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEnever evaluated
FALSEevaluated 122940 times by 162 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • ...
0-122940
1028 return false;
never executed: return false;
0
1029 if (d->fileEngine == 0) {
d->fileEngine == 0Description
TRUEevaluated 119618 times by 160 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • ...
FALSEevaluated 3322 times by 38 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QLabel
  • tst_QLineEdit
  • tst_QMessageBox
  • tst_QMimeDatabase
  • ...
3322-119618
1030 if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::DirectoryType))
!d->cache_enabledDescription
TRUEnever evaluated
FALSEevaluated 119618 times by 160 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • ...
!d->metaData.h...DirectoryType)Description
TRUEevaluated 2049 times by 44 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QIcon
  • tst_QItemModel
  • tst_QLabel
  • tst_QLineEdit
  • tst_QMessageBox
  • tst_QMimeDatabase
  • ...
FALSEevaluated 117569 times by 156 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • ...
0-119618
1031 QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::DirectoryType);
executed 2049 times by 44 tests: QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::DirectoryType);
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QIcon
  • tst_QItemModel
  • tst_QLabel
  • tst_QLineEdit
  • tst_QMessageBox
  • tst_QMimeDatabase
  • ...
2049
1032 return d->metaData.isDirectory();
executed 119618 times by 160 tests: return d->metaData.isDirectory();
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDoubleSpinBox
  • tst_QErrorMessage
  • ...
119618
1033 }-
1034 return d->getFileFlags(QAbstractFileEngine::DirectoryType);
executed 3322 times by 38 tests: return d->getFileFlags(QAbstractFileEngine::DirectoryType);
Executed by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QDirIterator
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QLabel
  • tst_QLineEdit
  • tst_QMessageBox
  • tst_QMimeDatabase
  • ...
3322
1035}-
1036-
1037-
1038/*!-
1039 \since 4.3-
1040 Returns \c true if this object points to a bundle or to a symbolic-
1041 link to a bundle on \macos and iOS; otherwise returns \c false.-
1042-
1043 \sa isDir(), isSymLink(), isFile()-
1044*/-
1045bool QFileInfo::isBundle() const-
1046{-
1047 Q_D(const QFileInfo);-
1048 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEnever evaluated
FALSEevaluated 240 times by 5 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_qstandardpaths
0-240
1049 return false;
never executed: return false;
0
1050 if (d->fileEngine == 0) {
d->fileEngine == 0Description
TRUEevaluated 240 times by 5 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_qstandardpaths
FALSEnever evaluated
0-240
1051 if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::BundleType))
!d->cache_enabledDescription
TRUEnever evaluated
FALSEevaluated 240 times by 5 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_qstandardpaths
!d->metaData.h...a::BundleType)Description
TRUEnever evaluated
FALSEevaluated 240 times by 5 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_qstandardpaths
0-240
1052 QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::BundleType);
never executed: QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::BundleType);
0
1053 return d->metaData.isBundle();
executed 240 times by 5 tests: return d->metaData.isBundle();
Executed by:
  • tst_NetworkSelfTest
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_qstandardpaths
240
1054 }-
1055 return d->getFileFlags(QAbstractFileEngine::BundleType);
never executed: return d->getFileFlags(QAbstractFileEngine::BundleType);
0
1056}-
1057-
1058/*!-
1059 Returns \c true if this object points to a symbolic link (or to a-
1060 shortcut on Windows); otherwise returns \c false.-
1061-
1062 On Unix (including \macos and iOS), opening a symlink effectively opens-
1063 the \l{symLinkTarget()}{link's target}. On Windows, it opens the \c-
1064 .lnk file itself.-
1065-
1066 Example:-
1067-
1068 \snippet code/src_corelib_io_qfileinfo.cpp 9-
1069-
1070 \note If the symlink points to a non existing file, exists() returns-
1071 false.-
1072-
1073 \sa isFile(), isDir(), symLinkTarget()-
1074*/-
1075bool QFileInfo::isSymLink() const-
1076{-
1077 Q_D(const QFileInfo);-
1078 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEnever evaluated
FALSEevaluated 26121 times by 58 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDnsLookup_Appless
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGlobal
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QIcon
  • tst_QItemModel
  • ...
0-26121
1079 return false;
never executed: return false;
0
1080 if (d->fileEngine == 0) {
d->fileEngine == 0Description
TRUEevaluated 26040 times by 57 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDnsLookup_Appless
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGlobal
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QIcon
  • tst_QItemModel
  • ...
FALSEevaluated 81 times by 3 tests
Evaluated by:
  • tst_QDirIterator
  • tst_QFileInfo
  • tst_rcc
81-26040
1081 if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::LegacyLinkType))
!d->cache_enabledDescription
TRUEnever evaluated
FALSEevaluated 26040 times by 57 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDnsLookup_Appless
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGlobal
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QIcon
  • tst_QItemModel
  • ...
!d->metaData.h...egacyLinkType)Description
TRUEevaluated 4914 times by 40 tests
Evaluated by:
  • tst_QApplication
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDirModel
  • tst_QDnsLookup_Appless
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGlobal
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QItemModel
  • tst_QLockFile
  • tst_QNetworkConfigurationManager
  • tst_QPrinter
  • tst_QSaveFile
  • tst_QSettings
  • ...
FALSEevaluated 21126 times by 30 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QItemModel
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QSaveFile
  • tst_QSettings
  • tst_QSidebar
  • tst_QTemporaryDir
  • tst_languageChange
  • tst_qfileinfo - unknown status
  • tst_qmakelib
  • tst_qmimedatabase-cache - unknown status
  • ...
0-26040
1082 QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::LegacyLinkType);
executed 4914 times by 40 tests: QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::LegacyLinkType);
Executed by:
  • tst_QApplication
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDirModel
  • tst_QDnsLookup_Appless
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGlobal
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QItemModel
  • tst_QLockFile
  • tst_QNetworkConfigurationManager
  • tst_QPrinter
  • tst_QSaveFile
  • tst_QSettings
  • ...
4914
1083 return d->metaData.isLegacyLink();
executed 26040 times by 57 tests: return d->metaData.isLegacyLink();
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QDnsLookup_Appless
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGlobal
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QIcon
  • tst_QItemModel
  • ...
26040
1084 }-
1085 return d->getFileFlags(QAbstractFileEngine::LinkType);
executed 81 times by 3 tests: return d->getFileFlags(QAbstractFileEngine::LinkType);
Executed by:
  • tst_QDirIterator
  • tst_QFileInfo
  • tst_rcc
81
1086}-
1087-
1088/*!-
1089 Returns \c true if the object points to a directory or to a symbolic-
1090 link to a directory, and that directory is the root directory; otherwise-
1091 returns \c false.-
1092*/-
1093bool QFileInfo::isRoot() const-
1094{-
1095 Q_D(const QFileInfo);-
1096 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QFileIconProvider
FALSEevaluated 13776 times by 13 tests
Evaluated by:
  • tst_QCompleter
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemModel
  • tst_QPrinter
  • tst_QSidebar
  • tst_languageChange
  • tst_qmakelib
2-13776
1097 return true;
executed 2 times by 1 test: return true;
Executed by:
  • tst_QFileIconProvider
2
1098 if (d->fileEngine == 0) {
d->fileEngine == 0Description
TRUEevaluated 13774 times by 13 tests
Evaluated by:
  • tst_QCompleter
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemModel
  • tst_QPrinter
  • tst_QSidebar
  • tst_languageChange
  • tst_qmakelib
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QFileInfo
2-13774
1099 if (d->fileEntry.isRoot()) {
d->fileEntry.isRoot()Description
TRUEevaluated 653 times by 11 tests
Evaluated by:
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemModel
  • tst_QPrinter
  • tst_QSidebar
  • tst_languageChange
FALSEevaluated 13121 times by 13 tests
Evaluated by:
  • tst_QCompleter
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemModel
  • tst_QPrinter
  • tst_QSidebar
  • tst_languageChange
  • tst_qmakelib
653-13121
1100#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)-
1101 //the path is a drive root, but the drive may not exist-
1102 //for backward compatibility, return true only if the drive exists-
1103 if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::ExistsAttribute))-
1104 QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::ExistsAttribute);-
1105 return d->metaData.exists();-
1106#else-
1107 return true;
executed 653 times by 11 tests: return true;
Executed by:
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemModel
  • tst_QPrinter
  • tst_QSidebar
  • tst_languageChange
653
1108#endif-
1109 }-
1110 return false;
executed 13121 times by 13 tests: return false;
Executed by:
  • tst_QCompleter
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemModel
  • tst_QPrinter
  • tst_QSidebar
  • tst_languageChange
  • tst_qmakelib
13121
1111 }-
1112 return d->getFileFlags(QAbstractFileEngine::RootFlag);
executed 2 times by 1 test: return d->getFileFlags(QAbstractFileEngine::RootFlag);
Executed by:
  • tst_QFileInfo
2
1113}-
1114-
1115/*!-
1116 \fn QString QFileInfo::symLinkTarget() const-
1117 \since 4.2-
1118-
1119 Returns the absolute path to the file or directory a symlink (or shortcut-
1120 on Windows) points to, or a an empty string if the object isn't a symbolic-
1121 link.-
1122-
1123 This name may not represent an existing file; it is only a string.-
1124 QFileInfo::exists() returns \c true if the symlink points to an-
1125 existing file.-
1126-
1127 \sa exists(), isSymLink(), isDir(), isFile()-
1128*/-
1129-
1130/*!-
1131 \obsolete-
1132-
1133 Use symLinkTarget() instead.-
1134*/-
1135QString QFileInfo::readLink() const-
1136{-
1137 Q_D(const QFileInfo);-
1138 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEnever evaluated
FALSEevaluated 403 times by 10 tests
Evaluated by:
  • tst_QApplication
  • tst_QDirModel
  • tst_QFile
  • tst_QFileInfo
  • tst_QGuiApplication
  • tst_QItemModel
  • tst_QSaveFile
  • tst_qapplication - unknown status
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
0-403
1139 return QLatin1String("");
never executed: return QLatin1String("");
0
1140 return d->getFileName(QAbstractFileEngine::LinkName);
executed 403 times by 10 tests: return d->getFileName(QAbstractFileEngine::LinkName);
Executed by:
  • tst_QApplication
  • tst_QDirModel
  • tst_QFile
  • tst_QFileInfo
  • tst_QGuiApplication
  • tst_QItemModel
  • tst_QSaveFile
  • tst_qapplication - unknown status
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
403
1141}-
1142-
1143/*!-
1144 Returns the owner of the file. On systems where files-
1145 do not have owners, or if an error occurs, an empty string is-
1146 returned.-
1147-
1148 This function can be time consuming under Unix (in the order of-
1149 milliseconds). On Windows, it will return an empty string unless-
1150 the \l{NTFS permissions} check has been enabled.-
1151-
1152 \sa ownerId(), group(), groupId()-
1153*/-
1154QString QFileInfo::owner() const-
1155{-
1156 Q_D(const QFileInfo);-
1157 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFileInfo
0-1
1158 return QLatin1String("");
never executed: return QLatin1String("");
0
1159 return d->getFileOwner(QAbstractFileEngine::OwnerUser);
executed 1 time by 1 test: return d->getFileOwner(QAbstractFileEngine::OwnerUser);
Executed by:
  • tst_QFileInfo
1
1160}-
1161-
1162/*!-
1163 Returns the id of the owner of the file.-
1164-
1165 On Windows and on systems where files do not have owners this-
1166 function returns ((uint) -2).-
1167-
1168 \sa owner(), group(), groupId()-
1169*/-
1170uint QFileInfo::ownerId() const-
1171{-
1172 Q_D(const QFileInfo);-
1173 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEnever evaluated
FALSEevaluated 45 times by 2 tests
Evaluated by:
  • tst_QFileSystemWatcher
  • tst_qstandardpaths
0-45
1174 return 0;
never executed: return 0;
0
1175 if (d->fileEngine == 0) {
d->fileEngine == 0Description
TRUEevaluated 45 times by 2 tests
Evaluated by:
  • tst_QFileSystemWatcher
  • tst_qstandardpaths
FALSEnever evaluated
0-45
1176 if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::UserId))
!d->cache_enabledDescription
TRUEnever evaluated
FALSEevaluated 45 times by 2 tests
Evaluated by:
  • tst_QFileSystemWatcher
  • tst_qstandardpaths
!d->metaData.h...aData::UserId)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QFileSystemWatcher
FALSEevaluated 41 times by 2 tests
Evaluated by:
  • tst_QFileSystemWatcher
  • tst_qstandardpaths
0-45
1177 QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::UserId);
executed 4 times by 1 test: QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::UserId);
Executed by:
  • tst_QFileSystemWatcher
4
1178 return d->metaData.userId();
executed 45 times by 2 tests: return d->metaData.userId();
Executed by:
  • tst_QFileSystemWatcher
  • tst_qstandardpaths
45
1179 }-
1180 return d->fileEngine->ownerId(QAbstractFileEngine::OwnerUser);
never executed: return d->fileEngine->ownerId(QAbstractFileEngine::OwnerUser);
0
1181}-
1182-
1183/*!-
1184 Returns the group of the file. On Windows, on systems where files-
1185 do not have groups, or if an error occurs, an empty string is-
1186 returned.-
1187-
1188 This function can be time consuming under Unix (in the order of-
1189 milliseconds).-
1190-
1191 \sa groupId(), owner(), ownerId()-
1192*/-
1193QString QFileInfo::group() const-
1194{-
1195 Q_D(const QFileInfo);-
1196 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFileInfo
0-1
1197 return QLatin1String("");
never executed: return QLatin1String("");
0
1198 return d->getFileOwner(QAbstractFileEngine::OwnerGroup);
executed 1 time by 1 test: return d->getFileOwner(QAbstractFileEngine::OwnerGroup);
Executed by:
  • tst_QFileInfo
1
1199}-
1200-
1201/*!-
1202 Returns the id of the group the file belongs to.-
1203-
1204 On Windows and on systems where files do not have groups this-
1205 function always returns (uint) -2.-
1206-
1207 \sa group(), owner(), ownerId()-
1208*/-
1209uint QFileInfo::groupId() const-
1210{-
1211 Q_D(const QFileInfo);-
1212 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEnever evaluated
FALSEevaluated 38 times by 1 test
Evaluated by:
  • tst_QFileSystemWatcher
0-38
1213 return 0;
never executed: return 0;
0
1214 if (d->fileEngine == 0) {
d->fileEngine == 0Description
TRUEevaluated 38 times by 1 test
Evaluated by:
  • tst_QFileSystemWatcher
FALSEnever evaluated
0-38
1215 if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::GroupId))
!d->cache_enabledDescription
TRUEnever evaluated
FALSEevaluated 38 times by 1 test
Evaluated by:
  • tst_QFileSystemWatcher
!d->metaData.h...Data::GroupId)Description
TRUEnever evaluated
FALSEevaluated 38 times by 1 test
Evaluated by:
  • tst_QFileSystemWatcher
0-38
1216 QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::GroupId);
never executed: QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::GroupId);
0
1217 return d->metaData.groupId();
executed 38 times by 1 test: return d->metaData.groupId();
Executed by:
  • tst_QFileSystemWatcher
38
1218 }-
1219 return d->fileEngine->ownerId(QAbstractFileEngine::OwnerGroup);
never executed: return d->fileEngine->ownerId(QAbstractFileEngine::OwnerGroup);
0
1220}-
1221-
1222/*!-
1223 Tests for file permissions. The \a permissions argument can be-
1224 several flags of type QFile::Permissions OR-ed together to check-
1225 for permission combinations.-
1226-
1227 On systems where files do not have permissions this function-
1228 always returns \c true.-
1229-
1230 \note The result might be inaccurate on Windows if the-
1231 \l{NTFS permissions} check has not been enabled.-
1232-
1233 Example:-
1234 \snippet code/src_corelib_io_qfileinfo.cpp 10-
1235-
1236 \sa isReadable(), isWritable(), isExecutable()-
1237*/-
1238bool QFileInfo::permission(QFile::Permissions permissions) const-
1239{-
1240 Q_D(const QFileInfo);-
1241 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_QFileInfo
0-5
1242 return false;
never executed: return false;
0
1243 if (d->fileEngine == 0) {
d->fileEngine == 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QFileInfo
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QFileInfo
2-3
1244 // the QFileSystemMetaData::MetaDataFlag and QFile::Permissions overlap, so just static cast.-
1245 QFileSystemMetaData::MetaDataFlag permissionFlags = static_cast<QFileSystemMetaData::MetaDataFlag>((int)permissions);-
1246 if (!d->cache_enabled || !d->metaData.hasFlags(permissionFlags))
!d->cache_enabledDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QFileInfo
!d->metaData.h...rmissionFlags)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QFileInfo
FALSEnever evaluated
0-2
1247 QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, permissionFlags);
executed 2 times by 1 test: QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, permissionFlags);
Executed by:
  • tst_QFileInfo
2
1248 return (d->metaData.permissions() & permissions) == permissions;
executed 2 times by 1 test: return (d->metaData.permissions() & permissions) == permissions;
Executed by:
  • tst_QFileInfo
2
1249 }-
1250 return d->getFileFlags(QAbstractFileEngine::FileFlags((int)permissions)) == (uint)permissions;
executed 3 times by 1 test: return d->getFileFlags(QAbstractFileEngine::FileFlags((int)permissions)) == (uint)permissions;
Executed by:
  • tst_QFileInfo
3
1251}-
1252-
1253/*!-
1254 Returns the complete OR-ed together combination of-
1255 QFile::Permissions for the file.-
1256-
1257 \note The result might be inaccurate on Windows if the-
1258 \l{NTFS permissions} check has not been enabled.-
1259*/-
1260QFile::Permissions QFileInfo::permissions() const-
1261{-
1262 Q_D(const QFileInfo);-
1263 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEnever evaluated
FALSEevaluated 14912 times by 13 tests
Evaluated by:
  • tst_QColorDialog
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QPrinter
  • tst_QSaveFile
  • tst_QSettings
  • tst_languageChange
  • tst_qstandardpaths
0-14912
1264 return 0;
never executed: return 0;
0
1265 if (d->fileEngine == 0) {
d->fileEngine == 0Description
TRUEevaluated 14910 times by 13 tests
Evaluated by:
  • tst_QColorDialog
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QPrinter
  • tst_QSaveFile
  • tst_QSettings
  • tst_languageChange
  • tst_qstandardpaths
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QFileInfo
2-14910
1266 if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::Permissions))
!d->cache_enabledDescription
TRUEnever evaluated
FALSEevaluated 14910 times by 13 tests
Evaluated by:
  • tst_QColorDialog
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QPrinter
  • tst_QSaveFile
  • tst_QSettings
  • tst_languageChange
  • tst_qstandardpaths
!d->metaData.h...::Permissions)Description
TRUEevaluated 5045 times by 13 tests
Evaluated by:
  • tst_QColorDialog
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QPrinter
  • tst_QSaveFile
  • tst_QSettings
  • tst_languageChange
  • tst_qstandardpaths
FALSEevaluated 9865 times by 7 tests
Evaluated by:
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_languageChange
0-14910
1267 QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::Permissions);
executed 5045 times by 13 tests: QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::Permissions);
Executed by:
  • tst_QColorDialog
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QPrinter
  • tst_QSaveFile
  • tst_QSettings
  • tst_languageChange
  • tst_qstandardpaths
5045
1268 return d->metaData.permissions();
executed 14910 times by 13 tests: return d->metaData.permissions();
Executed by:
  • tst_QColorDialog
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QPrinter
  • tst_QSaveFile
  • tst_QSettings
  • tst_languageChange
  • tst_qstandardpaths
14910
1269 }-
1270 return QFile::Permissions(d->getFileFlags(QAbstractFileEngine::PermsMask) & QAbstractFileEngine::PermsMask);
executed 2 times by 1 test: return QFile::Permissions(d->getFileFlags(QAbstractFileEngine::PermsMask) & QAbstractFileEngine::PermsMask);
Executed by:
  • tst_QFileInfo
2
1271}-
1272-
1273-
1274/*!-
1275 Returns the file size in bytes. If the file does not exist or cannot be-
1276 fetched, 0 is returned.-
1277-
1278 \sa exists()-
1279*/-
1280qint64 QFileInfo::size() const-
1281{-
1282 Q_D(const QFileInfo);-
1283 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFileInfo
FALSEevaluated 10450 times by 54 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGroupBox
  • tst_QIcon
  • ...
1-10450
1284 return 0;
executed 1 time by 1 test: return 0;
Executed by:
  • tst_QFileInfo
1
1285 if (d->fileEngine == 0) {
d->fileEngine == 0Description
TRUEevaluated 9355 times by 46 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QItemModel
  • tst_QLabel
  • tst_QLineEdit
  • tst_QMessageBox
  • ...
FALSEevaluated 1095 times by 31 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGroupBox
  • tst_QIcon
  • tst_QLineEdit
  • tst_QMdiSubWindow
  • tst_QMessageBox
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QPrinter
  • tst_QResourceEngine
  • tst_QSettings
  • tst_QSidebar
  • tst_QStyle
  • ...
1095-9355
1286 if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::SizeAttribute))
!d->cache_enabledDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QProcess
FALSEevaluated 9353 times by 45 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QItemModel
  • tst_QLabel
  • tst_QLineEdit
  • tst_QMessageBox
  • ...
!d->metaData.h...SizeAttribute)Description
TRUEevaluated 4874 times by 20 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDir
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QItemModel
  • tst_QLabel
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QResourceEngine
  • tst_QSettings
  • tst_QTemporaryFile
  • tst_QTextFormat
  • tst_languageChange
FALSEevaluated 4479 times by 41 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QItemModel
  • tst_QLabel
  • tst_QLineEdit
  • tst_QMessageBox
  • tst_QNetworkDiskCache
  • ...
2-9353
1287 QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::SizeAttribute);
executed 4876 times by 21 tests: QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::SizeAttribute);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDir
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QItemModel
  • tst_QLabel
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QProcess
  • tst_QResourceEngine
  • tst_QSettings
  • tst_QTemporaryFile
  • tst_QTextFormat
  • tst_languageChange
4876
1288 return d->metaData.size();
executed 9355 times by 46 tests: return d->metaData.size();
Executed by:
  • tst_LargeFile
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDir
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QItemModel
  • tst_QLabel
  • tst_QLineEdit
  • tst_QMessageBox
  • ...
9355
1289 }-
1290 if (!d->getCachedFlag(QFileInfoPrivate::CachedSize)) {
!d->getCachedF...e::CachedSize)Description
TRUEevaluated 1066 times by 31 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGroupBox
  • tst_QIcon
  • tst_QLineEdit
  • tst_QMdiSubWindow
  • tst_QMessageBox
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QPrinter
  • tst_QResourceEngine
  • tst_QSettings
  • tst_QSidebar
  • tst_QStyle
  • ...
FALSEevaluated 29 times by 3 tests
Evaluated by:
  • tst_QIcon
  • tst_QSettings
  • tst_selftests - unknown status
29-1066
1291 d->setCachedFlag(QFileInfoPrivate::CachedSize);-
1292 d->fileSize = d->fileEngine->size();-
1293 }
executed 1066 times by 31 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGroupBox
  • tst_QIcon
  • tst_QLineEdit
  • tst_QMdiSubWindow
  • tst_QMessageBox
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QPrinter
  • tst_QResourceEngine
  • tst_QSettings
  • tst_QSidebar
  • tst_QStyle
  • ...
1066
1294 return d->fileSize;
executed 1095 times by 31 tests: return d->fileSize;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGroupBox
  • tst_QIcon
  • tst_QLineEdit
  • tst_QMdiSubWindow
  • tst_QMessageBox
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QPrinter
  • tst_QResourceEngine
  • tst_QSettings
  • tst_QSidebar
  • tst_QStyle
  • ...
1095
1295}-
1296-
1297/*!-
1298 Returns the date and time when the file was created.-
1299-
1300 On most Unix systems, this function returns the time of the last-
1301 status change. A status change occurs when the file is created,-
1302 but it also occurs whenever the user writes or sets inode-
1303 information (for example, changing the file permissions).-
1304-
1305 If neither creation time nor "last status change" time are not-
1306 available, returns the same as lastModified().-
1307-
1308 \sa lastModified(), lastRead()-
1309*/-
1310QDateTime QFileInfo::created() const-
1311{-
1312 Q_D(const QFileInfo);-
1313 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFileInfo
FALSEevaluated 104 times by 3 tests
Evaluated by:
  • tst_QFileInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
1-104
1314 return QDateTime();
executed 1 time by 1 test: return QDateTime();
Executed by:
  • tst_QFileInfo
1
1315 if (d->fileEngine == 0) {
d->fileEngine == 0Description
TRUEevaluated 104 times by 3 tests
Evaluated by:
  • tst_QFileInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEnever evaluated
0-104
1316 if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::CreationTime))
!d->cache_enabledDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QFileInfo
FALSEevaluated 102 times by 3 tests
Evaluated by:
  • tst_QFileInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
!d->metaData.h...:CreationTime)Description
TRUEevaluated 102 times by 3 tests
Evaluated by:
  • tst_QFileInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEnever evaluated
0-102
1317 if (!QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::CreationTime))
!QFileSystemEn...:CreationTime)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QFileInfo
FALSEevaluated 101 times by 3 tests
Evaluated by:
  • tst_QFileInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
3-101
1318 return QDateTime();
executed 3 times by 1 test: return QDateTime();
Executed by:
  • tst_QFileInfo
3
1319 return d->metaData.creationTime();
executed 101 times by 3 tests: return d->metaData.creationTime();
Executed by:
  • tst_QFileInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
101
1320 }-
1321 return d->getFileTime(QAbstractFileEngine::CreationTime);
never executed: return d->getFileTime(QAbstractFileEngine::CreationTime);
0
1322}-
1323-
1324/*!-
1325 Returns the date and time when the file was last modified.-
1326-
1327 \sa created(), lastRead()-
1328*/-
1329QDateTime QFileInfo::lastModified() const-
1330{-
1331 Q_D(const QFileInfo);-
1332 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFileInfo
FALSEevaluated 11574 times by 55 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDir
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGraphicsWidget
  • tst_QGroupBox
  • ...
1-11574
1333 return QDateTime();
executed 1 time by 1 test: return QDateTime();
Executed by:
  • tst_QFileInfo
1
1334 if (d->fileEngine == 0) {
d->fileEngine == 0Description
TRUEevaluated 10575 times by 47 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDir
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QItemModel
  • ...
FALSEevaluated 999 times by 29 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGroupBox
  • tst_QIcon
  • tst_QLineEdit
  • tst_QMdiSubWindow
  • tst_QMessageBox
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QPrinter
  • tst_QSettings
  • tst_QSidebar
  • tst_QStyle
  • tst_QStyleSheetStyle
  • tst_QTextBrowser
  • ...
999-10575
1335 if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::ModificationTime))
!d->cache_enabledDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QFileInfo
FALSEevaluated 10573 times by 47 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDir
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QItemModel
  • ...
!d->metaData.h...ificationTime)Description
TRUEevaluated 4525 times by 42 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDir
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QItemModel
  • tst_QLabel
  • tst_QLineEdit
  • ...
FALSEevaluated 6048 times by 39 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • tst_QItemModel
  • tst_QLabel
  • tst_QLineEdit
  • tst_QMessageBox
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • tst_QPixmap
  • ...
2-10573
1336 if (!QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::ModificationTime))
!QFileSystemEn...ificationTime)Description
TRUEevaluated 2911 times by 10 tests
Evaluated by:
  • tst_QColorDialog
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QLabel
  • tst_QPixmap
  • tst_QSettings
  • tst_QTextFormat
  • tst_languageChange
FALSEevaluated 1616 times by 38 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDir
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QItemModel
  • tst_QLabel
  • tst_QLineEdit
  • tst_QLockFile
  • ...
1616-2911
1337 return QDateTime();
executed 2911 times by 10 tests: return QDateTime();
Executed by:
  • tst_QColorDialog
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QLabel
  • tst_QPixmap
  • tst_QSettings
  • tst_QTextFormat
  • tst_languageChange
2911
1338 return d->metaData.modificationTime();
executed 7664 times by 46 tests: return d->metaData.modificationTime();
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDir
  • tst_QErrorMessage
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFrame
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QItemModel
  • ...
7664
1339 }-
1340 return d->getFileTime(QAbstractFileEngine::ModificationTime);
executed 999 times by 29 tests: return d->getFileTime(QAbstractFileEngine::ModificationTime);
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGroupBox
  • tst_QIcon
  • tst_QLineEdit
  • tst_QMdiSubWindow
  • tst_QMessageBox
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QPrinter
  • tst_QSettings
  • tst_QSidebar
  • tst_QStyle
  • tst_QStyleSheetStyle
  • tst_QTextBrowser
  • ...
999
1341}-
1342-
1343/*!-
1344 Returns the date and time when the file was last read (accessed).-
1345-
1346 On platforms where this information is not available, returns the-
1347 same as lastModified().-
1348-
1349 \sa created(), lastModified()-
1350*/-
1351QDateTime QFileInfo::lastRead() const-
1352{-
1353 Q_D(const QFileInfo);-
1354 if (d->isDefaultConstructed)
d->isDefaultConstructedDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFileInfo
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QFileInfo
1-6
1355 return QDateTime();
executed 1 time by 1 test: return QDateTime();
Executed by:
  • tst_QFileInfo
1
1356 if (d->fileEngine == 0) {
d->fileEngine == 0Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_QFileInfo
FALSEnever evaluated
0-6
1357 if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::AccessTime))
!d->cache_enabledDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QFileInfo
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QFileInfo
!d->metaData.h...a::AccessTime)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QFileInfo
FALSEnever evaluated
0-4
1358 if (!QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::AccessTime))
!QFileSystemEn...a::AccessTime)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QFileInfo
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QFileInfo
3
1359 return QDateTime();
executed 3 times by 1 test: return QDateTime();
Executed by:
  • tst_QFileInfo
3
1360 return d->metaData.accessTime();
executed 3 times by 1 test: return d->metaData.accessTime();
Executed by:
  • tst_QFileInfo
3
1361 }-
1362 return d->getFileTime(QAbstractFileEngine::AccessTime);
never executed: return d->getFileTime(QAbstractFileEngine::AccessTime);
0
1363}-
1364-
1365/*!-
1366 \internal-
1367*/-
1368QFileInfoPrivate* QFileInfo::d_func()-
1369{-
1370 return d_ptr.data();
executed 29 times by 5 tests: return d_ptr.data();
Executed by:
  • tst_QDirModel
  • tst_QFileInfo
  • tst_QFileSystemWatcher
  • tst_QProcess
  • tst_QResourceEngine
29
1371}-
1372-
1373/*!-
1374 Returns \c true if caching is enabled; otherwise returns \c false.-
1375-
1376 \sa setCaching(), refresh()-
1377*/-
1378bool QFileInfo::caching() const-
1379{-
1380 Q_D(const QFileInfo);-
1381 return d->cache_enabled;
executed 13 times by 1 test: return d->cache_enabled;
Executed by:
  • tst_QFileInfo
13
1382}-
1383-
1384/*!-
1385 If \a enable is true, enables caching of file information. If \a-
1386 enable is false caching is disabled.-
1387-
1388 When caching is enabled, QFileInfo reads the file information from-
1389 the file system the first time it's needed, but generally not-
1390 later.-
1391-
1392 Caching is enabled by default.-
1393-
1394 \sa refresh(), caching()-
1395*/-
1396void QFileInfo::setCaching(bool enable)-
1397{-
1398 Q_D(QFileInfo);-
1399 d->cache_enabled = enable;-
1400}
executed 21 times by 4 tests: end of block
Executed by:
  • tst_QDirModel
  • tst_QFileInfo
  • tst_QProcess
  • tst_QResourceEngine
21
1401-
1402/*!-
1403 \typedef QFileInfoList-
1404 \relates QFileInfo-
1405-
1406 Synonym for QList<QFileInfo>.-
1407*/-
1408-
1409QT_END_NAMESPACE-
Source codeSwitch to Preprocessed file

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