Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/corelib/io/qstorageinfo.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | QStorageInfo::QStorageInfo() | - | ||||||
4 | : d(new QStorageInfoPrivate) | - | ||||||
5 | { | - | ||||||
6 | } executed 4 times by 1 test: end of block Executed by:
| 4 | ||||||
7 | QStorageInfo::QStorageInfo(const QString &path) | - | ||||||
8 | : d(new QStorageInfoPrivate) | - | ||||||
9 | { | - | ||||||
10 | setPath(path); | - | ||||||
11 | } executed 24 times by 1 test: end of block Executed by:
| 24 | ||||||
12 | - | |||||||
13 | - | |||||||
14 | - | |||||||
15 | - | |||||||
16 | - | |||||||
17 | QStorageInfo::QStorageInfo(const QDir &dir) | - | ||||||
18 | : d(new QStorageInfoPrivate) | - | ||||||
19 | { | - | ||||||
20 | setPath(dir.absolutePath()); | - | ||||||
21 | } never executed: end of block | 0 | ||||||
22 | - | |||||||
23 | - | |||||||
24 | - | |||||||
25 | - | |||||||
26 | QStorageInfo::QStorageInfo(const QStorageInfo &other) | - | ||||||
27 | : d(other.d) | - | ||||||
28 | { | - | ||||||
29 | } executed 21 times by 1 test: end of block Executed by:
| 21 | ||||||
30 | - | |||||||
31 | - | |||||||
32 | - | |||||||
33 | - | |||||||
34 | QStorageInfo::~QStorageInfo() | - | ||||||
35 | { | - | ||||||
36 | } | - | ||||||
37 | - | |||||||
38 | - | |||||||
39 | - | |||||||
40 | - | |||||||
41 | QStorageInfo &QStorageInfo::operator=(const QStorageInfo &other) | - | ||||||
42 | { | - | ||||||
43 | d = other.d; | - | ||||||
44 | return never executed: *this;return *this; never executed: return *this; | 0 | ||||||
45 | } | - | ||||||
46 | void QStorageInfo::setPath(const QString &path) | - | ||||||
47 | { | - | ||||||
48 | if (d->rootPath == path
| 0-24 | ||||||
49 | return; never executed: return; | 0 | ||||||
50 | d.detach(); | - | ||||||
51 | d->rootPath = path; | - | ||||||
52 | d->doStat(); | - | ||||||
53 | } executed 24 times by 1 test: end of block Executed by:
| 24 | ||||||
54 | QString QStorageInfo::rootPath() const | - | ||||||
55 | { | - | ||||||
56 | return executed 8 times by 1 test: d->rootPath;return d->rootPath; Executed by:
executed 8 times by 1 test: return d->rootPath; Executed by:
| 8 | ||||||
57 | } | - | ||||||
58 | qint64 QStorageInfo::bytesAvailable() const | - | ||||||
59 | { | - | ||||||
60 | return executed 3 times by 1 test: d->bytesAvailable;return d->bytesAvailable; Executed by:
executed 3 times by 1 test: return d->bytesAvailable; Executed by:
| 3 | ||||||
61 | } | - | ||||||
62 | qint64 QStorageInfo::bytesFree() const | - | ||||||
63 | { | - | ||||||
64 | return executed 15 times by 1 test: d->bytesFree;return d->bytesFree; Executed by:
executed 15 times by 1 test: return d->bytesFree; Executed by:
| 15 | ||||||
65 | } | - | ||||||
66 | qint64 QStorageInfo::bytesTotal() const | - | ||||||
67 | { | - | ||||||
68 | return executed 24 times by 1 test: d->bytesTotal;return d->bytesTotal; Executed by:
executed 24 times by 1 test: return d->bytesTotal; Executed by:
| 24 | ||||||
69 | } | - | ||||||
70 | int QStorageInfo::blockSize() const | - | ||||||
71 | { | - | ||||||
72 | return executed 5 times by 1 test: d->blockSize;return d->blockSize; Executed by:
executed 5 times by 1 test: return d->blockSize; Executed by:
| 5 | ||||||
73 | } | - | ||||||
74 | QByteArray QStorageInfo::fileSystemType() const | - | ||||||
75 | { | - | ||||||
76 | return executed 15 times by 1 test: d->fileSystemType;return d->fileSystemType; Executed by:
executed 15 times by 1 test: return d->fileSystemType; Executed by:
| 15 | ||||||
77 | } | - | ||||||
78 | QByteArray QStorageInfo::device() const | - | ||||||
79 | { | - | ||||||
80 | return executed 48 times by 1 test: d->device;return d->device; Executed by:
executed 48 times by 1 test: return d->device; Executed by:
| 48 | ||||||
81 | } | - | ||||||
82 | QString QStorageInfo::name() const | - | ||||||
83 | { | - | ||||||
84 | return executed 5 times by 1 test: d->name;return d->name; Executed by:
executed 5 times by 1 test: return d->name; Executed by:
| 5 | ||||||
85 | } | - | ||||||
86 | - | |||||||
87 | - | |||||||
88 | - | |||||||
89 | - | |||||||
90 | QString QStorageInfo::displayName() const | - | ||||||
91 | { | - | ||||||
92 | if (!d->name.isEmpty()
| 0 | ||||||
93 | return never executed: d->name;return d->name; never executed: return d->name; | 0 | ||||||
94 | return never executed: d->rootPath;return d->rootPath; never executed: return d->rootPath; | 0 | ||||||
95 | } | - | ||||||
96 | bool QStorageInfo::isReadOnly() const | - | ||||||
97 | { | - | ||||||
98 | return executed 5 times by 1 test: d->readOnly;return d->readOnly; Executed by:
executed 5 times by 1 test: return d->readOnly; Executed by:
| 5 | ||||||
99 | } | - | ||||||
100 | bool QStorageInfo::isReady() const | - | ||||||
101 | { | - | ||||||
102 | return executed 7 times by 1 test: d->ready;return d->ready; Executed by:
executed 7 times by 1 test: return d->ready; Executed by:
| 7 | ||||||
103 | } | - | ||||||
104 | - | |||||||
105 | - | |||||||
106 | - | |||||||
107 | - | |||||||
108 | - | |||||||
109 | - | |||||||
110 | - | |||||||
111 | bool QStorageInfo::isValid() const | - | ||||||
112 | { | - | ||||||
113 | return executed 7 times by 1 test: d->valid;return d->valid; Executed by:
executed 7 times by 1 test: return d->valid; Executed by:
| 7 | ||||||
114 | } | - | ||||||
115 | void QStorageInfo::refresh() | - | ||||||
116 | { | - | ||||||
117 | d.detach(); | - | ||||||
118 | d->doStat(); | - | ||||||
119 | } executed 1 time by 1 test: end of block Executed by:
| 1 | ||||||
120 | QList<QStorageInfo> QStorageInfo::mountedVolumes() | - | ||||||
121 | { | - | ||||||
122 | return executed 2 times by 1 test: QStorageInfoPrivate::mountedVolumes();return QStorageInfoPrivate::mountedVolumes(); Executed by:
executed 2 times by 1 test: return QStorageInfoPrivate::mountedVolumes(); Executed by:
| 2 | ||||||
123 | } | - | ||||||
124 | - | |||||||
125 | namespace { namespace Q_QGS_getRoot { typedef QStorageInfo Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
executed 1 time by 1 test: }guard.store(QtGlobalStatic::Destroyed); Executed by:
executed 1 time by 1 test: }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type (QStorageInfoPrivate::root()))) : value (QStorageInfoPrivate::root()) { guard.store(QtGlobalStatic::Initialized); } } holder; returnend of block Executed by:
executed 10 times by 1 test: &holder.value;return &holder.value; Executed by:
executed 10 times by 1 test: } } } static QGlobalStatic<QStorageInfo, Q_QGS_getRoot::innerFunction, Q_QGS_getRoot::guard> getRoot;return &holder.value; Executed by:
| 0-10 | ||||||
126 | QStorageInfo QStorageInfo::root() | - | ||||||
127 | { | - | ||||||
128 | return executed 10 times by 1 test: *getRoot();return *getRoot(); Executed by:
executed 10 times by 1 test: return *getRoot(); Executed by:
| 10 | ||||||
129 | } | - | ||||||
130 | - | |||||||
Switch to Source code | Preprocessed file |