From 38dbd751640399a7887cf91fed73688df209a38d Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Mon, 18 Dec 2023 13:26:42 +0300 Subject: qfilesystemmodel.cpp: Fix building with -no-feature-filesystemwatcher Pick-to: 6.7 6.6 Fixes: QTBUG-120062 Change-Id: I2d4d0ff06b8088af81330ed0956b86f292c21cac Reviewed-by: Volker Hilsheimer --- src/gui/itemmodels/qfilesystemmodel.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/gui/itemmodels/qfilesystemmodel.cpp') diff --git a/src/gui/itemmodels/qfilesystemmodel.cpp b/src/gui/itemmodels/qfilesystemmodel.cpp index 2000afc5b2..482b8537d5 100644 --- a/src/gui/itemmodels/qfilesystemmodel.cpp +++ b/src/gui/itemmodels/qfilesystemmodel.cpp @@ -2069,12 +2069,15 @@ QStringList QFileSystemModelPrivate::unwatchPathsAt(const QModelIndex &index) #endif // filesystemwatcher && Q_OS_WIN QFileSystemModelPrivate::QFileSystemModelPrivate() +#if QT_CONFIG(filesystemwatcher) : fileInfoGatherer(new QFileInfoGatherer) +#endif // filesystemwatcher { } QFileSystemModelPrivate::~QFileSystemModelPrivate() { +#if QT_CONFIG(filesystemwatcher) fileInfoGatherer->requestInterruption(); if (!fileInfoGatherer->wait(1000)) { // If the thread hangs, perhaps because the network was disconnected @@ -2085,6 +2088,7 @@ QFileSystemModelPrivate::~QFileSystemModelPrivate() auto *rawGatherer = fileInfoGatherer.release(); rawGatherer->deleteLater(); } +#endif // filesystemwatcher } /*! -- cgit v1.2.3