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

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