Commit 855582de authored by Kai Koehne's avatar Kai Koehne
Browse files

QmlProject: Fix import of .qmlproject.user files from 2.1

We changed the semantics of an empty 'mainScript' in the .user file:
In 2.1 it translated to 'use current file', while in 2.2 the default is now
to use the file specified in .qmlproject.

However, if there is no mainFile specified in .qmlproject we should
fall back to the current file in editor.

Reviewed-by: Christiaan Janssen
parent 40975913
......@@ -248,7 +248,10 @@ QString QmlProjectRunConfiguration::mainScript() const
return m_mainScriptFilename;
QString path = qmlTarget()->qmlProject()->mainFile();
const QString path = qmlTarget()->qmlProject()->mainFile();
if (path.isEmpty()) {
return m_currentFileFilename;
if (QFileInfo(path).isAbsolute()) {
return path;
} else {
......@@ -325,8 +328,11 @@ bool QmlProjectRunConfiguration::fromMap(const QVariantMap &map)
return RunConfiguration::fromMap(map);
void QmlProjectRunConfiguration::changeCurrentFile(Core::IEditor * /*editor*/)
void QmlProjectRunConfiguration::changeCurrentFile(Core::IEditor *editor)
if (editor) {
m_currentFileFilename = editor->file()->fileName();
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