summaryrefslogtreecommitdiff
path: root/src/plugins/qmakeprojectmanager
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2023-01-16 17:03:26 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2023-01-27 10:02:52 +0000
commit0d909c353c54ecf2fee2d13b7d2fe19eee01591d (patch)
tree22fa92a342dab8f9039c49e6cb99ee618462650b /src/plugins/qmakeprojectmanager
parentb4b260071587d681c78768a7a84807226857b081 (diff)
downloadqt-creator-0d909c353c54ecf2fee2d13b7d2fe19eee01591d.tar.gz
Designer: Update C++ code model on an object name change in designer
We try to locate the old symbol name in the generated ui header and rename the symbol in the background. Task-number: QTCREATORBUG-1179 Change-Id: Iaf68e3922cd728cbc87d0dc97125e34b8bdaa6be Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/qmakeprojectmanager')
-rw-r--r--src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp15
-rw-r--r--src/plugins/qmakeprojectmanager/qmakeparsernodes.h1
-rw-r--r--src/plugins/qmakeprojectmanager/qmakeproject.cpp5
-rw-r--r--src/plugins/qmakeprojectmanager/qmakeproject.h2
4 files changed, 23 insertions, 0 deletions
diff --git a/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp b/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp
index a1c34a528d..d7d0a854c4 100644
--- a/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp
+++ b/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp
@@ -2080,6 +2080,21 @@ QList<ExtraCompiler *> QmakeProFile::extraCompilers() const
return m_extraCompilers;
}
+ExtraCompiler *QmakeProFile::extraCompilerForSource(const Utils::FilePath &sourceFile)
+{
+ for (ExtraCompiler * const ec : std::as_const(m_extraCompilers)) {
+ if (ec->source() == sourceFile)
+ return ec;
+ }
+ for (QmakePriFile * const priFile : std::as_const(m_children)) {
+ if (const auto proFile = dynamic_cast<QmakeProFile *>(priFile)) {
+ if (ExtraCompiler * const ec = proFile->extraCompilerForSource(sourceFile))
+ return ec;
+ }
+ }
+ return nullptr;
+}
+
void QmakeProFile::setupExtraCompiler(const FilePath &buildDir,
const FileType &fileType, ExtraCompilerFactory *factory)
{
diff --git a/src/plugins/qmakeprojectmanager/qmakeparsernodes.h b/src/plugins/qmakeprojectmanager/qmakeparsernodes.h
index 86a3a97b49..f9700b7f54 100644
--- a/src/plugins/qmakeprojectmanager/qmakeparsernodes.h
+++ b/src/plugins/qmakeprojectmanager/qmakeparsernodes.h
@@ -301,6 +301,7 @@ public:
const Utils::FilePath &sourceFile,
const ProjectExplorer::FileType &sourceFileType) const;
QList<ProjectExplorer::ExtraCompiler *> extraCompilers() const;
+ ProjectExplorer::ExtraCompiler *extraCompilerForSource(const Utils::FilePath &sourceFile);
TargetInformation targetInformation() const;
InstallsList installsList() const;
diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp
index 5d021f9c56..84188df03f 100644
--- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp
+++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp
@@ -532,6 +532,11 @@ void QmakeBuildSystem::scheduleUpdateAllNowOrLater()
scheduleUpdateAll(QmakeProFile::ParseLater);
}
+ExtraCompiler *QmakeBuildSystem::extraCompilerForSource(const Utils::FilePath &source)
+{
+ return m_rootProFile->extraCompilerForSource(source);
+}
+
QmakeBuildConfiguration *QmakeBuildSystem::qmakeBuildConfiguration() const
{
return static_cast<QmakeBuildConfiguration *>(BuildSystem::buildConfiguration());
diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.h b/src/plugins/qmakeprojectmanager/qmakeproject.h
index b83468a108..edf2db0edf 100644
--- a/src/plugins/qmakeprojectmanager/qmakeproject.h
+++ b/src/plugins/qmakeprojectmanager/qmakeproject.h
@@ -163,6 +163,8 @@ public:
void scheduleUpdateAllNowOrLater();
private:
+ ProjectExplorer::ExtraCompiler *extraCompilerForSource(const Utils::FilePath &source) override;
+
void scheduleUpdateAll(QmakeProFile::AsyncUpdateDelay delay);
void scheduleUpdateAllLater() { scheduleUpdateAll(QmakeProFile::ParseLater); }