Commit d360aa06 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.subComponentManager: remove watcher from files

We use the text editors meta info system now.
parent cc161fbf
...@@ -115,7 +115,6 @@ SubComponentManagerPrivate::SubComponentManagerPrivate(MetaInfo metaInfo, SubCom ...@@ -115,7 +115,6 @@ SubComponentManagerPrivate::SubComponentManagerPrivate(MetaInfo metaInfo, SubCom
m_metaInfo(metaInfo) m_metaInfo(metaInfo)
{ {
connect(&m_watcher, SIGNAL(directoryChanged(QString)), this, SLOT(parseDirectory(QString))); connect(&m_watcher, SIGNAL(directoryChanged(QString)), this, SLOT(parseDirectory(QString)));
connect(&m_watcher, SIGNAL(fileChanged(QString)), this, SLOT(parseFile(QString)));
} }
void SubComponentManagerPrivate::addImport(int pos, const QDeclarativeDomImport &import) void SubComponentManagerPrivate::addImport(int pos, const QDeclarativeDomImport &import)
...@@ -165,7 +164,6 @@ void SubComponentManagerPrivate::removeImport(int pos) ...@@ -165,7 +164,6 @@ void SubComponentManagerPrivate::removeImport(int pos)
foreach (const QFileInfo &monitoredFile, watchedFiles(canonicalDirPath)) { foreach (const QFileInfo &monitoredFile, watchedFiles(canonicalDirPath)) {
if (!m_dirToQualifier.contains(canonicalDirPath)) if (!m_dirToQualifier.contains(canonicalDirPath))
m_watcher.removePath(monitoredFile.filePath());
unregisterQmlFile(monitoredFile, import.qualifier()); unregisterQmlFile(monitoredFile, import.qualifier());
} }
} else { } else {
...@@ -252,14 +250,12 @@ void SubComponentManagerPrivate::parseDirectory(const QString &canonicalDirPath, ...@@ -252,14 +250,12 @@ void SubComponentManagerPrivate::parseDirectory(const QString &canonicalDirPath,
} }
// oldFileInfo > newFileInfo // oldFileInfo > newFileInfo
parseFile(newFileInfo.filePath(), addToLibrary, qualification); parseFile(newFileInfo.filePath(), addToLibrary, qualification);
m_watcher.addPath(oldFileInfo.filePath());
++newIter; ++newIter;
} }
while (oldIter != monitoredList.constEnd()) { while (oldIter != monitoredList.constEnd()) {
foreach (const QString &qualifier, m_dirToQualifier.value(canonicalDirPath)) foreach (const QString &qualifier, m_dirToQualifier.value(canonicalDirPath))
unregisterQmlFile(*oldIter, qualifier); unregisterQmlFile(*oldIter, qualifier);
m_watcher.removePath(oldIter->filePath());
++oldIter; ++oldIter;
} }
...@@ -267,7 +263,6 @@ void SubComponentManagerPrivate::parseDirectory(const QString &canonicalDirPath, ...@@ -267,7 +263,6 @@ void SubComponentManagerPrivate::parseDirectory(const QString &canonicalDirPath,
parseFile(newIter->filePath(), addToLibrary, qualification); parseFile(newIter->filePath(), addToLibrary, qualification);
if (debug) if (debug)
qDebug() << "m_watcher.addPath(" << newIter->filePath() << ')'; qDebug() << "m_watcher.addPath(" << newIter->filePath() << ')';
m_watcher.addPath(newIter->filePath());
++newIter; ++newIter;
} }
} }
...@@ -436,7 +431,6 @@ void SubComponentManager::update(const QUrl &filePath, const QList<QDeclarativeD ...@@ -436,7 +431,6 @@ void SubComponentManager::update(const QUrl &filePath, const QList<QDeclarativeD
} }
if (!newDir.filePath().isEmpty()) { if (!newDir.filePath().isEmpty()) {
m_d->m_watcher.addPath(newDir.filePath());
m_d->m_dirToQualifier.insertMulti(newDir.canonicalFilePath(), QString()); m_d->m_dirToQualifier.insertMulti(newDir.canonicalFilePath(), QString());
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment