forked from qt-creator/qt-creator
Modified the QML project to notify the DUI model manager when a file is added to the project.
This commit is contained in:
@@ -39,6 +39,8 @@
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
|
||||
#include <duieditor/duimodelmanagerinterface.h>
|
||||
|
||||
#include <utils/synchronousprocess.h>
|
||||
#include <utils/pathchooser.h>
|
||||
|
||||
@@ -62,7 +64,8 @@ using namespace QmlProjectManager::Internal;
|
||||
|
||||
QmlProject::QmlProject(Manager *manager, const QString &fileName)
|
||||
: m_manager(manager),
|
||||
m_fileName(fileName)
|
||||
m_fileName(fileName),
|
||||
m_modelManager(ExtensionSystem::PluginManager::instance()->getObject<DuiEditor::DuiModelManagerInterface>())
|
||||
{
|
||||
QFileInfo fileInfo(m_fileName);
|
||||
m_projectName = fileInfo.completeBaseName();
|
||||
@@ -118,6 +121,7 @@ void QmlProject::parseProject(RefreshOptions options)
|
||||
if (options & Files) {
|
||||
m_files = convertToAbsoluteFiles(readLines(filesFileName()));
|
||||
m_files.removeDuplicates();
|
||||
m_modelManager->updateSourceFiles(m_files);
|
||||
}
|
||||
|
||||
if (options & Configuration) {
|
||||
|
||||
@@ -41,6 +41,10 @@
|
||||
|
||||
#include <QtCore/QDir>
|
||||
|
||||
namespace DuiEditor {
|
||||
class DuiModelManagerInterface;
|
||||
}
|
||||
|
||||
namespace QmlProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
@@ -104,6 +108,7 @@ private:
|
||||
QString m_filesFileName;
|
||||
QmlProjectFile *m_file;
|
||||
QString m_projectName;
|
||||
DuiEditor::DuiModelManagerInterface *m_modelManager;
|
||||
|
||||
QStringList m_files;
|
||||
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
include(../../plugins/projectexplorer/projectexplorer.pri)
|
||||
include(../../plugins/texteditor/texteditor.pri)
|
||||
include(../../plugins/duieditor/duieditor.pri)
|
||||
|
||||
Reference in New Issue
Block a user