aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hartmann <thomas.hartmann@qt.io>2023-04-27 14:09:09 +0200
committerThomas Hartmann <thomas.hartmann@qt.io>2023-04-27 14:12:33 +0000
commit3850b6c981c2c848d0a97de9a10485f9c956c382 (patch)
tree7cae0e7b7c1773d18c136527750cac4e07f31cee
parent6fd6fc7234c75e57f2dbdb4ee520acd79104eba1 (diff)
QmlProject: Fix mainUiFilePath()
The method mainUiFilePath() is supposed to return the actual file path that is relative to the project file. Removing mainUiFilePath() from QmlProjectItem, since QmlProjectItem is supposed to contain only the pure data. Task-number: QDS-9650 Change-Id: Iad474586cad8f8cef745aadb63d421573d7d9c83 (cherry picked from commit 7c7a0fba57788875066e7f0180f1e570ee93033f) Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r--src/plugins/qmlprojectmanager/buildsystem/projectitem/qmlprojectitem.cpp10
-rw-r--r--src/plugins/qmlprojectmanager/buildsystem/projectitem/qmlprojectitem.h2
-rw-r--r--src/plugins/qmlprojectmanager/buildsystem/qmlbuildsystem.cpp7
-rw-r--r--src/plugins/qmlprojectmanager/buildsystem/qmlbuildsystem.h1
4 files changed, 7 insertions, 13 deletions
diff --git a/src/plugins/qmlprojectmanager/buildsystem/projectitem/qmlprojectitem.cpp b/src/plugins/qmlprojectmanager/buildsystem/projectitem/qmlprojectitem.cpp
index c216ee320b..04bd26476e 100644
--- a/src/plugins/qmlprojectmanager/buildsystem/projectitem/qmlprojectitem.cpp
+++ b/src/plugins/qmlprojectmanager/buildsystem/projectitem/qmlprojectitem.cpp
@@ -317,11 +317,6 @@ QString QmlProjectItem::mainFile() const
return m_project["runConfig"].toObject()["mainFile"].toString();
}
-Utils::FilePath QmlProjectItem::mainFilePath() const
-{
- return m_projectFile;
-}
-
void QmlProjectItem::setMainUiFile(const QString &mainUiFile)
{
QJsonObject runConfig = m_project["runConfig"].toObject();
@@ -334,11 +329,6 @@ QString QmlProjectItem::mainUiFile() const
return m_project["runConfig"].toObject()["mainUiFile"].toString();
}
-Utils::FilePath QmlProjectItem::mainUiFilePath() const
-{
- return Utils::FilePath::fromString(m_project["runConfig"].toObject()["mainUiFile"].toString());
-}
-
bool QmlProjectItem::widgetApp() const
{
return m_project["runConfig"].toObject()["widgetApp"].toBool();
diff --git a/src/plugins/qmlprojectmanager/buildsystem/projectitem/qmlprojectitem.h b/src/plugins/qmlprojectmanager/buildsystem/projectitem/qmlprojectitem.h
index 30e85d53dc..78b038b037 100644
--- a/src/plugins/qmlprojectmanager/buildsystem/projectitem/qmlprojectitem.h
+++ b/src/plugins/qmlprojectmanager/buildsystem/projectitem/qmlprojectitem.h
@@ -69,11 +69,9 @@ public:
void setMainFile(const QString &mainFile);
QString mainFile() const;
- Utils::FilePath mainFilePath() const;
void setMainUiFile(const QString &mainUiFile);
QString mainUiFile() const;
- Utils::FilePath mainUiFilePath() const;
bool widgetApp() const;
void setWidgetApp(const bool &widgetApp);
diff --git a/src/plugins/qmlprojectmanager/buildsystem/qmlbuildsystem.cpp b/src/plugins/qmlprojectmanager/buildsystem/qmlbuildsystem.cpp
index e06ac211df..712aef9227 100644
--- a/src/plugins/qmlprojectmanager/buildsystem/qmlbuildsystem.cpp
+++ b/src/plugins/qmlprojectmanager/buildsystem/qmlbuildsystem.cpp
@@ -291,7 +291,7 @@ Utils::FilePath QmlBuildSystem::mainFilePath() const
Utils::FilePath QmlBuildSystem::mainUiFilePath() const
{
- return m_projectItem->mainUiFilePath();
+ return projectDirectory().pathAppended(mainUiFile());
}
bool QmlBuildSystem::setMainFileInProjectFile(const Utils::FilePath &newMainFilePath)
@@ -477,6 +477,11 @@ QString QmlBuildSystem::mainFile() const
return m_projectItem->mainFile();
}
+QString QmlBuildSystem::mainUiFile() const
+{
+ return m_projectItem->mainUiFile();
+}
+
bool QmlBuildSystem::qtForMCUs() const
{
return m_projectItem->isQt4McuProject();
diff --git a/src/plugins/qmlprojectmanager/buildsystem/qmlbuildsystem.h b/src/plugins/qmlprojectmanager/buildsystem/qmlbuildsystem.h
index 914b8d4c0f..d275481f53 100644
--- a/src/plugins/qmlprojectmanager/buildsystem/qmlbuildsystem.h
+++ b/src/plugins/qmlprojectmanager/buildsystem/qmlbuildsystem.h
@@ -57,6 +57,7 @@ public:
Utils::FilePath canonicalProjectDir() const;
QString mainFile() const;
+ QString mainUiFile() const;
Utils::FilePath mainFilePath() const;
Utils::FilePath mainUiFilePath() const;