Skip to content

Commit

Permalink
do not list directory by default upon QStatInfo construction
Browse files Browse the repository at this point in the history
Signed-off-by: Ivailo Monev <[email protected]>
  • Loading branch information
fluxer committed Nov 23, 2021
1 parent 843c9a0 commit fbba3d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/core/io/qfilesystemwatcher_unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ QStringList QFileSystemWatcherEngineUnix::addPaths(const QStringList &paths,
{
QStringList p = paths;
foreach (const QString &path, p) {
QStatInfo fi(path);
QStatInfo fi(path, true);
if (fi.isDir() || path.endsWith(QLatin1Char('/'))) {
if (!directories->contains(path))
directories->append(path);
if (!path.endsWith(QLatin1Char('/')))
fi = QStatInfo(path + QLatin1Char('/'));
fi = QStatInfo(path + QLatin1Char('/'), true);
this->directories.insert(path, fi);
} else {
if (!files->contains(path))
Expand Down Expand Up @@ -107,9 +107,9 @@ void QFileSystemWatcherEngineUnix::timeout()
while (dit.hasNext()) {
QHash<QString, QStatInfo>::iterator x = dit.next();
QString path = x.key();
QStatInfo fi(path);
QStatInfo fi(path, true);
if (!path.endsWith(QLatin1Char('/')))
fi = QStatInfo(path + QLatin1Char('/'));
fi = QStatInfo(path + QLatin1Char('/'), true);
if (!fi.dirEquals(x.value())) {
if (!fi.exists()) {
dit.remove();
Expand Down
2 changes: 1 addition & 1 deletion src/core/kernel/qcore_unix_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ QT_BEGIN_NAMESPACE

class Q_CORE_EXPORT QStatInfo {
public:
QStatInfo(const QString &path, const bool listdir = true);
QStatInfo(const QString &path, const bool listdir = false);
QStatInfo(const QStatInfo &other);

QStatInfo& operator=(const QStatInfo &other);
Expand Down

0 comments on commit fbba3d5

Please sign in to comment.