qfilesystemengine_unix.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/io/qfilesystemengine_unix.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10QFileSystemEntry QFileSystemEngine::getLinkTarget(const QFileSystemEntry &link, QFileSystemMetaData &data)-
11{-
12 char s[4096 +1];-
13 int len = readlink(link.nativeFilePath().constData(), s, 4096);-
14-
15 if (len > 0) {-
16 QString ret;-
17 if (!data.hasFlags(QFileSystemMetaData::DirectoryType))-
18 fillMetaData(link, data, QFileSystemMetaData::DirectoryType);-
19 if (data.isDirectory() && s[0] != '/') {-
20 QDir parent(link.filePath());-
21 parent.cdUp();-
22 ret = parent.path();-
23 if (!ret.isEmpty() && !ret.endsWith(QLatin1Char('/')))-
24 ret += QLatin1Char('/');-
25 }-
26 s[len] = '\0';-
27 ret += QFile::decodeName(QByteArray(s));-
28-
29-
30-
31-
32 if (!ret.startsWith(QLatin1Char('/'))) {-
33 if (link.filePath().startsWith(QLatin1Char('/'))) {-
34 ret.prepend(link.filePath().left(link.filePath().lastIndexOf(QLatin1Char('/')))-
35 + QLatin1Char('/'));-
36 } else {-
37 ret.prepend(QDir::currentPath() + QLatin1Char('/'));-
38 }-
39 }-
40 ret = QDir::cleanPath(ret);-
41 if (ret.size() > 1 && ret.endsWith(QLatin1Char('/')))-
42 ret.chop(1);-
43 return QFileSystemEntry(ret);-
44 }-
45 return QFileSystemEntry();-
46}-
47-
48-
49QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry, QFileSystemMetaData &data)-
50{-
51 if (entry.isEmpty() || entry.isRoot())-
52 return entry;-
53-
54-
55-
56-
57-
58-
59 char *ret = 0;-
60 ret = realpath(entry.nativeFilePath().constData(), (char*)0);-
61 if (ret) {-
62 data.knownFlagsMask |= QFileSystemMetaData::ExistsAttribute;-
63 data.entryFlags |= QFileSystemMetaData::ExistsAttribute;-
64 QString canonicalPath = QDir::cleanPath(QFile::decodeName(ret));-
65 free(ret);-
66 return QFileSystemEntry(canonicalPath);-
67 } else if ((*__errno_location ()) == 2) {-
68 data.knownFlagsMask |= QFileSystemMetaData::ExistsAttribute;-
69 data.entryFlags &= ~(QFileSystemMetaData::ExistsAttribute);-
70 return QFileSystemEntry();-
71 }-
72 return entry;-
73-
74}-
75-
76-
77QFileSystemEntry QFileSystemEngine::absoluteName(const QFileSystemEntry &entry)-
78{-
79 if (entry.isAbsolute() && entry.isClean())-
80 return entry;-
81-
82 QByteArray orig = entry.nativeFilePath();-
83 QByteArray result;-
84 if (orig.isEmpty() || !orig.startsWith('/')) {-
85 QFileSystemEntry cur(currentPath());-
86 result = cur.nativeFilePath();-
87 }-
88 if (!orig.isEmpty() && !(orig.length() == 1 && orig[0] == '.')) {-
89 if (!result.isEmpty() && !result.endsWith('/'))-
90 result.append('/');-
91 result.append(orig);-
92 }-
93-
94 if (result.length() == 1 && result[0] == '/')-
95 return QFileSystemEntry(result, QFileSystemEntry::FromNativePath());-
96 const bool isDir = result.endsWith('/');-
97-
98-
99-
100-
101-
102 QFileSystemEntry resultingEntry(result, QFileSystemEntry::FromNativePath());-
103 QString stringVersion = QDir::cleanPath(resultingEntry.filePath());-
104 if (isDir)-
105 stringVersion.append(QLatin1Char('/'));-
106 return QFileSystemEntry(stringVersion);-
107}-
108-
109-
110QByteArray QFileSystemEngine::id(const QFileSystemEntry &entry)-
111{-
112 struct stat statResult;-
113 if (stat(entry.nativeFilePath().constData(), &statResult)) {-
114 qErrnoWarning("stat() failed for '%s'", entry.nativeFilePath().constData());-
115 return QByteArray();-
116 }-
117 QByteArray result = QByteArray::number(quint64(statResult.st_dev), 16);-
118 result += ':';-
119 result += QByteArray::number(quint64(statResult.st_ino));-
120 return result;-
121}-
122-
123-
124QString QFileSystemEngine::resolveUserName(uint userId)-
125{-
126-
127 int size_max = sysconf(_SC_GETPW_R_SIZE_MAX);-
128 if (size_max == -1
size_max == -1Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFileInfo
)
0-1
129 size_max = 1024;
never executed: size_max = 1024;
0
130 QVarLengthArray<char, 1024> buf(size_max);-
131-
132-
133-
134 struct passwd *pw = 0;-
135-
136 struct passwd entry;-
137 getpwuid_r(userId, &entry, buf.data(), buf.size(), &pw);-
138-
139-
140-
141 if (pw
pwDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFileInfo
FALSEnever evaluated
)
0-1
142 return
executed 1 time by 1 test: return QFile::decodeName(QByteArray(pw->pw_name));
Executed by:
  • tst_QFileInfo
QFile::decodeName(QByteArray(pw->pw_name));
executed 1 time by 1 test: return QFile::decodeName(QByteArray(pw->pw_name));
Executed by:
  • tst_QFileInfo
1
143-
144 return
never executed: return QString();
QString();
never executed: return QString();
0
145}-
146-
147-
148QString QFileSystemEngine::resolveGroupName(uint groupId)-
149{-
150-
151 int size_max = sysconf(_SC_GETPW_R_SIZE_MAX);-
152 if (size_max == -1
size_max == -1Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFileInfo
)
0-1
153 size_max = 1024;
never executed: size_max = 1024;
0
154 QVarLengthArray<char, 1024> buf(size_max);-
155-
156-
157-
158 struct group *gr = 0;-
159-
160 size_max = sysconf(_SC_GETGR_R_SIZE_MAX);-
161 if (size_max == -1
size_max == -1Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFileInfo
)
0-1
162 size_max = 1024;
never executed: size_max = 1024;
0
163 buf.resize(size_max);-
164 struct group entry;-
165-
166-
167 for (unsigned size = size_max; size < 256000
size < 256000Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFileInfo
FALSEnever evaluated
; size += size)
0-1
168 {-
169 buf.resize(size);-
170-
171 if (!getgrgid_r(groupId, &entry, buf.data(), buf.size(), &gr)
!getgrgid_r(gr...f.size(), &gr)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFileInfo
FALSEnever evaluated
0-1
172 || (*
(*__errno_location ()) != 34Description
TRUEnever evaluated
FALSEnever evaluated
__errno_location ()) != 34
(*__errno_location ()) != 34Description
TRUEnever evaluated
FALSEnever evaluated
)
0
173 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QFileInfo
1
174 }
never executed: end of block
0
175-
176-
177-
178 if (gr
grDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFileInfo
FALSEnever evaluated
)
0-1
179 return
executed 1 time by 1 test: return QFile::decodeName(QByteArray(gr->gr_name));
Executed by:
  • tst_QFileInfo
QFile::decodeName(QByteArray(gr->gr_name));
executed 1 time by 1 test: return QFile::decodeName(QByteArray(gr->gr_name));
Executed by:
  • tst_QFileInfo
1
180-
181 return
never executed: return QString();
QString();
never executed: return QString();
0
182}-
183bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemMetaData &data,-
184 QFileSystemMetaData::MetaDataFlags what)-
185{-
186 if (what & QFileSystemMetaData::PosixStatFlags)-
187 what |= QFileSystemMetaData::PosixStatFlags;-
188-
189 if (what & QFileSystemMetaData::ExistsAttribute) {-
190-
191 what |= QFileSystemMetaData::PosixStatFlags;-
192 }-
193-
194 data.entryFlags &= ~what;-
195-
196 const char * nativeFilePath;-
197 int nativeFilePathLength;-
198 {-
199 const QByteArray &path = entry.nativeFilePath();-
200 nativeFilePath = path.constData();-
201 nativeFilePathLength = path.size();-
202 (void)nativeFilePathLength;;-
203 }-
204-
205 bool entryExists = true;-
206-
207 struct stat64 statBuffer;-
208 bool statBufferValid = false;-
209 if (what & QFileSystemMetaData::LinkType) {-
210 if (::lstat64(nativeFilePath, &statBuffer) == 0) {-
211 if (((((statBuffer.st_mode)) & 0170000) == (0120000))) {-
212 data.entryFlags |= QFileSystemMetaData::LinkType;-
213 } else {-
214 statBufferValid = true;-
215 data.entryFlags &= ~QFileSystemMetaData::PosixStatFlags;-
216 }-
217 } else {-
218 entryExists = false;-
219 }-
220-
221 data.knownFlagsMask |= QFileSystemMetaData::LinkType;-
222 }-
223-
224 if (statBufferValid || (what & QFileSystemMetaData::PosixStatFlags)) {-
225 if (entryExists && !statBufferValid)-
226 statBufferValid = (::stat64(nativeFilePath, &statBuffer) == 0);-
227-
228 if (statBufferValid)-
229 data.fillFromStatBuf(statBuffer);-
230 else {-
231 entryExists = false;-
232 data.creationTime_ = 0;-
233 data.modificationTime_ = 0;-
234 data.accessTime_ = 0;-
235 data.size_ = 0;-
236 data.userId_ = (uint) -2;-
237 data.groupId_ = (uint) -2;-
238 }-
239-
240-
241 data.knownFlagsMask |= QFileSystemMetaData::PosixStatFlags-
242 | QFileSystemMetaData::ExistsAttribute;-
243 }-
244 if (what & QFileSystemMetaData::UserPermissions) {-
245-
246-
247 if (entryExists) {-
248 if (what & QFileSystemMetaData::UserReadPermission) {-
249 if (::access(nativeFilePath, 4) == 0)-
250 data.entryFlags |= QFileSystemMetaData::UserReadPermission;-
251 }-
252 if (what & QFileSystemMetaData::UserWritePermission) {-
253 if (::access(nativeFilePath, 2) == 0)-
254 data.entryFlags |= QFileSystemMetaData::UserWritePermission;-
255 }-
256 if (what & QFileSystemMetaData::UserExecutePermission) {-
257 if (::access(nativeFilePath, 1) == 0)-
258 data.entryFlags |= QFileSystemMetaData::UserExecutePermission;-
259 }-
260 }-
261 data.knownFlagsMask |= (what & QFileSystemMetaData::UserPermissions);-
262 }-
263-
264 if (what & QFileSystemMetaData::HiddenAttribute-
265 && !data.isHidden()) {-
266 QString fileName = entry.fileName();-
267 if ((fileName.size() > 0 && fileName.at(0) == QLatin1Char('.'))-
268-
269-
270-
271 )-
272 data.entryFlags |= QFileSystemMetaData::HiddenAttribute;-
273 data.knownFlagsMask |= QFileSystemMetaData::HiddenAttribute;-
274 }-
275 if (!entryExists) {-
276 data.clearFlags(what);-
277 return false;-
278 }-
279 return data.hasFlags(what);-
280}-
281-
282-
staticbool pathIsDirQFileSystemEngine::createDirectory(const QByteArray &nativeNameQFileSystemEntry &entry, bool createParents)
284{-
285 struct stat64 st;-
return ::stat64(nativeNameQString dirName = entry.constData(), &st) == 0 &&filePath();
286 if (st.st_mode & 0170000createParents
createParentsDescription
TRUEevaluated 398 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
FALSEevaluated 1425 times by 18 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSaveFile
  • tst_QTemporaryDir
  • tst_QTemporaryFile
  • tst_qstandardpaths
  • tst_uic
) == 0040000;
398-1425
};
static bool createDirectoryWithParents{
287 dirName = QDir::cleanPath(const QByteArray &nativeNamedirName);-
288 for (int oldslash = -1, bool shouldMkdirFirstslash=true0; slash != -1
slash != -1Description
TRUEevaluated 3059 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
FALSEnever evaluated
; oldslash = slash
) {
0-3059
289 ifslash = dirName.indexOf(shouldMkdirFirst &&QDir::mkdirseparator(), oldslash+1);-
290 if (nativeName, 0777)slash
slash == -1Description
TRUEevaluated 794 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
FALSEevaluated 2265 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
== 0-1
slash == -1Description
TRUEevaluated 794 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
FALSEevaluated 2265 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
) return true;{
794-2265
291 if ((*__errno_location ()) == 17)396-398
return pathIsDir(nativeName);
if ((*__errno_locationoldslash == dirName.length
oldslash == dirName.length()Description
TRUEevaluated 396 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
FALSEevaluated 398 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
()
oldslash == dirName.length()Description
TRUEevaluated 396 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
FALSEevaluated 398 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
)
292 != 2)396
return falsebreak
executed 396 times by 13 tests: break;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
;
executed 396 times by 13 tests: break;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
293 intslash = nativeNamedirName.lastIndexOf('/');length();-
294 }
executed 398 times by 13 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
398
295 if (slash< 1
slashDescription
TRUEevaluated 2266 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
FALSEevaluated 397 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
) return false;{
397-2266
296 const QByteArray parentNativeNamechunk = nativeNameQFile::encodeName(dirName.left(slash);-
if (!createDirectoryWithParents(parentNativeName))
return false;));
297 if (::
::mkdir(chunk....(), 0777) != 0Description
TRUEevaluated 1769 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
FALSEevaluated 497 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
mkdir(nativeName,chunk.constData(), 0777) ==!= 0
::mkdir(chunk....(), 0777) != 0Description
TRUEevaluated 1769 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
FALSEevaluated 497 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
) return true;
497-1769
return (*{
298 if ((*
(*__errno_location ()) == 17Description
TRUEevaluated 1769 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
FALSEnever evaluated
(*__errno_location ()) == 17Description
TRUEevaluated 1769 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
FALSEnever evaluated
(*__errno_location ()) == 17Description
TRUEevaluated 1769 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
FALSEnever evaluated
__errno_location ()) == 17
(*__errno_location ()) == 17Description
TRUEevaluated 1769 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
FALSEnever evaluated
0-1769
299-
300-
301-
302-
303-
304-
305 && pathIsDir(nativeName);-
}
bool QFileSystemEngine::createDirectory(const QFileSystemEntry &entry, bool createParents) {
306 QString dirName = entry.filePath();-
whilestruct stat64 st;
307 if (::
::stat64(chunk...a(), &st) == 0Description
TRUEevaluated 1769 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
FALSEnever evaluated
stat64
::stat64(chunk...a(), &st) == 0Description
TRUEevaluated 1769 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
FALSEnever evaluated
::stat64(chunk...a(), &st) == 0Description
TRUEevaluated 1769 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
FALSEnever evaluated
(dirNamechunk.size() > 1constData(), &st) == 0
::stat64(chunk...a(), &st) == 0Description
TRUEevaluated 1769 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
FALSEnever evaluated
&& dirName.endsWith(QLatin1Char(
(st.st_mode & ...00) == 0040000Description
TRUEevaluated 1767 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QDir
  • tst_qmakelib
'/')))
(st.st_mode & ...00) == 0040000Description
TRUEevaluated 1767 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QDir
  • tst_qmakelib
0-1769
dirName
(st.st_mode & ...00) == 0040000Description
TRUEevaluated 1767 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QDir
  • tst_qmakelib
(st.st_mode & ...00) == 0040000Description
TRUEevaluated 1767 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QDir
  • tst_qmakelib
st.chop(1);
(st.st_mode & ...00) == 0040000Description
TRUEevaluated 1767 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QDir
  • tst_qmakelib
QByteArray nativeName = QFile::encodeName(dirName);
(st.st_mode & ...00) == 0040000Description
TRUEevaluated 1767 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QDir
  • tst_qmakelib
if (::mkdir(nativeName, 0777
(st.st_mode & ...00) == 0040000Description
TRUEevaluated 1767 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QDir
  • tst_qmakelib
(st.st_mode & ...00) == 0040000Description
TRUEevaluated 1767 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QDir
  • tst_qmakelib
st_mode & 0170000) == 00040000
(st.st_mode & ...00) == 0040000Description
TRUEevaluated 1767 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QDir
  • tst_qmakelib
)
308 return truecontinue
executed 1767 times by 13 tests: continue;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
;
executed 1767 times by 13 tests: continue;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
1767
309 if (!createParents)}
executed 2 times by 2 tests: end of block
Executed by:
  • tst_QDir
  • tst_qmakelib
2
310 return
executed 2 times by 2 tests: return false;
Executed by:
  • tst_QDir
  • tst_qmakelib
false;
executed 2 times by 2 tests: return false;
Executed by:
  • tst_QDir
  • tst_qmakelib
2
311 int savedErrno = (*__errno_location ());-
bool pathChanged}
312 }
executed 497 times by 13 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
497
313 }
executed 894 times by 13 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
894
314 return
executed 396 times by 13 tests: return true;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
true
executed 396 times by 13 tests: return true;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
executed 396 times by 13 tests: return true;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
;
executed 396 times by 13 tests: return true;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QCompleter
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSettings
  • tst_languageChange
  • tst_qmakelib
  • tst_selftests - unknown status
