From faefd37db6a1ada4be7ca0c659c6bb04bf8042ad Mon Sep 17 00:00:00 2001
From: Jochen Seemann <seemann.jochen@gmail.com>
Date: Tue, 23 Sep 2014 21:10:23 +0200
Subject: [PATCH] Fix MSVC2013-compiler warnings with QT_NO_FILESYSTEMWATCHER

dialogs\qfilesystemmodel.cpp(203,1667,1680): C4189: 'd': local variable is initialized but not referenced
dialogs\qfilesystemmodel.cpp(1547,1720,1847): C4100: 'variable': unreferenced formal parameter

Change-Id: Ic3cef264dcd0b939748bec914eb9c29f86f6ed0e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
---
 src/widgets/dialogs/qfilesystemmodel.cpp | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp
index 398eae83936..988d3ad3c73 100644
--- a/src/widgets/dialogs/qfilesystemmodel.cpp
+++ b/src/widgets/dialogs/qfilesystemmodel.cpp
@@ -192,8 +192,8 @@ QT_BEGIN_NAMESPACE
 bool QFileSystemModel::remove(const QModelIndex &aindex)
 {
     const QString path = filePath(aindex);
-    QFileSystemModelPrivate * d = const_cast<QFileSystemModelPrivate*>(d_func());
 #ifndef QT_NO_FILESYSTEMWATCHER
+    QFileSystemModelPrivate * d = const_cast<QFileSystemModelPrivate*>(d_func());
     d->fileInfoGatherer.removePath(path);
 #endif
     if (QFileInfo(path).isFile())
@@ -1541,6 +1541,8 @@ void QFileSystemModel::setResolveSymlinks(bool enable)
 #ifndef QT_NO_FILESYSTEMWATCHER
     Q_D(QFileSystemModel);
     d->fileInfoGatherer.setResolveSymlinks(enable);
+#else
+    Q_UNUSED(enable)
 #endif
 }
 
@@ -1656,21 +1658,21 @@ QStringList QFileSystemModel::nameFilters() const
 */
 bool QFileSystemModel::event(QEvent *event)
 {
+#ifndef QT_NO_FILESYSTEMWATCHER
     Q_D(QFileSystemModel);
     if (event->type() == QEvent::LanguageChange) {
-#ifndef QT_NO_FILESYSTEMWATCHER
         d->root.retranslateStrings(d->fileInfoGatherer.iconProvider(), QString());
-#endif
         return true;
     }
+#endif
     return QAbstractItemModel::event(event);
 }
 
 bool QFileSystemModel::rmdir(const QModelIndex &aindex)
 {
     QString path = filePath(aindex);
-    QFileSystemModelPrivate * d = const_cast<QFileSystemModelPrivate*>(d_func());
 #ifndef QT_NO_FILESYSTEMWATCHER
+    QFileSystemModelPrivate * d = const_cast<QFileSystemModelPrivate*>(d_func());
     d->fileInfoGatherer.removePath(path);
 #endif
     return QDir().rmdir(path);
@@ -1715,6 +1717,8 @@ QFileSystemModelPrivate::QFileSystemNode* QFileSystemModelPrivate::addNode(QFile
     QFileSystemModelPrivate::QFileSystemNode *node = new QFileSystemModelPrivate::QFileSystemNode(fileName, parentNode);
 #ifndef QT_NO_FILESYSTEMWATCHER
     node->populate(info);
+#else
+    Q_UNUSED(info)
 #endif
 #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
     //The parentNode is "" so we are listing the drives
@@ -1935,6 +1939,9 @@ void QFileSystemModelPrivate::_q_fileSystemChanged(const QString &path, const QL
         forceSort = true;
         delayedSort();
     }
+#else
+    Q_UNUSED(path)
+    Q_UNUSED(updates)
 #endif // !QT_NO_FILESYSTEMWATCHER
 }
 
-- 
GitLab