Commit d4e1d7c6 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Header cleanup in Qt4ProjectManager.

Disentangle the covariant returns and introduce
convenience accessors.
Move internal classes away from Qt4Project.

Change-Id: I6c3158988824d2a159b1b3f8ecdf8432c32be2bc
Reviewed-on: http://codereview.qt.nokia.com/3216

Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@nokia.com>
parent 4c116bbd
......@@ -37,6 +37,8 @@
#include "subcomponentmanager.h"
#include "model/viewlogger.h"
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <itemlibraryview.h>
#include <itemlibrarywidget.h>
#include <navigatorview.h>
......
......@@ -32,6 +32,7 @@
#include "externaleditors.h"
#include "qt4project.h"
#include "qt4target.h"
#include "qt4projectmanagerconstants.h"
#include "qt4buildconfiguration.h"
......@@ -142,7 +143,7 @@ bool ExternalQtEditor::getEditorLaunchData(const QString &fileName,
// Get the binary either from the current Qt version of the project or Path
if (const Qt4Project *project = qt4ProjectFor(fileName)) {
if (const Qt4BaseTarget *target = project->activeTarget()) {
if (const Qt4BuildConfiguration *qt4bc = target->activeBuildConfiguration()) {
if (const Qt4BuildConfiguration *qt4bc = target->activeQt4BuildConfiguration()) {
if (const QtSupport::BaseQtVersion *qtVersion = qt4bc->qtVersion()) {
data->binary = (qtVersion->*commandAccessor)();
data->workingDirectory = project->projectDirectory();
......
......@@ -38,6 +38,7 @@
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/session.h>
#include <projectexplorer/project.h>
#include <projectexplorer/target.h>
#include <projectexplorer/toolchain.h>
#include <projectexplorer/buildconfiguration.h>
......
......@@ -35,6 +35,7 @@
#include "qt4project.h"
#include "qt4target.h"
#include "qt4nodes.h"
#include "qt4buildconfiguration.h"
#include "qt4projectmanagerconstants.h"
......@@ -222,7 +223,7 @@ bool MakeStep::init()
void MakeStep::run(QFutureInterface<bool> & fi)
{
if (qt4BuildConfiguration()->qt4Target()->qt4Project()->rootProjectNode()->projectType() == ScriptTemplate) {
if (qt4BuildConfiguration()->qt4Target()->qt4Project()->rootQt4ProjectNode()->projectType() == ScriptTemplate) {
fi.reportResult(true);
return;
}
......
......@@ -34,6 +34,8 @@
#include "wizards/targetsetuppage.h"
#include "qt4project.h"
#include <coreplugin/ifile.h>
#include <QtGui/QCheckBox>
#include <QtGui/QHeaderView>
#include <QtGui/QLabel>
......
......@@ -40,6 +40,7 @@
#include "qt4projectmanagerconstants.h"
#include "qt4projectmanager.h"
#include "qt4target.h"
#include "qt4nodes.h"
#include "qt4basetargetfactory.h"
#include "ui_showbuildlog.h"
......@@ -264,7 +265,7 @@ bool QMakeStep::init()
setOutputParser(new QMakeParser);
Qt4ProFileNode *node = qt4bc->qt4Target()->qt4Project()->rootProjectNode();
Qt4ProFileNode *node = qt4bc->qt4Target()->qt4Project()->rootQt4ProjectNode();
if (qt4bc->subNodeBuild())
node = qt4bc->subNodeBuild();
QString proFile = node->path();
......
......@@ -34,16 +34,14 @@
#define QMAKESTEP_H
#include "qt4projectmanager_global.h"
#include <QtCore/qglobal.h>
#include <projectexplorer/abstractprocessstep.h>
#include <QtCore/QStringList>
QT_BEGIN_NAMESPACE
namespace Ui { class QMakeStep; }
QT_END_NAMESPACE
#include <projectexplorer/abstractprocessstep.h>
#include <QtCore/QStringList>
namespace ProjectExplorer {
class BuildStep;
class IBuildStepFactory;
......
......@@ -32,7 +32,9 @@
#include "qt4desktoptarget.h"
#include "qt4project.h"
#include "qt4nodes.h"
#include "qt4runconfiguration.h"
#include "qt4buildconfiguration.h"
#include <projectexplorer/deployconfiguration.h>
#include <projectexplorer/customexecutablerunconfiguration.h>
#include <QtGui/QApplication>
......@@ -58,7 +60,7 @@ QString Qt4DesktopTarget::defaultDisplayName()
return QApplication::translate("Qt4ProjectManager::Qt4Target", "Desktop", "Qt4 Desktop target display name");
}
Qt4BuildConfigurationFactory *Qt4DesktopTarget::buildConfigurationFactory() const
ProjectExplorer::IBuildConfigurationFactory *Qt4DesktopTarget::buildConfigurationFactory() const
{
return m_buildConfigurationFactory;
}
......
......@@ -38,6 +38,7 @@
namespace Qt4ProjectManager {
class Qt4Project;
class Qt4BuildConfigurationFactory;
namespace Internal {
......@@ -49,7 +50,7 @@ public:
explicit Qt4DesktopTarget(Qt4Project *parent, const QString &id);
virtual ~Qt4DesktopTarget();
Qt4BuildConfigurationFactory *buildConfigurationFactory() const;
ProjectExplorer::IBuildConfigurationFactory *buildConfigurationFactory() const;
void createApplicationProFiles();
QList<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Node *n);
......
......@@ -42,6 +42,8 @@
#include <projectexplorer/customexecutablerunconfiguration.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <qtsupport/qtversionmanager.h>
#include <QtGui/QVBoxLayout>
#include <QtGui/QApplication>
#include <QtGui/QStyle>
......
......@@ -529,7 +529,7 @@ bool Qt4RunConfiguration::fromMap(const QVariantMap &map)
QString Qt4RunConfiguration::executable() const
{
Qt4Project *pro = qt4Target()->qt4Project();
TargetInformation ti = pro->rootProjectNode()->targetInformation(m_proFilePath);
TargetInformation ti = pro->rootQt4ProjectNode()->targetInformation(m_proFilePath);
if (!ti.valid)
return QString();
return ti.executable;
......@@ -565,7 +565,7 @@ QString Qt4RunConfiguration::baseWorkingDirectory() const
// else what the pro file reader tells us
Qt4Project *pro = qt4Target()->qt4Project();
TargetInformation ti = pro->rootProjectNode()->targetInformation(m_proFilePath);
TargetInformation ti = pro->rootQt4ProjectNode()->targetInformation(m_proFilePath);
if(!ti.valid)
return QString();
return ti.workingDir;
......@@ -609,7 +609,7 @@ Utils::Environment Qt4RunConfiguration::baseEnvironment() const
// The user could be linking to a library found via a -L/some/dir switch
// to find those libraries while actually running we explicitly prepend those
// dirs to the library search path
const Qt4ProFileNode *node = qt4Target()->qt4Project()->rootProjectNode()->findProFileFor(m_proFilePath);
const Qt4ProFileNode *node = qt4Target()->qt4Project()->rootQt4ProjectNode()->findProFileFor(m_proFilePath);
if (node) {
const QStringList libDirectories = node->variableValue(LibDirectoriesVar);
if (!libDirectories.isEmpty()) {
......@@ -676,7 +676,7 @@ QString Qt4RunConfiguration::proFilePath() const
QString Qt4RunConfiguration::dumperLibrary() const
{
QtSupport::BaseQtVersion *version = qt4Target()->activeBuildConfiguration()->qtVersion();
QtSupport::BaseQtVersion *version = qt4Target()->activeQt4BuildConfiguration()->qtVersion();
if (version)
return version->gdbDebuggingHelperLibrary();
return QString();
......@@ -684,7 +684,7 @@ QString Qt4RunConfiguration::dumperLibrary() const
QStringList Qt4RunConfiguration::dumperLibraryLocations() const
{
QtSupport::BaseQtVersion *version = qt4Target()->activeBuildConfiguration()->qtVersion();
QtSupport::BaseQtVersion *version = qt4Target()->activeQt4BuildConfiguration()->qtVersion();
if (version)
return version->debuggingHelperLibraryLocations();
return QStringList();
......
......@@ -32,7 +32,9 @@
#include "qt4simulatortarget.h"
#include "qt4project.h"
#include "qt4nodes.h"
#include "qt4runconfiguration.h"
#include "qt4buildconfiguration.h"
#include <projectexplorer/customexecutablerunconfiguration.h>
#include <projectexplorer/deployconfiguration.h>
......@@ -63,7 +65,7 @@ QString Qt4SimulatorTarget::defaultDisplayName()
return QApplication::translate("Qt4ProjectManager::Qt4Target", "Qt Simulator", "Qt4 Simulator target display name");
}
Qt4BuildConfigurationFactory *Qt4SimulatorTarget::buildConfigurationFactory() const
ProjectExplorer::IBuildConfigurationFactory *Qt4SimulatorTarget::buildConfigurationFactory() const
{
return m_buildConfigurationFactory;
}
......
......@@ -38,6 +38,7 @@
namespace Qt4ProjectManager {
class Qt4Project;
class Qt4BuildConfigurationFactory;
namespace Internal {
......@@ -49,7 +50,7 @@ public:
explicit Qt4SimulatorTarget(Qt4Project *parent, const QString &id);
virtual ~Qt4SimulatorTarget();
Qt4BuildConfigurationFactory *buildConfigurationFactory() const;
ProjectExplorer::IBuildConfigurationFactory *buildConfigurationFactory() const;
void createApplicationProFiles();
QList<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Node *n);
......
......@@ -36,6 +36,7 @@
#include "qt4project.h"
#include "qt4runconfiguration.h"
#include "qt4simulatortarget.h"
#include <qtsupport/qtversionmanager.h>
#include <projectexplorer/deployconfiguration.h>
#include <projectexplorer/projectexplorerconstants.h>
......
......@@ -33,6 +33,9 @@
#include "qt4symbiantarget.h"
#include "qt4projectmanagerconstants.h"
#include "qt4project.h"
#include "qt4nodes.h"
#include "qt4buildconfiguration.h"
#include "qt-s60/s60deployconfiguration.h"
#include "qt-s60/s60emulatorrunconfiguration.h"
#include "qt-s60/s60devicerunconfiguration.h"
......@@ -87,7 +90,7 @@ QIcon Qt4SymbianTarget::iconForId(const QString &id)
return QIcon();
}
Qt4BuildConfigurationFactory *Qt4SymbianTarget::buildConfigurationFactory() const
ProjectExplorer::IBuildConfigurationFactory *Qt4SymbianTarget::buildConfigurationFactory() const
{
return m_buildConfigurationFactory;
}
......
......@@ -39,6 +39,7 @@
namespace Qt4ProjectManager {
class Qt4Project;
class Qt4BuildConfigurationFactory;
namespace Internal {
......@@ -50,7 +51,7 @@ public:
explicit Qt4SymbianTarget(Qt4Project *parent, const QString &id);
virtual ~Qt4SymbianTarget();
Qt4BuildConfigurationFactory *buildConfigurationFactory() const;
ProjectExplorer::IBuildConfigurationFactory *buildConfigurationFactory() const;
QList<ProjectExplorer::ToolChain *> possibleToolChains(ProjectExplorer::BuildConfiguration *bc) const;
......
......@@ -46,6 +46,8 @@
#include <projectexplorer/customexecutablerunconfiguration.h>
#include <projectexplorer/toolchainmanager.h>
#include <qtsupport/qtversionmanager.h>
using ProjectExplorer::idFromMap;
using ProjectExplorer::Task;
using namespace Qt4ProjectManager;
......
......@@ -35,6 +35,7 @@
#include "s60manager.h"
#include "qt4project.h"
#include "qt4target.h"
#include "qt4nodes.h"
#include "qt4projectmanagerconstants.h"
#include "qt4buildconfiguration.h"
#include "qt4symbiantarget.h"
......@@ -267,7 +268,7 @@ ProjectExplorer::ToolChain *S60DeployConfiguration::toolChain() const
bool S60DeployConfiguration::isDebug() const
{
const Qt4BuildConfiguration *qt4bc = qt4Target()->activeBuildConfiguration();
const Qt4BuildConfiguration *qt4bc = qt4Target()->activeQt4BuildConfiguration();
return (qt4bc->qmakeBuildConfiguration() & QtSupport::BaseQtVersion::DebugBuild);
}
......@@ -278,7 +279,7 @@ QString S60DeployConfiguration::symbianTarget() const
const QtSupport::BaseQtVersion *S60DeployConfiguration::qtVersion() const
{
if (const Qt4BuildConfiguration *qt4bc = qt4Target()->activeBuildConfiguration())
if (const Qt4BuildConfiguration *qt4bc = qt4Target()->activeQt4BuildConfiguration())
return qt4bc->qtVersion();
return 0;
}
......
......@@ -41,6 +41,7 @@
#include <debugger/debuggerengine.h>
#include <debugger/debuggerstartparameters.h>
#include <projectexplorer/project.h>
#include <projectexplorer/buildconfiguration.h>
#include <utils/qtcassert.h>
#include <QtCore/QFileInfo>
......
......@@ -33,9 +33,11 @@
#include "s60devicerunconfiguration.h"
#include "qt4project.h"
#include "qt4nodes.h"
#include "qt4projectmanagerconstants.h"
#include "qt4symbiantarget.h"
#include "qt4target.h"
#include "qt4buildconfiguration.h"
#include "s60deployconfiguration.h"
#include "s60devicerunconfigurationwidget.h"
#include "s60manager.h"
......@@ -191,7 +193,7 @@ static inline QString fixBaseNameTarget(const QString &in)
QString S60DeviceRunConfiguration::targetName() const
{
TargetInformation ti = qt4Target()->qt4Project()->rootProjectNode()->targetInformation(projectFilePath());
TargetInformation ti = qt4Target()->qt4Project()->rootQt4ProjectNode()->targetInformation(projectFilePath());
if (!ti.valid)
return QString();
return ti.target;
......@@ -207,7 +209,7 @@ SymbianQtVersion *S60DeviceRunConfiguration::qtVersion() const
bool S60DeviceRunConfiguration::isDebug() const
{
const Qt4BuildConfiguration *qt4bc = qt4Target()->activeBuildConfiguration();
const Qt4BuildConfiguration *qt4bc = qt4Target()->activeQt4BuildConfiguration();
return (qt4bc->qmakeBuildConfiguration() & QtSupport::BaseQtVersion::DebugBuild);
}
......@@ -237,7 +239,7 @@ static inline QString localExecutableFromVersion(const SymbianQtVersion *qtv,
QString S60DeviceRunConfiguration::localExecutableFileName() const
{
TargetInformation ti = qt4Target()->qt4Project()->rootProjectNode()->targetInformation(projectFilePath());
TargetInformation ti = qt4Target()->qt4Project()->rootQt4ProjectNode()->targetInformation(projectFilePath());
if (!ti.valid)
return QString();
......
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