Skip to content
Snippets Groups Projects
Commit 6c5e23f1 authored by dt's avatar dt
Browse files

Fix $$OUT_PWD not beeing set for finding the target/destdir

Qt Creator wouldn't find the correct target if shadow building a project
that uses $$OUT_PWD, like for example itemviews-ng.
We didn't set the necessary variable on the ProFileReader *, simplified
the code to always use a ProFileReader created for the exact
profilenode.
parent 842d376e
No related branches found
No related tags found
No related merge requests found
...@@ -48,6 +48,8 @@ ...@@ -48,6 +48,8 @@
#include <cpptools/cppmodelmanagerinterface.h> #include <cpptools/cppmodelmanagerinterface.h>
#include <cplusplus/CppDocument.h> #include <cplusplus/CppDocument.h>
#include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginmanager.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/buildmanager.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
...@@ -498,8 +500,16 @@ QStringList Qt4PriFileNode::varNames(FileType type) ...@@ -498,8 +500,16 @@ QStringList Qt4PriFileNode::varNames(FileType type)
return vars; return vars;
} }
#include <projectexplorer/projectexplorer.h> Qt4PriFileNode *Qt4PriFileNode::findProFileFor(const QString &fileName)
#include <projectexplorer/buildmanager.h> {
if (fileName == path())
return this;
foreach (ProjectNode *pn, subProjectNodes())
if (Qt4PriFileNode *qt4PriFileNode = qobject_cast<Qt4PriFileNode *>(pn))
if (Qt4PriFileNode *result = qt4PriFileNode->findProFileFor(fileName))
return result;
return 0;
}
/*! /*!
\class Qt4ProFileNode \class Qt4ProFileNode
......
...@@ -123,6 +123,11 @@ public: ...@@ -123,6 +123,11 @@ public:
bool renameFile(const FileType fileType, bool renameFile(const FileType fileType,
const QString &filePath, const QString &newFilePath); const QString &filePath, const QString &newFilePath);
Qt4PriFileNode *findProFileFor(const QString &string);
//internal
ProFileReader *createProFileReader() const;
protected: protected:
void clear(); void clear();
static QStringList varNames(FileType type); static QStringList varNames(FileType type);
...@@ -142,7 +147,6 @@ protected: ...@@ -142,7 +147,6 @@ protected:
ChangeType change); ChangeType change);
QString buildDir() const; QString buildDir() const;
ProFileReader *createProFileReader() const;
private slots: private slots:
void scheduleUpdate(); void scheduleUpdate();
...@@ -198,8 +202,6 @@ private: ...@@ -198,8 +202,6 @@ private:
QStringList subDirsPaths(ProFileReader *reader) const; QStringList subDirsPaths(ProFileReader *reader) const;
QStringList qBuildSubDirsPaths(const QString &scanDir) const; QStringList qBuildSubDirsPaths(const QString &scanDir) const;
void invalidate(); void invalidate();
Qt4ProjectType m_projectType; Qt4ProjectType m_projectType;
......
...@@ -584,18 +584,6 @@ void Qt4Project::update() ...@@ -584,18 +584,6 @@ void Qt4Project::update()
//updateCodeModel(); //updateCodeModel();
} }
ProFileReader *Qt4Project::createProFileReader() const
{
ProFileReader *reader = new ProFileReader();
connect(reader, SIGNAL(errorFound(const QString&)),
this, SLOT(proFileParseError(const QString&)));
QtVersion *version = qtVersion(activeBuildConfiguration());
if (version->isValid()) {
reader->setQtVersion(version);
}
return reader;
}
/*! /*!
Returns whether the project is an application, or has an application as a subproject. Returns whether the project is an application, or has an application as a subproject.
*/ */
......
...@@ -164,7 +164,6 @@ public: ...@@ -164,7 +164,6 @@ public:
virtual void newBuildConfiguration(const QString &buildConfiguration); virtual void newBuildConfiguration(const QString &buildConfiguration);
QList<Internal::Qt4ProFileNode *> applicationProFiles() const; QList<Internal::Qt4ProFileNode *> applicationProFiles() const;
Internal::ProFileReader *createProFileReader() const;
// Those functions arein a few places. // Those functions arein a few places.
// The drawback is that we shouldn't actually depend on them beeing always there // The drawback is that we shouldn't actually depend on them beeing always there
......
...@@ -331,7 +331,8 @@ void Qt4RunConfiguration::updateTarget() ...@@ -331,7 +331,8 @@ void Qt4RunConfiguration::updateTarget()
return; return;
//qDebug()<<"updateTarget"; //qDebug()<<"updateTarget";
Qt4Project *pro = static_cast<Qt4Project *>(project()); Qt4Project *pro = static_cast<Qt4Project *>(project());
ProFileReader *reader = pro->createProFileReader(); Qt4PriFileNode * priFileNode = static_cast<Qt4Project *>(project())->rootProjectNode()->findProFileFor(m_proFilePath);
ProFileReader *reader = priFileNode->createProFileReader();
reader->setCumulative(false); reader->setCumulative(false);
reader->setQtVersion(pro->qtVersion(pro->activeBuildConfiguration())); reader->setQtVersion(pro->qtVersion(pro->activeBuildConfiguration()));
......
...@@ -47,9 +47,7 @@ class Qt4Project; ...@@ -47,9 +47,7 @@ class Qt4Project;
namespace Internal { namespace Internal {
class Qt4ProFileNode; class Qt4PriFileNode;
class Qt4RunConfiguration : public ProjectExplorer::ApplicationRunConfiguration class Qt4RunConfiguration : public ProjectExplorer::ApplicationRunConfiguration
{ {
...@@ -103,7 +101,6 @@ private slots: ...@@ -103,7 +101,6 @@ private slots:
private: private:
void updateTarget(); void updateTarget();
QStringList m_commandLineArguments; QStringList m_commandLineArguments;
Qt4ProFileNode *m_proFileNode;
QString m_proFilePath; // Full path to the Application Pro File QString m_proFilePath; // Full path to the Application Pro File
// Cached startup sub project information // Cached startup sub project information
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment