forked from qt-creator/qt-creator
move various functions from Qt4PriFileNode to Qt4ProFileNode
findProFileFor(), buildDir() and createProFileReader() make sense only in relation with an actual pro file anyway, so move them there.
This commit is contained in:
@@ -565,15 +565,14 @@ void MaemoRunConfiguration::updateTarget()
|
||||
|
||||
if (Qt4Project *qt4Project = project()) {
|
||||
Qt4BuildConfiguration *qt4bc = qt4Project->activeQt4BuildConfiguration();
|
||||
Qt4PriFileNode * priFileNode = qt4Project->rootProjectNode()
|
||||
->findProFileFor(m_proFilePath);
|
||||
if (!priFileNode) {
|
||||
Qt4ProFileNode *proFileNode = qt4Project->rootProjectNode()->findProFileFor(m_proFilePath);
|
||||
if (!proFileNode) {
|
||||
emit targetInformationChanged();
|
||||
return;
|
||||
}
|
||||
|
||||
QtVersion *qtVersion = qt4bc->qtVersion();
|
||||
ProFileReader *reader = priFileNode->createProFileReader();
|
||||
ProFileReader *reader = proFileNode->createProFileReader();
|
||||
reader->setCumulative(false);
|
||||
|
||||
// Find out what flags we pass on to qmake
|
||||
|
@@ -281,15 +281,15 @@ void S60DeviceRunConfiguration::updateTarget()
|
||||
if (m_cachedTargetInformationValid)
|
||||
return;
|
||||
Qt4BuildConfiguration *qt4bc = qt4Project()->activeQt4BuildConfiguration();
|
||||
Qt4PriFileNode * priFileNode = qt4Project()->rootProjectNode()->findProFileFor(m_proFilePath);
|
||||
if (!priFileNode) {
|
||||
Qt4ProFileNode *proFileNode = qt4Project()->rootProjectNode()->findProFileFor(m_proFilePath);
|
||||
if (!proFileNode) {
|
||||
m_baseFileName = QString::null;
|
||||
m_cachedTargetInformationValid = true;
|
||||
emit targetInformationChanged();
|
||||
return;
|
||||
}
|
||||
QtVersion *qtVersion = qt4bc->qtVersion();
|
||||
ProFileReader *reader = priFileNode->createProFileReader();
|
||||
ProFileReader *reader = proFileNode->createProFileReader();
|
||||
reader->setCumulative(false);
|
||||
|
||||
// Find out what flags we pass on to qmake
|
||||
|
@@ -128,15 +128,15 @@ void S60EmulatorRunConfiguration::updateTarget()
|
||||
if (m_cachedTargetInformationValid)
|
||||
return;
|
||||
Qt4BuildConfiguration *qt4bc = qt4Project()->activeQt4BuildConfiguration();
|
||||
Qt4PriFileNode * priFileNode = qt4Project()->rootProjectNode()->findProFileFor(m_proFilePath);
|
||||
if (!priFileNode) {
|
||||
Qt4ProFileNode *proFileNode = qt4Project()->rootProjectNode()->findProFileFor(m_proFilePath);
|
||||
if (!proFileNode) {
|
||||
m_executable = QString::null;
|
||||
m_cachedTargetInformationValid = true;
|
||||
emit targetInformationChanged();
|
||||
return;
|
||||
}
|
||||
QtVersion *qtVersion = qt4bc->qtVersion();
|
||||
ProFileReader *reader = priFileNode->createProFileReader();
|
||||
ProFileReader *reader = proFileNode->createProFileReader();
|
||||
reader->setCumulative(false);
|
||||
|
||||
// Find out what flags we pass on to qmake
|
||||
|
@@ -728,13 +728,13 @@ QStringList Qt4PriFileNode::varNames(FileType type)
|
||||
return vars;
|
||||
}
|
||||
|
||||
Qt4PriFileNode *Qt4PriFileNode::findProFileFor(const QString &fileName)
|
||||
Qt4ProFileNode *Qt4ProFileNode::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))
|
||||
if (Qt4ProFileNode *qt4ProFileNode = qobject_cast<Qt4ProFileNode *>(pn))
|
||||
if (Qt4ProFileNode *result = qt4ProFileNode->findProFileFor(fileName))
|
||||
return result;
|
||||
return 0;
|
||||
}
|
||||
@@ -1084,7 +1084,7 @@ QStringList Qt4ProFileNode::updateUiFiles()
|
||||
return toUpdate;
|
||||
}
|
||||
|
||||
ProFileReader *Qt4PriFileNode::createProFileReader() const
|
||||
ProFileReader *Qt4ProFileNode::createProFileReader() const
|
||||
{
|
||||
ProFileReader *reader = new ProFileReader();
|
||||
connect(reader, SIGNAL(errorFound(QString)),
|
||||
@@ -1096,7 +1096,7 @@ ProFileReader *Qt4PriFileNode::createProFileReader() const
|
||||
if (version->isValid())
|
||||
reader->setQtVersion(version);
|
||||
|
||||
reader->setOutputDir(m_qt4ProFileNode->buildDir());
|
||||
reader->setOutputDir(buildDir());
|
||||
|
||||
return reader;
|
||||
}
|
||||
@@ -1189,7 +1189,7 @@ QStringList Qt4ProFileNode::subDirsPaths(ProFileReader *reader) const
|
||||
return subProjectPaths;
|
||||
}
|
||||
|
||||
QString Qt4PriFileNode::buildDir() const
|
||||
QString Qt4ProFileNode::buildDir() const
|
||||
{
|
||||
const QDir srcDirRoot = QFileInfo(m_project->rootProjectNode()->path()).absoluteDir();
|
||||
const QString relativeDir = srcDirRoot.relativeFilePath(m_projectDir);
|
||||
|
@@ -128,10 +128,6 @@ 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);
|
||||
@@ -150,8 +146,6 @@ protected:
|
||||
QStringList *notChanged,
|
||||
ChangeType change);
|
||||
|
||||
QString buildDir() const;
|
||||
|
||||
private slots:
|
||||
void scheduleUpdate();
|
||||
|
||||
@@ -197,9 +191,16 @@ public:
|
||||
void updateCodeModelSupportFromBuild(const QStringList &files);
|
||||
void updateCodeModelSupportFromEditor(const QString &uiFileName, Designer::FormWindowEditor *fw);
|
||||
|
||||
QString buildDir() const;
|
||||
|
||||
QString uiDirectory() const;
|
||||
static QString uiHeaderFile(const QString &uiDir, const QString &formFile);
|
||||
|
||||
Qt4ProFileNode *findProFileFor(const QString &string);
|
||||
|
||||
//internal
|
||||
ProFileReader *createProFileReader() const;
|
||||
|
||||
public slots:
|
||||
void scheduleUpdate();
|
||||
void update();
|
||||
|
@@ -564,15 +564,15 @@ void Qt4RunConfiguration::updateTarget()
|
||||
return;
|
||||
//qDebug()<<"updateTarget";
|
||||
Qt4BuildConfiguration *qt4bc = qt4Project()->activeQt4BuildConfiguration();
|
||||
Qt4PriFileNode * priFileNode = qt4Project()->rootProjectNode()->findProFileFor(m_proFilePath);
|
||||
if (!priFileNode) {
|
||||
Qt4ProFileNode *proFileNode = qt4Project()->rootProjectNode()->findProFileFor(m_proFilePath);
|
||||
if (!proFileNode) {
|
||||
m_workingDir = QString::null;
|
||||
m_executable = QString::null;
|
||||
m_cachedTargetInformationValid = true;
|
||||
emit effectiveTargetInformationChanged();
|
||||
return;
|
||||
}
|
||||
ProFileReader *reader = priFileNode->createProFileReader();
|
||||
ProFileReader *reader = proFileNode->createProFileReader();
|
||||
reader->setCumulative(false);
|
||||
|
||||
// Find out what flags we pass on to qmake
|
||||
|
Reference in New Issue
Block a user