forked from qt-creator/qt-creator
Improve Qml code model import handling.
* Fill the snapshot with files that could be imported. * Implement package imports. * The qmldir file is not parsed yet. Reviewed-by: Erik Verbruggen
This commit is contained in:
@@ -95,6 +95,8 @@ void QmlProject::parseProject(RefreshOptions options)
|
||||
&& qobject_cast<QmlProjectItem*>(component->create())) {
|
||||
m_projectItem = qobject_cast<QmlProjectItem*>(component->create());
|
||||
connect(m_projectItem.data(), SIGNAL(qmlFilesChanged()), this, SLOT(refreshFiles()));
|
||||
connect(m_projectItem.data(), SIGNAL(libraryPathsChanged()), this, SLOT(refreshImportPaths()));
|
||||
refreshImportPaths();
|
||||
} else {
|
||||
Core::MessageManager *messageManager = Core::ICore::instance()->messageManager();
|
||||
messageManager->printToOutputPane(tr("Error while loading project file!"));
|
||||
@@ -104,7 +106,13 @@ void QmlProject::parseProject(RefreshOptions options)
|
||||
}
|
||||
if (m_projectItem) {
|
||||
m_projectItem.data()->setSourceDirectory(projectDir().path());
|
||||
m_modelManager->updateSourceFiles(m_projectItem.data()->files());
|
||||
|
||||
QSet<QString> sourceDirectories;
|
||||
foreach (const QString &file, m_projectItem.data()->files()) {
|
||||
sourceDirectories.insert(QFileInfo(file).path());
|
||||
}
|
||||
|
||||
m_modelManager->updateSourceDirectories(sourceDirectories.toList());
|
||||
}
|
||||
m_rootNode->refresh();
|
||||
}
|
||||
@@ -185,6 +193,11 @@ void QmlProject::refreshFiles()
|
||||
refresh(Files);
|
||||
}
|
||||
|
||||
void QmlProject::refreshImportPaths()
|
||||
{
|
||||
m_modelManager->setProjectImportPaths(libraryPaths());
|
||||
}
|
||||
|
||||
QString QmlProject::displayName() const
|
||||
{
|
||||
return m_projectName;
|
||||
|
Reference in New Issue
Block a user