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

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>
(cherry picked from commit 95acccea1ffd175a4b3ffdd364e9628a38e1ec27)
This commit is contained in:
Nodir Temirkhodjaev 2023-12-18 13:26:42 +03:00 committed by Qt Cherry-pick Bot
parent 060cb0be9f
commit 57f02a814a

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