QmlProject: update mainFile after renaming it

Set mainFile at the QmlProject and replaces the string inside
the .qmlproject file.
If that file is open and modified just save that, it is not nice
but qmake projects haves the same at the moment.

Task-number: QTCREATORBUG-10629
Change-Id: Ia3916644bacfc65862802e3dc5361edd50951d35
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Tim Jenssen
2019-01-18 20:38:48 +01:00
parent 37c009e195
commit 8d9ac8d94b
3 changed files with 53 additions and 2 deletions

View File

@@ -180,6 +180,12 @@ QString QmlProject::mainFile() const
return QString();
}
void QmlProject::setMainFile(const QString &mainFilePath)
{
if (m_projectItem)
m_projectItem.data()->setMainFile(mainFilePath);
}
Utils::FileName QmlProject::targetDirectory(const Target *target) const
{
if (DeviceTypeKitInformation::deviceTypeId(target->kit())