***************************************************************************/
#include "kdirectorycontentscounter.h"
-
-#include <kitemviews/kfileitemmodel.h>
+#include "kitemviews/kfileitemmodel.h"
#include <KDirWatch>
+
+#include <QFileInfo>
#include <QThread>
KDirectoryContentsCounter::KDirectoryContentsCounter(KFileItemModel* model, QObject* parent) :
int KDirectoryContentsCounter::countDirectoryContentsSynchronously(const QString& path)
{
- if (!m_dirWatcher->contains(path)) {
- m_dirWatcher->addDir(path);
- m_watchedDirs.insert(path);
+ const QString resolvedPath = QFileInfo(path).canonicalFilePath();
+
+ if (!m_dirWatcher->contains(resolvedPath)) {
+ m_dirWatcher->addDir(resolvedPath);
+ m_watchedDirs.insert(resolvedPath);
}
KDirectoryContentsCounterWorker::Options options;
{
m_workerIsBusy = false;
- if (!m_dirWatcher->contains(path)) {
- m_dirWatcher->addDir(path);
- m_watchedDirs.insert(path);
+ const QString resolvedPath = QFileInfo(path).canonicalFilePath();
+
+ if (!m_dirWatcher->contains(resolvedPath)) {
+ m_dirWatcher->addDir(resolvedPath);
+ m_watchedDirs.insert(resolvedPath);
}
if (!m_queue.isEmpty()) {