396
315 {-
QString cleanName = QDir::cleanPath(dirName);
pathChanged = !dirName.isSharedWith(cleanName);
if}
316-
317-
318-
319-
320 return
executed 1425 times by 18 tests: return (::mkdir(QFile::encodeName(dirName).constData(), 0777) == 0);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSaveFile
  • tst_QTemporaryDir
  • tst_QTemporaryFile
  • tst_qstandardpaths
  • tst_uic
(::mkdir
executed 1425 times by 18 tests: return (::mkdir(QFile::encodeName(dirName).constData(), 0777) == 0);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSaveFile
  • tst_QTemporaryDir
  • tst_QTemporaryFile
  • tst_qstandardpaths
  • tst_uic
executed 1425 times by 18 tests: return (::mkdir(QFile::encodeName(dirName).constData(), 0777) == 0);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSaveFile
  • tst_QTemporaryDir
  • tst_QTemporaryFile
  • tst_qstandardpaths
  • tst_uic
(pathChanged)
executed 1425 times by 18 tests: return (::mkdir(QFile::encodeName(dirName).constData(), 0777) == 0);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSaveFile
  • tst_QTemporaryDir
  • tst_QTemporaryFile
  • tst_qstandardpaths
  • tst_uic
1425
nativeName =
executed 1425 times by 18 tests: return (::mkdir(QFile::encodeName(dirName).constData(), 0777) == 0);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSaveFile
  • tst_QTemporaryDir
  • tst_QTemporaryFile
  • tst_qstandardpaths
  • tst_uic
executed 1425 times by 18 tests: return (::mkdir(QFile::encodeName(dirName).constData(), 0777) == 0);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSaveFile
  • tst_QTemporaryDir
  • tst_QTemporaryFile
  • tst_qstandardpaths
  • tst_uic
QFile::encodeName(cleanName);
executed 1425 times by 18 tests: return (::mkdir(QFile::encodeName(dirName).constData(), 0777) == 0);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSaveFile
  • tst_QTemporaryDir
  • tst_QTemporaryFile
  • tst_qstandardpaths
  • tst_uic
}
executed 1425 times by 18 tests: return (::mkdir(QFile::encodeName(dirName).constData(), 0777) == 0);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSaveFile
  • tst_QTemporaryDir
  • tst_QTemporaryFile
  • tst_qstandardpaths
  • tst_uic
(*__errno_location ()) = savedErrno;
executed 1425 times by 18 tests: return (::mkdir(QFile::encodeName(dirName).constData(), 0777) == 0);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSaveFile
  • tst_QTemporaryDir
  • tst_QTemporaryFile
  • tst_qstandardpaths
  • tst_uic
return createDirectoryWithParents
executed 1425 times by 18 tests: return (::mkdir(QFile::encodeName(dirName).constData(), 0777) == 0);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSaveFile
  • tst_QTemporaryDir
  • tst_QTemporaryFile
  • tst_qstandardpaths
  • tst_uic
executed 1425 times by 18 tests: return (::mkdir(QFile::encodeName(dirName).constData(), 0777) == 0);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSaveFile
  • tst_QTemporaryDir
  • tst_QTemporaryFile
  • tst_qstandardpaths
  • tst_uic
(nativeName, pathChangeddirName).constData(), 0777) == 0);
executed 1425 times by 18 tests: return (::mkdir(QFile::encodeName(dirName).constData(), 0777) == 0);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSaveFile
  • tst_QTemporaryDir
  • tst_QTemporaryFile
  • tst_qstandardpaths
  • tst_uic
321}-
322-
323-
324bool QFileSystemEngine::removeDirectory(const QFileSystemEntry &entry, bool removeEmptyParents)-
325{-
326 if (removeEmptyParents) {-
327 QString dirName = QDir::cleanPath(entry.filePath());-
328 for (int oldslash = 0, slash=dirName.length(); slash > 0; oldslash = slash) {-
329 const QByteArray chunk = QFile::encodeName(dirName.left(slash));-
330 struct stat64 st;-
331 if (::stat64(chunk.constData(), &st) != -1) {-
332 if ((st.st_mode & 0170000) != 0040000)-
333 return false;-
334 if (::rmdir(chunk.constData()) != 0)-
335 return oldslash != 0;-
336 } else {-
337 return false;-
338 }-
339 slash = dirName.lastIndexOf(QDir::separator(), oldslash-1);-
340 }-
341 return true;-
342 }-
343 return rmdir(QFile::encodeName(entry.filePath()).constData()) == 0;-
344}-
345-
346-
347bool QFileSystemEngine::createLink(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error)-
348{-
349 if (::symlink(source.nativeFilePath().constData(), target.nativeFilePath().constData()) == 0)-
350 return true;-
351 error = QSystemError((*__errno_location ()), QSystemError::StandardLibraryError);-
352 return false;-
353}-
354-
355-
356bool QFileSystemEngine::copyFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error)-
357{-
358 (void)source;;-
359 (void)target;;-
360 error = QSystemError(38, QSystemError::StandardLibraryError);-
361 return false;-
362}-
363-
364-
365bool QFileSystemEngine::renameFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error)-
366{-
367 if (::rename(source.nativeFilePath().constData(), target.nativeFilePath().constData()) == 0)-
368 return true;-
369 error = QSystemError((*__errno_location ()), QSystemError::StandardLibraryError);-
370 return false;-
371}-
372-
373-
374bool QFileSystemEngine::removeFile(const QFileSystemEntry &entry, QSystemError &error)-
375{-
376 if (unlink(entry.nativeFilePath().constData()) == 0)-
377 return true;-
378 error = QSystemError((*__errno_location ()), QSystemError::StandardLibraryError);-
379 return false;-
380-
381}-
382-
383-
384bool QFileSystemEngine::setPermissions(const QFileSystemEntry &entry, QFile::Permissions permissions, QSystemError &error, QFileSystemMetaData *data)-
385{-
386 mode_t mode = 0;-
387 if (permissions & (QFile::ReadOwner | QFile::ReadUser))-
388 mode |= 0400;-
389 if (permissions & (QFile::WriteOwner | QFile::WriteUser))-
390 mode |= 0200;-
391 if (permissions & (QFile::ExeOwner | QFile::ExeUser))-
392 mode |= 0100;-
393 if (permissions & QFile::ReadGroup)-
394 mode |= (0400 >> 3);-
395 if (permissions & QFile::WriteGroup)-
396 mode |= (0200 >> 3);-
397 if (permissions & QFile::ExeGroup)-
398 mode |= (0100 >> 3);-
399 if (permissions & QFile::ReadOther)-
400 mode |= ((0400 >> 3) >> 3);-
401 if (permissions & QFile::WriteOther)-
402 mode |= ((0200 >> 3) >> 3);-
403 if (permissions & QFile::ExeOther)-
404 mode |= ((0100 >> 3) >> 3);-
405-
406 bool success = ::chmod(entry.nativeFilePath().constData(), mode) == 0;-
407 if (success && data) {-
408 data->entryFlags &= ~QFileSystemMetaData::Permissions;-
409 data->entryFlags |= QFileSystemMetaData::MetaDataFlag(uint(permissions));-
410 data->knownFlagsMask |= QFileSystemMetaData::Permissions;-
411 }-
412 if (!success)-
413 error = QSystemError((*__errno_location ()), QSystemError::StandardLibraryError);-
414 return success;-
415}-
416-
417QString QFileSystemEngine::homePath()-
418{-
419 QString home = QFile::decodeName(qgetenv("HOME"));-
420 if (home.isEmpty())-
421 home = rootPath();-
422 return QDir::cleanPath(home);-
423}-
424-
425QString QFileSystemEngine::rootPath()-
426{-
427 return QLatin1String("/");-
428}-
429-
430QString QFileSystemEngine::tempPath()-
431{-
432-
433-
434-
435 QString temp = QFile::decodeName(qgetenv("TMPDIR"));-
436 if (temp.isEmpty()
temp.isEmpty()Description
TRUEevaluated 8783 times by 49 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QCompleter
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGuiApplication
  • tst_QIODevice
  • tst_QIcon
  • tst_QImageWriter
  • tst_QItemModel
  • tst_QLocalSocket
  • tst_QMetaType
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QPdfWriter
  • tst_QPixmap
  • ...
FALSEnever evaluated
) {
0-8783
437-
438-
439-
440-
441-
442 {-
443-
444 temp = QLatin1String("/tmp");-
445 }-
446 }
executed 8783 times by 49 tests: end of block
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QCompleter
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGuiApplication
  • tst_QIODevice
  • tst_QIcon
  • tst_QImageWriter
  • tst_QItemModel
  • tst_QLocalSocket
  • tst_QMetaType
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QPdfWriter
  • tst_QPixmap
  • ...
8783
447 return
executed 8783 times by 49 tests: return QDir::cleanPath(temp);
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QCompleter
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGuiApplication
  • tst_QIODevice
  • tst_QIcon
  • tst_QImageWriter
  • tst_QItemModel
  • tst_QLocalSocket
  • tst_QMetaType
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QPdfWriter
  • tst_QPixmap
  • ...
QDir::cleanPath(temp);
executed 8783 times by 49 tests: return QDir::cleanPath(temp);
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QCompleter
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDir
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGuiApplication
  • tst_QIODevice
  • tst_QIcon
  • tst_QImageWriter
  • tst_QItemModel
  • tst_QLocalSocket
  • tst_QMetaType
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QPdfWriter
  • tst_QPixmap
  • ...
8783
448-
449}-
450-
451bool QFileSystemEngine::setCurrentPath(const QFileSystemEntry &path)-
452{-
453 int r;-
454 r = ::chdir(path.nativeFilePath().constData());-
455 return r >= 0;-
456}-
457-
458QFileSystemEntry QFileSystemEngine::currentPath()-
459{-
460 QFileSystemEntry result;-
461-
462-
463-
464-
465-
466-
467-
468 char currentName[4096 +1];-
469 if (::getcwd(currentName, 4096)) {-
470-
471-
472-
473-
474-
475-
476-
477 result = QFileSystemEntry(QByteArray(currentName), QFileSystemEntry::FromNativePath());-
478 }-
479-
480 if (result.isEmpty())-
481 QMessageLogger(__FILE__, 793757, __PRETTY_FUNCTION__).warning("QFileSystemEngine::currentPath: getcwd() failed");-
482-
483-
484 return result;-
485}-
486-
Switch to Source codePreprocessed file

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