aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
authorsh kim <sukhyun.kim@nokia.com>2012-03-22 11:19:43 +0900
committerQt by Nokia <qt-info@nokia.com>2012-05-03 01:22:29 +0200
commit9b789fd4e516577fa5dbffdf5dbfb4d7f99e985b (patch)
tree1561ff7a25b256af6cfd103101aa30245e26fc0c /src/imports
parenta54d51ee89aaf6ffc9f9b8e4f131829b0969f35f (diff)
Fix build error when QT_NO_FILESYSTEMWATCHER is set
Change-Id: I41cd921f6f779b8103e8dbef9c1f8e8e661fb4ad Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/folderlistmodel/fileinfothread.cpp14
-rw-r--r--src/imports/folderlistmodel/fileinfothread_p.h4
2 files changed, 18 insertions, 0 deletions
diff --git a/src/imports/folderlistmodel/fileinfothread.cpp b/src/imports/folderlistmodel/fileinfothread.cpp
index 3c4d60bb89..64acfbe798 100644
--- a/src/imports/folderlistmodel/fileinfothread.cpp
+++ b/src/imports/folderlistmodel/fileinfothread.cpp
@@ -48,7 +48,9 @@
FileInfoThread::FileInfoThread(QObject *parent)
: QThread(parent),
abort(false),
+#ifndef QT_NO_FILESYSTEMWATCHER
watcher(0),
+#endif
sortFlags(QDir::Name),
needUpdate(true),
folderUpdate(false),
@@ -58,9 +60,11 @@ FileInfoThread::FileInfoThread(QObject *parent)
showDotDot(false),
showOnlyReadable(false)
{
+#ifndef QT_NO_FILESYSTEMWATCHER
watcher = new QFileSystemWatcher(this);
connect(watcher, SIGNAL(directoryChanged(QString)), this, SLOT(dirChanged(QString)));
connect(watcher, SIGNAL(fileChanged(QString)), this, SLOT(updateFile(QString)));
+#endif // !QT_NO_FILESYSTEMWATCHER
start(LowPriority);
}
@@ -76,14 +80,18 @@ FileInfoThread::~FileInfoThread()
void FileInfoThread::clear()
{
QMutexLocker locker(&mutex);
+#ifndef QT_NO_FILESYSTEMWATCHER
watcher->removePaths(watcher->files());
watcher->removePaths(watcher->directories());
+#endif
}
void FileInfoThread::removePath(const QString &path)
{
QMutexLocker locker(&mutex);
+#ifndef QT_NO_FILESYSTEMWATCHER
watcher->removePath(path);
+#endif
currentPath.clear();
}
@@ -92,7 +100,9 @@ void FileInfoThread::setPath(const QString &path)
Q_ASSERT(!path.isEmpty());
QMutexLocker locker(&mutex);
+#ifndef QT_NO_FILESYSTEMWATCHER
watcher->addPath(path);
+#endif
currentPath = path;
needUpdate = true;
condition.wakeAll();
@@ -106,6 +116,7 @@ void FileInfoThread::setRootPath(const QString &path)
rootPath = path;
}
+#ifndef QT_NO_FILESYSTEMWATCHER
void FileInfoThread::dirChanged(const QString &directoryPath)
{
Q_UNUSED(directoryPath);
@@ -113,6 +124,7 @@ void FileInfoThread::dirChanged(const QString &directoryPath)
folderUpdate = true;
condition.wakeAll();
}
+#endif
void FileInfoThread::setSortFlags(QDir::SortFlags flags)
{
@@ -162,6 +174,7 @@ void FileInfoThread::setShowOnlyReadable(bool on)
condition.wakeAll();
}
+#ifndef QT_NO_FILESYSTEMWATCHER
void FileInfoThread::updateFile(const QString &path)
{
Q_UNUSED(path);
@@ -169,6 +182,7 @@ void FileInfoThread::updateFile(const QString &path)
folderUpdate = true;
condition.wakeAll();
}
+#endif
void FileInfoThread::run()
{
diff --git a/src/imports/folderlistmodel/fileinfothread_p.h b/src/imports/folderlistmodel/fileinfothread_p.h
index a5be6e6fcc..d144f520d0 100644
--- a/src/imports/folderlistmodel/fileinfothread_p.h
+++ b/src/imports/folderlistmodel/fileinfothread_p.h
@@ -76,8 +76,10 @@ public:
void setShowOnlyReadable(bool on);
public Q_SLOTS:
+#ifndef QT_NO_FILESYSTEMWATCHER
void dirChanged(const QString &directoryPath);
void updateFile(const QString &path);
+#endif
protected:
void run();
@@ -89,7 +91,9 @@ private:
QWaitCondition condition;
volatile bool abort;
+#ifndef QT_NO_FILESYSTEMWATCHER
QFileSystemWatcher *watcher;
+#endif
QList<FileProperty> currentFileList;
QDir::SortFlags sortFlags;
QString currentPath;