diff options
author | Thomas Hartmann <Thomas.Hartmann@theqtcompany.com> | 2015-07-09 12:57:49 +0200 |
---|---|---|
committer | Thomas Hartmann <Thomas.Hartmann@digia.com> | 2015-07-15 09:12:20 +0000 |
commit | c64657da22f02d7799824c69d0a925ebd514a38f (patch) | |
tree | 258f109d786e5ecb411f654a176555469ab3f6be /src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp | |
parent | 165ced5568f250097eac899b1a25df552722d3e6 (diff) | |
download | qt-creator-c64657da22f02d7799824c69d0a925ebd514a38f.tar.gz |
QmlDesigenr: Collect qrc urls and create mapping for the qmlpuppet
We collect all possible qrc path and the mappings provided by
the code model in the TextToModelMerger.
Then we set this mapping as environment variable for the puppet
in the PuppetCreator(QMLDESIGNER_RC_PATHS).
Change-Id: I4b4c7253af23d1f32a75394d04199e76f2e9efdd
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Diffstat (limited to 'src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp')
-rw-r--r-- | src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp b/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp index 9ac9a585da..8b01b260f3 100644 --- a/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp +++ b/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp @@ -130,7 +130,7 @@ NodeInstanceServerProxy::NodeInstanceServerProxy(NodeInstanceView *nodeInstanceV PuppetCreator::QmlPuppetVersion puppetVersion = hasQtQuick1(nodeInstanceView) ? PuppetCreator::Qml1Puppet : PuppetCreator::Qml2Puppet; PuppetCreator puppetCreator(kit, QString(), nodeInstanceView->model(), puppetVersion); - + puppetCreator.setQrcMappingString(qrcMappingString()); puppetCreator.createPuppetExecutableIfMissing(); @@ -326,6 +326,30 @@ void NodeInstanceServerProxy::puppetAlive(NodeInstanceServerProxy::PuppetStreamT } } +QString NodeInstanceServerProxy::qrcMappingString() const +{ + if (m_nodeInstanceView && m_nodeInstanceView.data()->model()) { + RewriterView *rewriterView = m_nodeInstanceView.data()->model()->rewriterView(); + if (rewriterView) { + QString mappingString; + + typedef QPair<QString, QString> StringPair; + + foreach (const StringPair &pair, rewriterView->qrcMapping()) { + if (!mappingString.isEmpty()) + mappingString.append(QLatin1String(",")); + mappingString.append(pair.first); + mappingString.append(QLatin1String("=")); + mappingString.append(pair.second); + } + + return mappingString; + } + } + + return QString(); +} + void NodeInstanceServerProxy::processFinished() { processFinished(-1, QProcess::CrashExit); |