qfilesystemmodel.cpp: Fix building with -no-feature-filesystemwatcher

Pick-to: 6.6
Fixes: QTBUG-120062
Change-Id: I2d4d0ff06b8088af81330ed0956b86f292c21cac
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 38dbd751640399a7887cf91fed73688df209a38d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Nodir Temirkhodjaev 2023-12-18 13:26:42 +03:00 committed by Qt Cherry-pick Bot
parent 3252ef72d4
commit 95acccea1f

View File

@ -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
}
/*!