Emit extra signals to have the task manager show issues on project-load.

This commit is contained in:
Erik Verbruggen
2010-04-16 13:08:59 +02:00
parent db0a0f2996
commit 124bb7aad7
5 changed files with 16 additions and 10 deletions

View File

@@ -714,7 +714,7 @@ void QmlJSTextEditor::updateDocumentNow()
const QString fileName = file()->fileName(); const QString fileName = file()->fileName();
m_modelManager->updateSourceFiles(QStringList() << fileName); m_modelManager->updateSourceFiles(QStringList() << fileName, false);
} }
static void appendExtraSelectionsForMessages( static void appendExtraSelectionsForMessages(

View File

@@ -97,12 +97,14 @@ Snapshot ModelManager::snapshot() const
return _snapshot; return _snapshot;
} }
void ModelManager::updateSourceFiles(const QStringList &files) void ModelManager::updateSourceFiles(const QStringList &files,
bool emitDocumentOnDiskChanged)
{ {
refreshSourceFiles(files); refreshSourceFiles(files, emitDocumentOnDiskChanged);
} }
QFuture<void> ModelManager::refreshSourceFiles(const QStringList &sourceFiles) QFuture<void> ModelManager::refreshSourceFiles(const QStringList &sourceFiles,
bool emitDocumentOnDiskChanged)
{ {
if (sourceFiles.isEmpty()) { if (sourceFiles.isEmpty()) {
return QFuture<void>(); return QFuture<void>();
@@ -112,7 +114,8 @@ QFuture<void> ModelManager::refreshSourceFiles(const QStringList &sourceFiles)
QFuture<void> result = QtConcurrent::run(&ModelManager::parse, QFuture<void> result = QtConcurrent::run(&ModelManager::parse,
workingCopy, sourceFiles, workingCopy, sourceFiles,
this, false); this,
emitDocumentOnDiskChanged);
if (m_synchronizer.futures().size() > 10) { if (m_synchronizer.futures().size() > 10) {
QList<QFuture<void> > futures = m_synchronizer.futures(); QList<QFuture<void> > futures = m_synchronizer.futures();
@@ -393,7 +396,7 @@ void ModelManager::setProjectImportPaths(const QStringList &importPaths)
foreach (const Document::Ptr &doc, snapshot) foreach (const Document::Ptr &doc, snapshot)
findNewLibraryImports(doc, snapshot, this, &importedFiles, &scannedPaths); findNewLibraryImports(doc, snapshot, this, &importedFiles, &scannedPaths);
updateSourceFiles(importedFiles); updateSourceFiles(importedFiles, true);
} }
QStringList ModelManager::importPaths() const QStringList ModelManager::importPaths() const

View File

@@ -54,7 +54,8 @@ public:
ModelManager(QObject *parent = 0); ModelManager(QObject *parent = 0);
virtual QmlJS::Snapshot snapshot() const; virtual QmlJS::Snapshot snapshot() const;
virtual void updateSourceFiles(const QStringList &files); virtual void updateSourceFiles(const QStringList &files,
bool emitDocumentOnDiskChanged);
virtual void fileChangedOnDisk(const QString &path); virtual void fileChangedOnDisk(const QString &path);
void emitDocumentUpdated(QmlJS::Document::Ptr doc); void emitDocumentUpdated(QmlJS::Document::Ptr doc);
@@ -82,7 +83,8 @@ protected:
QString contents; QString contents;
}; };
QFuture<void> refreshSourceFiles(const QStringList &sourceFiles); QFuture<void> refreshSourceFiles(const QStringList &sourceFiles,
bool emitDocumentOnDiskChanged);
QMap<QString, WorkingCopy> buildWorkingCopyList(); QMap<QString, WorkingCopy> buildWorkingCopyList();
static void parse(QFutureInterface<void> &future, static void parse(QFutureInterface<void> &future,

View File

@@ -53,7 +53,8 @@ public:
virtual ~ModelManagerInterface(); virtual ~ModelManagerInterface();
virtual QmlJS::Snapshot snapshot() const = 0; virtual QmlJS::Snapshot snapshot() const = 0;
virtual void updateSourceFiles(const QStringList &files) = 0; virtual void updateSourceFiles(const QStringList &files,
bool emitDocumentOnDiskChanged) = 0;
virtual void fileChangedOnDisk(const QString &path) = 0; virtual void fileChangedOnDisk(const QString &path) = 0;
virtual void setProjectImportPaths(const QStringList &importPaths) = 0; virtual void setProjectImportPaths(const QStringList &importPaths) = 0;

View File

@@ -106,7 +106,7 @@ void QmlProject::parseProject(RefreshOptions options)
} }
if (m_projectItem) { if (m_projectItem) {
m_projectItem.data()->setSourceDirectory(projectDir().path()); m_projectItem.data()->setSourceDirectory(projectDir().path());
m_modelManager->updateSourceFiles(m_projectItem.data()->files()); m_modelManager->updateSourceFiles(m_projectItem.data()->files(), true);
} }
m_rootNode->refresh(); m_rootNode->refresh();
} }