Skip to content

Commit fbba3d5

Browse files
committed
do not list directory by default upon QStatInfo construction
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
1 parent 843c9a0 commit fbba3d5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/core/io/qfilesystemwatcher_unix.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ QStringList QFileSystemWatcherEngineUnix::addPaths(const QStringList &paths,
4343
{
4444
QStringList p = paths;
4545
foreach (const QString &path, p) {
46-
QStatInfo fi(path);
46+
QStatInfo fi(path, true);
4747
if (fi.isDir() || path.endsWith(QLatin1Char('/'))) {
4848
if (!directories->contains(path))
4949
directories->append(path);
5050
if (!path.endsWith(QLatin1Char('/')))
51-
fi = QStatInfo(path + QLatin1Char('/'));
51+
fi = QStatInfo(path + QLatin1Char('/'), true);
5252
this->directories.insert(path, fi);
5353
} else {
5454
if (!files->contains(path))
@@ -107,9 +107,9 @@ void QFileSystemWatcherEngineUnix::timeout()
107107
while (dit.hasNext()) {
108108
QHash<QString, QStatInfo>::iterator x = dit.next();
109109
QString path = x.key();
110-
QStatInfo fi(path);
110+
QStatInfo fi(path, true);
111111
if (!path.endsWith(QLatin1Char('/')))
112-
fi = QStatInfo(path + QLatin1Char('/'));
112+
fi = QStatInfo(path + QLatin1Char('/'), true);
113113
if (!fi.dirEquals(x.value())) {
114114
if (!fi.exists()) {
115115
dit.remove();

src/core/kernel/qcore_unix_p.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ QT_BEGIN_NAMESPACE
6363

6464
class Q_CORE_EXPORT QStatInfo {
6565
public:
66-
QStatInfo(const QString &path, const bool listdir = true);
66+
QStatInfo(const QString &path, const bool listdir = false);
6767
QStatInfo(const QStatInfo &other);
6868

6969
QStatInfo& operator=(const QStatInfo &other);

0 commit comments

Comments
 (0)