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
......@@ -48,6 +48,8 @@
#include <cpptools/cppmodelmanagerinterface.h>
#include <cplusplus/CppDocument.h>
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/buildmanager.h>
#include <utils/qtcassert.h>
......@@ -498,8 +500,16 @@ QStringList Qt4PriFileNode::varNames(FileType type)
return vars;
}
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/buildmanager.h>
Qt4PriFileNode *Qt4PriFileNode::findProFileFor(const QString &fileName)
{
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
......
......@@ -123,6 +123,11 @@ public:
bool renameFile(const FileType fileType,
const QString &filePath, const QString &newFilePath);
Qt4PriFileNode *findProFileFor(const QString &string);
//internal
ProFileReader *createProFileReader() const;
protected:
void clear();
static QStringList varNames(FileType type);
......@@ -142,7 +147,6 @@ protected:
ChangeType change);
QString buildDir() const;
ProFileReader *createProFileReader() const;
private slots:
void scheduleUpdate();
......@@ -198,8 +202,6 @@ private:
QStringList subDirsPaths(ProFileReader *reader) const;
QStringList qBuildSubDirsPaths(const QString &scanDir) const;
void invalidate();
Qt4ProjectType m_projectType;
......
......@@ -584,18 +584,6 @@ void Qt4Project::update()
//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.
*/
......
......@@ -164,7 +164,6 @@ public:
virtual void newBuildConfiguration(const QString &buildConfiguration);
QList<Internal::Qt4ProFileNode *> applicationProFiles() const;
Internal::ProFileReader *createProFileReader() const;
// Those functions arein a few places.
// The drawback is that we shouldn't actually depend on them beeing always there
......
......@@ -331,7 +331,8 @@ void Qt4RunConfiguration::updateTarget()
return;
//qDebug()<<"updateTarget";
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->setQtVersion(pro->qtVersion(pro->activeBuildConfiguration()));
......
......@@ -47,9 +47,7 @@ class Qt4Project;
namespace Internal {
class Qt4ProFileNode;
class Qt4PriFileNode;
class Qt4RunConfiguration : public ProjectExplorer::ApplicationRunConfiguration
{
......@@ -103,7 +101,6 @@ private slots:
private:
void updateTarget();
QStringList m_commandLineArguments;
Qt4ProFileNode *m_proFileNode;
QString m_proFilePath; // Full path to the Application Pro File
// Cached startup sub project information
......
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