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:
Oswald Buddenhagen
2009-12-04 19:22:12 +01:00
parent b4e7500dbe
commit 3657acac5f
6 changed files with 25 additions and 25 deletions

View File

@@ -565,15 +565,14 @@ void MaemoRunConfiguration::updateTarget()
if (Qt4Project *qt4Project = project()) { if (Qt4Project *qt4Project = project()) {
Qt4BuildConfiguration *qt4bc = qt4Project->activeQt4BuildConfiguration(); Qt4BuildConfiguration *qt4bc = qt4Project->activeQt4BuildConfiguration();
Qt4PriFileNode * priFileNode = qt4Project->rootProjectNode() Qt4ProFileNode *proFileNode = qt4Project->rootProjectNode()->findProFileFor(m_proFilePath);
->findProFileFor(m_proFilePath); if (!proFileNode) {
if (!priFileNode) {
emit targetInformationChanged(); emit targetInformationChanged();
return; return;
} }
QtVersion *qtVersion = qt4bc->qtVersion(); QtVersion *qtVersion = qt4bc->qtVersion();
ProFileReader *reader = priFileNode->createProFileReader(); ProFileReader *reader = proFileNode->createProFileReader();
reader->setCumulative(false); reader->setCumulative(false);
// Find out what flags we pass on to qmake // Find out what flags we pass on to qmake

View File

@@ -281,15 +281,15 @@ void S60DeviceRunConfiguration::updateTarget()
if (m_cachedTargetInformationValid) if (m_cachedTargetInformationValid)
return; return;
Qt4BuildConfiguration *qt4bc = qt4Project()->activeQt4BuildConfiguration(); Qt4BuildConfiguration *qt4bc = qt4Project()->activeQt4BuildConfiguration();
Qt4PriFileNode * priFileNode = qt4Project()->rootProjectNode()->findProFileFor(m_proFilePath); Qt4ProFileNode *proFileNode = qt4Project()->rootProjectNode()->findProFileFor(m_proFilePath);
if (!priFileNode) { if (!proFileNode) {
m_baseFileName = QString::null; m_baseFileName = QString::null;
m_cachedTargetInformationValid = true; m_cachedTargetInformationValid = true;
emit targetInformationChanged(); emit targetInformationChanged();
return; return;
} }
QtVersion *qtVersion = qt4bc->qtVersion(); QtVersion *qtVersion = qt4bc->qtVersion();
ProFileReader *reader = priFileNode->createProFileReader(); ProFileReader *reader = proFileNode->createProFileReader();
reader->setCumulative(false); reader->setCumulative(false);
// Find out what flags we pass on to qmake // Find out what flags we pass on to qmake

View File

@@ -128,15 +128,15 @@ void S60EmulatorRunConfiguration::updateTarget()
if (m_cachedTargetInformationValid) if (m_cachedTargetInformationValid)
return; return;
Qt4BuildConfiguration *qt4bc = qt4Project()->activeQt4BuildConfiguration(); Qt4BuildConfiguration *qt4bc = qt4Project()->activeQt4BuildConfiguration();
Qt4PriFileNode * priFileNode = qt4Project()->rootProjectNode()->findProFileFor(m_proFilePath); Qt4ProFileNode *proFileNode = qt4Project()->rootProjectNode()->findProFileFor(m_proFilePath);
if (!priFileNode) { if (!proFileNode) {
m_executable = QString::null; m_executable = QString::null;
m_cachedTargetInformationValid = true; m_cachedTargetInformationValid = true;
emit targetInformationChanged(); emit targetInformationChanged();
return; return;
} }
QtVersion *qtVersion = qt4bc->qtVersion(); QtVersion *qtVersion = qt4bc->qtVersion();
ProFileReader *reader = priFileNode->createProFileReader(); ProFileReader *reader = proFileNode->createProFileReader();
reader->setCumulative(false); reader->setCumulative(false);
// Find out what flags we pass on to qmake // Find out what flags we pass on to qmake

View File

@@ -728,13 +728,13 @@ QStringList Qt4PriFileNode::varNames(FileType type)
return vars; return vars;
} }
Qt4PriFileNode *Qt4PriFileNode::findProFileFor(const QString &fileName) Qt4ProFileNode *Qt4ProFileNode::findProFileFor(const QString &fileName)
{ {
if (fileName == path()) if (fileName == path())
return this; return this;
foreach (ProjectNode *pn, subProjectNodes()) foreach (ProjectNode *pn, subProjectNodes())
if (Qt4PriFileNode *qt4PriFileNode = qobject_cast<Qt4PriFileNode *>(pn)) if (Qt4ProFileNode *qt4ProFileNode = qobject_cast<Qt4ProFileNode *>(pn))
if (Qt4PriFileNode *result = qt4PriFileNode->findProFileFor(fileName)) if (Qt4ProFileNode *result = qt4ProFileNode->findProFileFor(fileName))
return result; return result;
return 0; return 0;
} }
@@ -1084,7 +1084,7 @@ QStringList Qt4ProFileNode::updateUiFiles()
return toUpdate; return toUpdate;
} }
ProFileReader *Qt4PriFileNode::createProFileReader() const ProFileReader *Qt4ProFileNode::createProFileReader() const
{ {
ProFileReader *reader = new ProFileReader(); ProFileReader *reader = new ProFileReader();
connect(reader, SIGNAL(errorFound(QString)), connect(reader, SIGNAL(errorFound(QString)),
@@ -1096,7 +1096,7 @@ ProFileReader *Qt4PriFileNode::createProFileReader() const
if (version->isValid()) if (version->isValid())
reader->setQtVersion(version); reader->setQtVersion(version);
reader->setOutputDir(m_qt4ProFileNode->buildDir()); reader->setOutputDir(buildDir());
return reader; return reader;
} }
@@ -1189,7 +1189,7 @@ QStringList Qt4ProFileNode::subDirsPaths(ProFileReader *reader) const
return subProjectPaths; return subProjectPaths;
} }
QString Qt4PriFileNode::buildDir() const QString Qt4ProFileNode::buildDir() const
{ {
const QDir srcDirRoot = QFileInfo(m_project->rootProjectNode()->path()).absoluteDir(); const QDir srcDirRoot = QFileInfo(m_project->rootProjectNode()->path()).absoluteDir();
const QString relativeDir = srcDirRoot.relativeFilePath(m_projectDir); const QString relativeDir = srcDirRoot.relativeFilePath(m_projectDir);

View File

@@ -128,10 +128,6 @@ 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);
@@ -150,8 +146,6 @@ protected:
QStringList *notChanged, QStringList *notChanged,
ChangeType change); ChangeType change);
QString buildDir() const;
private slots: private slots:
void scheduleUpdate(); void scheduleUpdate();
@@ -197,9 +191,16 @@ public:
void updateCodeModelSupportFromBuild(const QStringList &files); void updateCodeModelSupportFromBuild(const QStringList &files);
void updateCodeModelSupportFromEditor(const QString &uiFileName, Designer::FormWindowEditor *fw); void updateCodeModelSupportFromEditor(const QString &uiFileName, Designer::FormWindowEditor *fw);
QString buildDir() const;
QString uiDirectory() const; QString uiDirectory() const;
static QString uiHeaderFile(const QString &uiDir, const QString &formFile); static QString uiHeaderFile(const QString &uiDir, const QString &formFile);
Qt4ProFileNode *findProFileFor(const QString &string);
//internal
ProFileReader *createProFileReader() const;
public slots: public slots:
void scheduleUpdate(); void scheduleUpdate();
void update(); void update();

View File

@@ -564,15 +564,15 @@ void Qt4RunConfiguration::updateTarget()
return; return;
//qDebug()<<"updateTarget"; //qDebug()<<"updateTarget";
Qt4BuildConfiguration *qt4bc = qt4Project()->activeQt4BuildConfiguration(); Qt4BuildConfiguration *qt4bc = qt4Project()->activeQt4BuildConfiguration();
Qt4PriFileNode * priFileNode = qt4Project()->rootProjectNode()->findProFileFor(m_proFilePath); Qt4ProFileNode *proFileNode = qt4Project()->rootProjectNode()->findProFileFor(m_proFilePath);
if (!priFileNode) { if (!proFileNode) {
m_workingDir = QString::null; m_workingDir = QString::null;
m_executable = QString::null; m_executable = QString::null;
m_cachedTargetInformationValid = true; m_cachedTargetInformationValid = true;
emit effectiveTargetInformationChanged(); emit effectiveTargetInformationChanged();
return; return;
} }
ProFileReader *reader = priFileNode->createProFileReader(); ProFileReader *reader = proFileNode->createProFileReader();
reader->setCumulative(false); reader->setCumulative(false);
// Find out what flags we pass on to qmake // Find out what flags we pass on to qmake