QFileInfoGatherer: remove m_resolveSymlinks for non-Q_OS_WIN
authorMarc Mutz <marc.mutz@kdab.com>
Tue, 7 Aug 2012 17:44:09 +0000 (19:44 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 17 Oct 2012 02:19:06 +0000 (04:19 +0200)
For some reason, m_resolveSymlinks was never set to true for
non-Windows systems. The constructor set it to false and the
setter was only implemented for Windows.

So remove the member and code that is only executed if it
is set to true, except on Windows.

Change-Id: I386e980688a603475a413e2ef3628d0754778c5c
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
src/widgets/dialogs/qfileinfogatherer.cpp
src/widgets/dialogs/qfileinfogatherer_p.h

index 22a7d50..138b1f9 100644 (file)
@@ -75,11 +75,11 @@ QFileInfoGatherer::QFileInfoGatherer(QObject *parent)
 #ifndef QT_NO_FILESYSTEMWATCHER
       watcher(0),
 #endif
-      m_resolveSymlinks(false), m_iconProvider(&defaultProvider)
-{
 #ifdef Q_OS_WIN
-    m_resolveSymlinks = true;
+      m_resolveSymlinks(true),
 #endif
+      m_iconProvider(&defaultProvider)
+{
 #ifndef QT_NO_FILESYSTEMWATCHER
     watcher = new QFileSystemWatcher(this);
     connect(watcher, SIGNAL(directoryChanged(QString)), this, SLOT(list(QString)));
@@ -108,7 +108,11 @@ void QFileInfoGatherer::setResolveSymlinks(bool enable)
 
 bool QFileInfoGatherer::resolveSymlinks() const
 {
+#ifdef Q_OS_WIN
     return m_resolveSymlinks;
+#else
+    return false;
+#endif
 }
 
 void QFileInfoGatherer::setIconProvider(QFileIconProvider *provider)
@@ -233,6 +237,7 @@ QExtendedInformation QFileInfoGatherer::getInfo(const QFileInfo &fileInfo) const
     #endif
 #endif
 
+#ifdef Q_OS_WIN
     if (fileInfo.isSymLink() && m_resolveSymlinks) {
         QFileInfo resolvedInfo(fileInfo.symLinkTarget());
         resolvedInfo = resolvedInfo.canonicalFilePath();
@@ -240,6 +245,7 @@ QExtendedInformation QFileInfoGatherer::getInfo(const QFileInfo &fileInfo) const
             emit nameResolved(fileInfo.filePath(), resolvedInfo.fileName());
         }
     }
+#endif
     return info;
 }
 
index 9837b1a..87afbd9 100644 (file)
@@ -192,7 +192,9 @@ private:
 #ifndef QT_NO_FILESYSTEMWATCHER
     QFileSystemWatcher *watcher;
 #endif
+#ifdef Q_OS_WIN
     bool m_resolveSymlinks; // not accessed by run()
+#endif
     QFileIconProvider *m_iconProvider; // not accessed by run()
     QFileIconProvider defaultProvider;
 };