Commit 334273be authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner: Update qrc files

This triggers an update on every qrc file.

Change-Id: Id34873e3bd8190d79773fbc3a8a90699d4e49cb0
Reviewed-by: default avatarTim Jenssen <tim.jenssen@theqtcompany.com>
parent a22d8bca
......@@ -46,6 +46,8 @@
#include <qtsupport/qtversionmanager.h>
#include <coreplugin/idocument.h>
#include <qmljs/qmljsmodelmanagerinterface.h>
#include <QFileInfo>
#include <QUrl>
#include <QDebug>
......@@ -243,12 +245,17 @@ void DesignDocument::loadDocument(QPlainTextEdit *edit)
this, SIGNAL(dirtyStateChanged(bool)));
m_documentTextModifier.reset(new BaseTextEditModifier(dynamic_cast<TextEditor::TextEditorWidget*>(plainTextEdit())));
connect(m_documentTextModifier.data(), &TextModifier::textChanged, this, &DesignDocument::updateQrcFiles);
m_documentModel->setTextModifier(m_documentTextModifier.data());
m_inFileComponentTextModifier.reset();
updateFileName(Utils::FileName(), fileName());
updateQrcFiles();
m_documentLoaded = true;
}
......@@ -277,6 +284,18 @@ void DesignDocument::changeToInFileComponentModel(ComponentTextModifier *textMod
viewManager().attachViewsExceptRewriterAndComponetView();
}
void DesignDocument::updateQrcFiles()
{
ProjectExplorer::Project *currentProject = ProjectExplorer::SessionManager::projectForFile(fileName());
if (currentProject) {
foreach (const QString &fileName, currentProject->files(ProjectExplorer::Project::SourceFiles)) {
if (fileName.endsWith(".qrc"))
QmlJS::ModelManagerInterface::instance()->updateQrcFile(fileName);
}
}
}
void DesignDocument::changeToSubComponent(const ModelNode &componentNode)
{
if (QmlDesignerPlugin::instance()->currentDesignDocument() != this)
......
......@@ -124,6 +124,8 @@ private slots:
private: // functions
void changeToInFileComponentModel(ComponentTextModifier *textModifer);
void updateQrcFiles();
QWidget *centralWidget() const;
QString pathToQt() const;
......
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