forked from qt-creator/qt-creator
Hide static cast in accessor methods
This commit is contained in:
@@ -51,6 +51,11 @@ CMakeBuildConfiguration::~CMakeBuildConfiguration()
|
||||
delete m_toolChain;
|
||||
}
|
||||
|
||||
CMakeProject *CMakeBuildConfiguration::cmakeProject() const
|
||||
{
|
||||
return static_cast<CMakeProject *>(project());
|
||||
}
|
||||
|
||||
ProjectExplorer::Environment CMakeBuildConfiguration::baseEnvironment() const
|
||||
{
|
||||
ProjectExplorer::Environment env = useSystemEnvironment() ?
|
||||
@@ -99,7 +104,7 @@ QString CMakeBuildConfiguration::buildDirectory() const
|
||||
{
|
||||
QString buildDirectory = value("buildDirectory").toString();
|
||||
if (buildDirectory.isEmpty())
|
||||
buildDirectory = static_cast<CMakeProject *>(project())->sourceDirectory() + "/qtcreator-build";
|
||||
buildDirectory = cmakeProject()->sourceDirectory() + "/qtcreator-build";
|
||||
return buildDirectory;
|
||||
}
|
||||
|
||||
|
@@ -46,6 +46,8 @@ public:
|
||||
CMakeBuildConfiguration(BuildConfiguration *source);
|
||||
~CMakeBuildConfiguration();
|
||||
|
||||
CMakeProject *cmakeProject() const;
|
||||
|
||||
ProjectExplorer::Environment environment() const;
|
||||
ProjectExplorer::Environment baseEnvironment() const;
|
||||
void setUserEnvironmentChanges(const QList<ProjectExplorer::EnvironmentItem> &diff);
|
||||
|
@@ -166,6 +166,11 @@ CMakeProject::~CMakeProject()
|
||||
delete m_rootNode;
|
||||
}
|
||||
|
||||
CMakeBuildConfiguration *CMakeProject::activeCMakeBuildConfiguration() const
|
||||
{
|
||||
return static_cast<CMakeBuildConfiguration *>(activeBuildConfiguration());
|
||||
}
|
||||
|
||||
IBuildConfigurationFactory *CMakeProject::buildConfigurationFactory() const
|
||||
{
|
||||
return m_buildConfigurationFactory;
|
||||
@@ -228,8 +233,8 @@ QString CMakeProject::sourceDirectory() const
|
||||
bool CMakeProject::parseCMakeLists()
|
||||
{
|
||||
// Find cbp file
|
||||
CMakeBuildConfiguration *activeCmakeBuildConfiguration = static_cast<CMakeBuildConfiguration *>(activeBuildConfiguration());
|
||||
QString cbpFile = CMakeManager::findCbpFile(activeCmakeBuildConfiguration->buildDirectory());
|
||||
CMakeBuildConfiguration *activeBC = activeCMakeBuildConfiguration();
|
||||
QString cbpFile = CMakeManager::findCbpFile(activeBC->buildDirectory());
|
||||
|
||||
// setFolderName
|
||||
m_rootNode->setFolderName(QFileInfo(cbpFile).completeBaseName());
|
||||
@@ -238,7 +243,7 @@ bool CMakeProject::parseCMakeLists()
|
||||
//qDebug()<<"Parsing file "<<cbpFile;
|
||||
if (cbpparser.parseCbpFile(cbpFile)) {
|
||||
// ToolChain
|
||||
activeCmakeBuildConfiguration->updateToolChain(cbpparser.compilerName());
|
||||
activeBC->updateToolChain(cbpparser.compilerName());
|
||||
|
||||
m_projectName = cbpparser.projectName();
|
||||
m_rootNode->setFolderName(cbpparser.projectName());
|
||||
@@ -291,7 +296,7 @@ bool CMakeProject::parseCMakeLists()
|
||||
|
||||
QStringList allIncludePaths;
|
||||
QStringList allFrameworkPaths;
|
||||
QList<ProjectExplorer::HeaderPath> allHeaderPaths = activeCmakeBuildConfiguration->toolChain()->systemHeaderPaths();
|
||||
QList<ProjectExplorer::HeaderPath> allHeaderPaths = activeBC->toolChain()->systemHeaderPaths();
|
||||
foreach (ProjectExplorer::HeaderPath headerPath, allHeaderPaths) {
|
||||
if (headerPath.kind() == ProjectExplorer::HeaderPath::FrameworkHeaderPath)
|
||||
allFrameworkPaths.append(headerPath.path());
|
||||
@@ -307,12 +312,12 @@ bool CMakeProject::parseCMakeLists()
|
||||
CppTools::CppModelManagerInterface::ProjectInfo pinfo = modelmanager->projectInfo(this);
|
||||
if (pinfo.includePaths != allIncludePaths
|
||||
|| pinfo.sourceFiles != m_files
|
||||
|| pinfo.defines != activeCmakeBuildConfiguration->toolChain()->predefinedMacros()
|
||||
|| pinfo.defines != activeBC->toolChain()->predefinedMacros()
|
||||
|| pinfo.frameworkPaths != allFrameworkPaths) {
|
||||
pinfo.includePaths = allIncludePaths;
|
||||
// TODO we only want C++ files, not all other stuff that might be in the project
|
||||
pinfo.sourceFiles = m_files;
|
||||
pinfo.defines = activeCmakeBuildConfiguration->toolChain()->predefinedMacros(); // TODO this is to simplistic
|
||||
pinfo.defines = activeBC->toolChain()->predefinedMacros(); // TODO this is to simplistic
|
||||
pinfo.frameworkPaths = allFrameworkPaths;
|
||||
modelmanager->updateProjectInfo(pinfo);
|
||||
modelmanager->updateSourceFiles(pinfo.sourceFiles);
|
||||
@@ -370,7 +375,7 @@ bool CMakeProject::parseCMakeLists()
|
||||
} else {
|
||||
// TODO report error
|
||||
qDebug()<<"Parsing failed";
|
||||
activeCmakeBuildConfiguration->updateToolChain(QString::null);
|
||||
activeBC->updateToolChain(QString::null);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@@ -91,6 +91,8 @@ public:
|
||||
CMakeProject(CMakeManager *manager, const QString &filename);
|
||||
~CMakeProject();
|
||||
|
||||
CMakeBuildConfiguration *activeCMakeBuildConfiguration() const;
|
||||
|
||||
virtual QString name() const;
|
||||
virtual Core::IFile *file() const;
|
||||
virtual ProjectExplorer::IBuildConfigurationFactory *buildConfigurationFactory() const;
|
||||
|
@@ -66,6 +66,12 @@ CMakeRunConfiguration::CMakeRunConfiguration(CMakeProject *pro, const QString &t
|
||||
|
||||
CMakeRunConfiguration::~CMakeRunConfiguration()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CMakeProject *CMakeRunConfiguration::cmakeProject() const
|
||||
{
|
||||
return static_cast<CMakeProject *>(project());
|
||||
}
|
||||
|
||||
QString CMakeRunConfiguration::type() const
|
||||
@@ -228,7 +234,7 @@ void CMakeRunConfiguration::setUserEnvironmentChanges(const QList<ProjectExplore
|
||||
|
||||
ProjectExplorer::ToolChain::ToolChainType CMakeRunConfiguration::toolChainType() const
|
||||
{
|
||||
CMakeBuildConfiguration *bc = static_cast<CMakeBuildConfiguration *>(project()->activeBuildConfiguration());
|
||||
CMakeBuildConfiguration *bc = cmakeProject()->activeCMakeBuildConfiguration();
|
||||
return bc->toolChainType();
|
||||
}
|
||||
|
||||
|
@@ -53,6 +53,8 @@ class CMakeRunConfiguration : public ProjectExplorer::LocalApplicationRunConfigu
|
||||
public:
|
||||
CMakeRunConfiguration(CMakeProject *pro, const QString &target, const QString &workingDirectory, const QString &title);
|
||||
virtual ~CMakeRunConfiguration();
|
||||
CMakeProject *cmakeProject() const;
|
||||
|
||||
virtual QString type() const;
|
||||
virtual QString executable() const;
|
||||
virtual RunMode runMode() const;
|
||||
|
@@ -64,6 +64,11 @@ MakeStep::~MakeStep()
|
||||
|
||||
}
|
||||
|
||||
CMakeBuildConfiguration *MakeStep::cmakeBuildConfiguration() const
|
||||
{
|
||||
return static_cast<CMakeBuildConfiguration *>(buildConfiguration());
|
||||
}
|
||||
|
||||
void MakeStep::setClean(bool clean)
|
||||
{
|
||||
m_clean = clean;
|
||||
@@ -96,7 +101,7 @@ void MakeStep::storeIntoLocalMap(QMap<QString, QVariant> &map)
|
||||
|
||||
bool MakeStep::init()
|
||||
{
|
||||
CMakeBuildConfiguration *bc = static_cast<CMakeBuildConfiguration *>(buildConfiguration());
|
||||
CMakeBuildConfiguration *bc = cmakeBuildConfiguration();
|
||||
// TODO, we should probably have a member cmakeBuildConfiguration();
|
||||
|
||||
setBuildParser(bc->buildParser());
|
||||
@@ -204,7 +209,7 @@ MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep)
|
||||
|
||||
// TODO update this list also on rescans of the CMakeLists.txt
|
||||
// TODO shouldn't be accessing project
|
||||
CMakeProject *pro = static_cast<CMakeProject *>(m_makeStep->buildConfiguration()->project());
|
||||
CMakeProject *pro = m_makeStep->cmakeBuildConfiguration()->cmakeProject();
|
||||
foreach(const QString& target, pro->targets()) {
|
||||
QListWidgetItem *item = new QListWidgetItem(target, m_targetsList);
|
||||
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
|
||||
@@ -254,7 +259,7 @@ void MakeStepConfigWidget::updateDetails()
|
||||
QStringList arguments = m_makeStep->m_buildTargets;
|
||||
arguments << m_makeStep->additionalArguments();
|
||||
|
||||
CMakeBuildConfiguration *bc = static_cast<CMakeBuildConfiguration *>(m_makeStep->buildConfiguration());
|
||||
CMakeBuildConfiguration *bc = m_makeStep->cmakeBuildConfiguration();
|
||||
m_summaryText = tr("<b>Make:</b> %1 %2").arg(bc->toolChain()->makeCommand(), arguments.join(" "));
|
||||
emit updateSummary();
|
||||
}
|
||||
|
@@ -41,7 +41,7 @@ QT_END_NAMESPACE
|
||||
namespace CMakeProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
class CMakeProject;
|
||||
class CMakeBuildConfiguration;
|
||||
|
||||
class MakeStep : public ProjectExplorer::AbstractMakeStep
|
||||
{
|
||||
@@ -52,6 +52,9 @@ public:
|
||||
MakeStep(ProjectExplorer::BuildConfiguration *bc);
|
||||
MakeStep(MakeStep *bs, ProjectExplorer::BuildConfiguration *bc);
|
||||
~MakeStep();
|
||||
|
||||
CMakeBuildConfiguration *cmakeBuildConfiguration() const;
|
||||
|
||||
virtual bool init();
|
||||
|
||||
virtual void run(QFutureInterface<bool> &fi);
|
||||
|
@@ -64,3 +64,8 @@ QString GenericBuildConfiguration::buildDirectory() const
|
||||
return buildDirectory;
|
||||
}
|
||||
|
||||
GenericProject *GenericBuildConfiguration::genericProject() const
|
||||
{
|
||||
return static_cast<GenericProject *>(project());
|
||||
}
|
||||
|
||||
|
@@ -45,6 +45,8 @@ public:
|
||||
GenericBuildConfiguration(GenericProject *pro);
|
||||
GenericBuildConfiguration(GenericBuildConfiguration *source);
|
||||
|
||||
GenericProject *genericProject() const;
|
||||
|
||||
virtual ProjectExplorer::Environment environment() const;
|
||||
virtual QString buildDirectory() const;
|
||||
};
|
||||
|
@@ -65,11 +65,16 @@ GenericMakeStep::~GenericMakeStep()
|
||||
{
|
||||
}
|
||||
|
||||
GenericBuildConfiguration *GenericMakeStep::genericBuildConfiguration() const
|
||||
{
|
||||
return static_cast<GenericBuildConfiguration *>(buildConfiguration());
|
||||
}
|
||||
|
||||
bool GenericMakeStep::init()
|
||||
{
|
||||
GenericBuildConfiguration *bc = static_cast<GenericBuildConfiguration *>(buildConfiguration());
|
||||
GenericBuildConfiguration *bc = genericBuildConfiguration();
|
||||
//TODO
|
||||
const QString buildParser = static_cast<GenericProject *>(bc->project())->buildParser(bc);
|
||||
const QString buildParser = genericBuildConfiguration()->genericProject()->buildParser(bc);
|
||||
setBuildParser(buildParser);
|
||||
|
||||
setEnabled(true);
|
||||
@@ -121,7 +126,7 @@ QString GenericMakeStep::makeCommand() const
|
||||
QString command = m_makeCommand;
|
||||
if (command.isEmpty()) {
|
||||
// TODO
|
||||
GenericProject *pro = static_cast<GenericProject *>(buildConfiguration()->project());
|
||||
GenericProject *pro = genericBuildConfiguration()->genericProject();
|
||||
if (ProjectExplorer::ToolChain *toolChain = pro->toolChain())
|
||||
command = toolChain->makeCommand();
|
||||
else
|
||||
@@ -183,7 +188,7 @@ GenericMakeStepConfigWidget::GenericMakeStepConfigWidget(GenericMakeStep *makeSt
|
||||
|
||||
// TODO update this list also on rescans of the GenericLists.txt
|
||||
//TODO
|
||||
GenericProject *pro = static_cast<GenericProject *>(m_makeStep->buildConfiguration()->project());
|
||||
GenericProject *pro = m_makeStep->genericBuildConfiguration()->genericProject();
|
||||
foreach (const QString &target, pro->targets()) {
|
||||
QListWidgetItem *item = new QListWidgetItem(target, m_ui->targetsList);
|
||||
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
|
||||
|
@@ -43,7 +43,7 @@ QT_END_NAMESPACE
|
||||
namespace GenericProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
class GenericProject;
|
||||
class GenericBuildConfiguration;
|
||||
class GenericMakeStepConfigWidget;
|
||||
|
||||
struct GenericMakeStepSettings
|
||||
@@ -59,6 +59,8 @@ public:
|
||||
GenericMakeStep(ProjectExplorer::BuildConfiguration *bc);
|
||||
GenericMakeStep(GenericMakeStep *bs, ProjectExplorer::BuildConfiguration *bc);
|
||||
~GenericMakeStep();
|
||||
GenericBuildConfiguration *genericBuildConfiguration() const;
|
||||
|
||||
virtual bool init();
|
||||
|
||||
virtual void run(QFutureInterface<bool> &fi);
|
||||
|
@@ -100,7 +100,7 @@ bool ExternalQtEditor::getEditorLaunchData(const QString &fileName,
|
||||
const Qt4Project *project = qt4ProjectFor(fileName);
|
||||
// Get the binary either from the current Qt version of the project or Path
|
||||
if (project) {
|
||||
Qt4BuildConfiguration *qt4bc = static_cast<Qt4BuildConfiguration *>(project->activeBuildConfiguration());
|
||||
Qt4BuildConfiguration *qt4bc = project->activeQt4BuildConfiguration();
|
||||
const QtVersion *qtVersion= qt4bc->qtVersion();
|
||||
data->binary = (qtVersion->*commandAccessor)();
|
||||
data->workingDirectory = QFileInfo(project->file()->fileName()).absolutePath();
|
||||
|
@@ -65,6 +65,11 @@ MakeStep::~MakeStep()
|
||||
|
||||
}
|
||||
|
||||
Qt4BuildConfiguration *MakeStep::qt4BuildConfiguration() const
|
||||
{
|
||||
return static_cast<Qt4BuildConfiguration *>(buildConfiguration());
|
||||
}
|
||||
|
||||
void MakeStep::setClean(bool clean)
|
||||
{
|
||||
m_clean = clean;
|
||||
@@ -97,7 +102,7 @@ void MakeStep::storeIntoLocalMap(QMap<QString, QVariant> &map)
|
||||
|
||||
bool MakeStep::init()
|
||||
{
|
||||
Qt4BuildConfiguration *bc = static_cast<Qt4BuildConfiguration *>(buildConfiguration());
|
||||
Qt4BuildConfiguration *bc = qt4BuildConfiguration();
|
||||
Environment environment = bc->environment();
|
||||
setEnvironment(environment);
|
||||
|
||||
@@ -164,7 +169,7 @@ bool MakeStep::init()
|
||||
|
||||
void MakeStep::run(QFutureInterface<bool> & fi)
|
||||
{
|
||||
if (static_cast<Qt4Project *>(buildConfiguration()->project())->rootProjectNode()->projectType() == ScriptTemplate) {
|
||||
if (qt4BuildConfiguration()->qt4Project()->rootProjectNode()->projectType() == ScriptTemplate) {
|
||||
fi.reportResult(true);
|
||||
return;
|
||||
}
|
||||
@@ -225,13 +230,13 @@ MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep)
|
||||
|
||||
void MakeStepConfigWidget::updateMakeOverrideLabel()
|
||||
{
|
||||
Qt4BuildConfiguration *qt4bc = static_cast<Qt4BuildConfiguration *>(m_makeStep->buildConfiguration());
|
||||
Qt4BuildConfiguration *qt4bc = m_makeStep->qt4BuildConfiguration();
|
||||
m_ui.makeLabel->setText(tr("Override %1:").arg(qt4bc->makeCommand()));
|
||||
}
|
||||
|
||||
void MakeStepConfigWidget::updateDetails()
|
||||
{
|
||||
Qt4BuildConfiguration *bc = static_cast<Qt4BuildConfiguration *>(m_makeStep->buildConfiguration());
|
||||
Qt4BuildConfiguration *bc = m_makeStep->qt4BuildConfiguration();
|
||||
QString workingDirectory = bc->buildDirectory();
|
||||
|
||||
QString makeCmd = bc->makeCommand();
|
||||
|
@@ -43,8 +43,9 @@ class Project;
|
||||
}
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
|
||||
namespace Internal {
|
||||
class Qt4BuildConfiguration;
|
||||
|
||||
class MakeStepFactory : public ProjectExplorer::IBuildStepFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -57,7 +58,7 @@ public:
|
||||
QStringList canCreateForBuildConfiguration(ProjectExplorer::BuildConfiguration *bc) const;
|
||||
QString displayNameForName(const QString &name) const;
|
||||
};
|
||||
}
|
||||
} //namespace Internal
|
||||
|
||||
class Qt4Project;
|
||||
|
||||
@@ -70,6 +71,9 @@ public:
|
||||
MakeStep(ProjectExplorer::BuildConfiguration *bc);
|
||||
MakeStep(MakeStep *bs, ProjectExplorer::BuildConfiguration *bc);
|
||||
~MakeStep();
|
||||
|
||||
Internal::Qt4BuildConfiguration *qt4BuildConfiguration() const;
|
||||
|
||||
virtual bool init();
|
||||
virtual void run(QFutureInterface<bool> &);
|
||||
virtual QString name();
|
||||
|
@@ -67,10 +67,15 @@ QMakeStep::~QMakeStep()
|
||||
{
|
||||
}
|
||||
|
||||
Qt4BuildConfiguration *QMakeStep::qt4BuildConfiguration() const
|
||||
{
|
||||
return static_cast<Qt4BuildConfiguration *>(buildConfiguration());
|
||||
}
|
||||
|
||||
QStringList QMakeStep::arguments()
|
||||
{
|
||||
QStringList additonalArguments = m_qmakeArgs;
|
||||
Qt4BuildConfiguration *bc = static_cast<Qt4BuildConfiguration *>(buildConfiguration());
|
||||
Qt4BuildConfiguration *bc = qt4BuildConfiguration();
|
||||
QStringList arguments;
|
||||
arguments << buildConfiguration()->project()->file()->fileName();
|
||||
arguments << "-r";
|
||||
@@ -112,7 +117,7 @@ QStringList QMakeStep::arguments()
|
||||
bool QMakeStep::init()
|
||||
{
|
||||
// TODO
|
||||
Qt4BuildConfiguration *qt4bc = static_cast<Qt4BuildConfiguration *>(buildConfiguration());
|
||||
Qt4BuildConfiguration *qt4bc = qt4BuildConfiguration();
|
||||
const QtVersion *qtVersion = qt4bc->qtVersion();
|
||||
|
||||
if (!qtVersion->isValid()) {
|
||||
@@ -155,8 +160,7 @@ bool QMakeStep::init()
|
||||
|
||||
void QMakeStep::run(QFutureInterface<bool> &fi)
|
||||
{
|
||||
//TODO
|
||||
Qt4Project *pro = static_cast<Qt4Project *>(buildConfiguration()->project());
|
||||
Qt4Project *pro = qt4BuildConfiguration()->qt4Project();
|
||||
if (pro->rootProjectNode()->projectType() == ScriptTemplate) {
|
||||
fi.reportResult(true);
|
||||
return;
|
||||
@@ -263,7 +267,7 @@ void QMakeStepConfigWidget::qtVersionChanged(ProjectExplorer::BuildConfiguration
|
||||
|
||||
void QMakeStepConfigWidget::updateTitleLabel()
|
||||
{
|
||||
Qt4BuildConfiguration *qt4bc = static_cast<Qt4BuildConfiguration *>(m_step->buildConfiguration());
|
||||
Qt4BuildConfiguration *qt4bc = m_step->qt4BuildConfiguration();
|
||||
const QtVersion *qtVersion = qt4bc->qtVersion();
|
||||
if (!qtVersion) {
|
||||
m_summaryText = tr("<b>QMake:</b> No Qt version set. QMake can not be run.");
|
||||
@@ -290,7 +294,7 @@ void QMakeStepConfigWidget::qmakeArgumentsLineEditTextEdited()
|
||||
m_step->setQMakeArguments(
|
||||
ProjectExplorer::Environment::parseCombinedArgString(m_ui.qmakeAdditonalArgumentsLineEdit->text()));
|
||||
|
||||
static_cast<Qt4Project *>(m_step->buildConfiguration()->project())->invalidateCachedTargetInformation();
|
||||
m_step->qt4BuildConfiguration()->qt4Project()->invalidateCachedTargetInformation();
|
||||
updateTitleLabel();
|
||||
updateEffectiveQMakeCall();
|
||||
}
|
||||
@@ -306,12 +310,12 @@ void QMakeStepConfigWidget::buildConfigurationChanged()
|
||||
buildConfiguration = buildConfiguration & ~QtVersion::DebugBuild;
|
||||
}
|
||||
bc->setValue("buildConfiguration", int(buildConfiguration));
|
||||
static_cast<Qt4Project *>(m_step->buildConfiguration()->project())->invalidateCachedTargetInformation();
|
||||
m_step->qt4BuildConfiguration()->qt4Project()->invalidateCachedTargetInformation();
|
||||
updateTitleLabel();
|
||||
updateEffectiveQMakeCall();
|
||||
// TODO if exact parsing is the default, we need to update the code model
|
||||
// and all the Qt4ProFileNodes
|
||||
//static_cast<Qt4Project *>(m_step->project())->update();
|
||||
// m_step->qt4Project()->update();
|
||||
}
|
||||
|
||||
QString QMakeStepConfigWidget::displayName() const
|
||||
@@ -337,7 +341,7 @@ void QMakeStepConfigWidget::init()
|
||||
|
||||
void QMakeStepConfigWidget::updateEffectiveQMakeCall()
|
||||
{
|
||||
Qt4BuildConfiguration *qt4bc = static_cast<Qt4BuildConfiguration *>(m_step->buildConfiguration());
|
||||
Qt4BuildConfiguration *qt4bc = m_step->qt4BuildConfiguration();
|
||||
const QtVersion *qtVersion = qt4bc->qtVersion();
|
||||
if (qtVersion) {
|
||||
QString program = QFileInfo(qtVersion->qmakeCommand()).fileName();
|
||||
|
@@ -43,7 +43,10 @@ class Project;
|
||||
}
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
class Qt4Project;
|
||||
|
||||
namespace Internal {
|
||||
class Qt4BuildConfiguration;
|
||||
|
||||
class QMakeStepFactory : public ProjectExplorer::IBuildStepFactory
|
||||
{
|
||||
@@ -57,9 +60,9 @@ public:
|
||||
QStringList canCreateForBuildConfiguration(ProjectExplorer::BuildConfiguration *bc) const;
|
||||
QString displayNameForName(const QString &name) const;
|
||||
};
|
||||
}
|
||||
|
||||
class Qt4Project;
|
||||
} // namespace Internal
|
||||
|
||||
|
||||
class QMakeStep : public ProjectExplorer::AbstractMakeStep
|
||||
{
|
||||
@@ -68,6 +71,7 @@ public:
|
||||
QMakeStep(ProjectExplorer::BuildConfiguration *bc);
|
||||
QMakeStep(QMakeStep *bs, ProjectExplorer::BuildConfiguration *bc);
|
||||
~QMakeStep();
|
||||
Internal::Qt4BuildConfiguration *qt4BuildConfiguration() const;
|
||||
virtual bool init();
|
||||
virtual void run(QFutureInterface<bool> &);
|
||||
virtual QString name();
|
||||
|
@@ -322,7 +322,7 @@ Qt4Project *MaemoRunConfiguration::project() const
|
||||
|
||||
bool MaemoRunConfiguration::isEnabled() const
|
||||
{
|
||||
Qt4BuildConfiguration *qt4bc = static_cast<Qt4BuildConfiguration *>(project()->activeBuildConfiguration());
|
||||
Qt4BuildConfiguration *qt4bc = project()->activeQt4BuildConfiguration();
|
||||
QTC_ASSERT(qt4bc, return false);
|
||||
ToolChain::ToolChainType type = qt4bc->toolChainType();
|
||||
return type == ToolChain::GCC_MAEMO;
|
||||
@@ -411,7 +411,7 @@ void MaemoRunConfiguration::wasDeployed()
|
||||
|
||||
bool MaemoRunConfiguration::hasDebuggingHelpers() const
|
||||
{
|
||||
Qt4BuildConfiguration *qt4bc = static_cast<Qt4BuildConfiguration *>(project()->activeBuildConfiguration());
|
||||
Qt4BuildConfiguration *qt4bc = project()->activeQt4BuildConfiguration();
|
||||
return qt4bc->qtVersion()->hasDebuggingHelper();
|
||||
}
|
||||
|
||||
@@ -517,7 +517,7 @@ const QStringList MaemoRunConfiguration::arguments() const
|
||||
|
||||
const QString MaemoRunConfiguration::dumperLib() const
|
||||
{
|
||||
Qt4BuildConfiguration *qt4bc = static_cast<Qt4BuildConfiguration *>(project()->activeBuildConfiguration());
|
||||
Qt4BuildConfiguration *qt4bc = project()->activeQt4BuildConfiguration();
|
||||
return qt4bc->qtVersion()->debuggingHelperLibrary();
|
||||
}
|
||||
|
||||
@@ -666,8 +666,8 @@ void MaemoRunConfiguration::updateTarget()
|
||||
m_executable = QString::null;
|
||||
m_cachedTargetInformationValid = true;
|
||||
|
||||
if (Qt4Project *qt4Project = static_cast<Qt4Project *>(project())) {
|
||||
Qt4BuildConfiguration *qt4bc = static_cast<Qt4BuildConfiguration *>(project()->activeBuildConfiguration());
|
||||
if (Qt4Project *qt4Project = project()) {
|
||||
Qt4BuildConfiguration *qt4bc = qt4Project->activeQt4BuildConfiguration();
|
||||
Qt4PriFileNode * priFileNode = qt4Project->rootProjectNode()
|
||||
->findProFileFor(m_proFilePath);
|
||||
if (!priFileNode) {
|
||||
|
@@ -55,6 +55,7 @@
|
||||
#include <QtGui/QMainWindow>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Qt4ProjectManager;
|
||||
using namespace Qt4ProjectManager::Internal;
|
||||
|
||||
enum { debug = 0 };
|
||||
@@ -99,6 +100,11 @@ S60DeviceRunConfiguration::~S60DeviceRunConfiguration()
|
||||
{
|
||||
}
|
||||
|
||||
Qt4Project *S60DeviceRunConfiguration::qt4Project() const
|
||||
{
|
||||
return static_cast<Qt4Project *>(project());
|
||||
}
|
||||
|
||||
QString S60DeviceRunConfiguration::type() const
|
||||
{
|
||||
return QLatin1String("Qt4ProjectManager.DeviceRunConfiguration");
|
||||
@@ -259,8 +265,8 @@ void S60DeviceRunConfiguration::updateTarget()
|
||||
{
|
||||
if (m_cachedTargetInformationValid)
|
||||
return;
|
||||
Qt4BuildConfiguration *qt4bc = static_cast<Qt4BuildConfiguration *>(project()->activeBuildConfiguration());
|
||||
Qt4PriFileNode * priFileNode = static_cast<Qt4Project *>(project())->rootProjectNode()->findProFileFor(m_proFilePath);
|
||||
Qt4BuildConfiguration *qt4bc = qt4Project()->activeQt4BuildConfiguration();
|
||||
Qt4PriFileNode * priFileNode = qt4Project()->rootProjectNode()->findProFileFor(m_proFilePath);
|
||||
if (!priFileNode) {
|
||||
m_baseFileName = QString::null;
|
||||
m_cachedTargetInformationValid = true;
|
||||
@@ -418,10 +424,10 @@ S60DeviceRunControlBase::S60DeviceRunControlBase(RunConfiguration *runConfigurat
|
||||
connect(m_makesis, SIGNAL(finished(int,QProcess::ExitStatus)),
|
||||
this, SLOT(makesisProcessFinished()));
|
||||
|
||||
Qt4BuildConfiguration *activeBuildConf =
|
||||
static_cast<Qt4BuildConfiguration *>(runConfiguration->project()->activeBuildConfiguration());
|
||||
|
||||
S60DeviceRunConfiguration *s60runConfig = qobject_cast<S60DeviceRunConfiguration *>(runConfiguration);
|
||||
|
||||
Qt4BuildConfiguration *activeBuildConf = s60runConfig->qt4Project()->activeQt4BuildConfiguration();
|
||||
|
||||
QTC_ASSERT(s60runConfig, return);
|
||||
m_toolChain = s60runConfig->toolChainType();
|
||||
m_serialPortName = s60runConfig->serialPortName();
|
||||
|
@@ -47,6 +47,8 @@ namespace Debugger {
|
||||
}
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
class Qt4Project;
|
||||
|
||||
namespace Internal {
|
||||
|
||||
class S60DeviceRunConfiguration : public ProjectExplorer::RunConfiguration
|
||||
@@ -61,6 +63,8 @@ public:
|
||||
explicit S60DeviceRunConfiguration(ProjectExplorer::Project *project, const QString &proFilePath);
|
||||
~S60DeviceRunConfiguration();
|
||||
|
||||
Qt4Project *qt4Project() const;
|
||||
|
||||
QString type() const;
|
||||
bool isEnabled(ProjectExplorer::BuildConfiguration *configuration) const;
|
||||
QWidget *configurationWidget();
|
||||
|
@@ -48,6 +48,7 @@
|
||||
#include <QtGui/QLineEdit>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Qt4ProjectManager;
|
||||
using namespace Qt4ProjectManager::Internal;
|
||||
|
||||
// ======== S60EmulatorRunConfiguration
|
||||
@@ -72,6 +73,11 @@ S60EmulatorRunConfiguration::~S60EmulatorRunConfiguration()
|
||||
{
|
||||
}
|
||||
|
||||
Qt4Project *S60EmulatorRunConfiguration::qt4Project() const
|
||||
{
|
||||
return static_cast<Qt4Project *>(project());
|
||||
}
|
||||
|
||||
QString S60EmulatorRunConfiguration::type() const
|
||||
{
|
||||
return "Qt4ProjectManager.EmulatorRunConfiguration";
|
||||
@@ -114,8 +120,8 @@ void S60EmulatorRunConfiguration::updateTarget()
|
||||
{
|
||||
if (m_cachedTargetInformationValid)
|
||||
return;
|
||||
Qt4BuildConfiguration *qt4bc = static_cast<Qt4BuildConfiguration *>(project()->activeBuildConfiguration());
|
||||
Qt4PriFileNode * priFileNode = static_cast<Qt4Project *>(project())->rootProjectNode()->findProFileFor(m_proFilePath);
|
||||
Qt4BuildConfiguration *qt4bc = qt4Project()->activeQt4BuildConfiguration();
|
||||
Qt4PriFileNode * priFileNode = qt4Project()->rootProjectNode()->findProFileFor(m_proFilePath);
|
||||
if (!priFileNode) {
|
||||
m_executable = QString::null;
|
||||
m_cachedTargetInformationValid = true;
|
||||
@@ -282,8 +288,7 @@ S60EmulatorRunControl::S60EmulatorRunControl(S60EmulatorRunConfiguration *runCon
|
||||
{
|
||||
// stuff like the EPOCROOT and EPOCDEVICE env variable
|
||||
Environment env = Environment::systemEnvironment();
|
||||
Project *project = runConfiguration->project();
|
||||
static_cast<Qt4BuildConfiguration *>(project->activeBuildConfiguration())->toolChain()->addToEnvironment(env);
|
||||
runConfiguration->qt4Project()->activeQt4BuildConfiguration()->toolChain()->addToEnvironment(env);
|
||||
m_applicationLauncher.setEnvironment(env.toStringList());
|
||||
|
||||
m_executable = runConfiguration->executable();
|
||||
|
@@ -45,6 +45,8 @@ namespace Utils {
|
||||
}
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
class Qt4Project;
|
||||
|
||||
namespace Internal {
|
||||
|
||||
class S60EmulatorRunConfiguration : public ProjectExplorer::RunConfiguration
|
||||
@@ -54,6 +56,8 @@ public:
|
||||
S60EmulatorRunConfiguration(ProjectExplorer::Project *project, const QString &proFilePath);
|
||||
~S60EmulatorRunConfiguration();
|
||||
|
||||
Qt4Project *qt4Project() const;
|
||||
|
||||
QString type() const;
|
||||
bool isEnabled(ProjectExplorer::BuildConfiguration *configuration) const;
|
||||
QWidget *configurationWidget();
|
||||
|
@@ -59,6 +59,11 @@ Qt4BuildConfiguration::~Qt4BuildConfiguration()
|
||||
|
||||
}
|
||||
|
||||
Qt4Project *Qt4BuildConfiguration::qt4Project() const
|
||||
{
|
||||
return static_cast<Qt4Project *>(project());
|
||||
}
|
||||
|
||||
ProjectExplorer::Environment Qt4BuildConfiguration::baseEnvironment() const
|
||||
{
|
||||
Environment env = useSystemEnvironment() ? Environment::systemEnvironment() : Environment();
|
||||
@@ -221,13 +226,13 @@ void Qt4BuildConfiguration::setQtVersion(int id)
|
||||
{
|
||||
setValue(KEY_QT_VERSION_ID, id);
|
||||
emit qtVersionChanged();
|
||||
static_cast<Qt4Project *>(project())->updateActiveRunConfiguration();
|
||||
qt4Project()->updateActiveRunConfiguration();
|
||||
}
|
||||
|
||||
void Qt4BuildConfiguration::setToolChainType(ProjectExplorer::ToolChain::ToolChainType type)
|
||||
{
|
||||
setValue("ToolChain", (int)type);
|
||||
static_cast<Qt4Project *>(project())->updateActiveRunConfiguration();
|
||||
qt4Project()->updateActiveRunConfiguration();
|
||||
}
|
||||
|
||||
ProjectExplorer::ToolChain::ToolChainType Qt4BuildConfiguration::toolChainType() const
|
||||
|
@@ -51,6 +51,8 @@ public:
|
||||
Qt4BuildConfiguration(Qt4BuildConfiguration *source);
|
||||
~Qt4BuildConfiguration();
|
||||
|
||||
Qt4Project *qt4Project() const;
|
||||
|
||||
ProjectExplorer::Environment environment() const;
|
||||
ProjectExplorer::Environment baseEnvironment() const;
|
||||
void setUserEnvironmentChanges(const QList<ProjectExplorer::EnvironmentItem> &diff);
|
||||
|
@@ -1102,7 +1102,7 @@ ProFileReader *Qt4PriFileNode::createProFileReader() const
|
||||
connect(reader, SIGNAL(errorFound(QString)),
|
||||
m_project, SLOT(proFileParseError(QString)));
|
||||
|
||||
Qt4BuildConfiguration *qt4bc = static_cast<Qt4BuildConfiguration *>(m_project->activeBuildConfiguration());
|
||||
Qt4BuildConfiguration *qt4bc = m_project->activeQt4BuildConfiguration();
|
||||
|
||||
QtVersion *version = qt4bc->qtVersion();
|
||||
if (version->isValid())
|
||||
|
@@ -336,6 +336,11 @@ Qt4Project::~Qt4Project()
|
||||
delete m_projectFiles;
|
||||
}
|
||||
|
||||
Qt4BuildConfiguration *Qt4Project::activeQt4BuildConfiguration() const
|
||||
{
|
||||
return static_cast<Qt4BuildConfiguration *>(activeBuildConfiguration());
|
||||
}
|
||||
|
||||
void Qt4Project::defaultQtVersionChanged()
|
||||
{
|
||||
if (static_cast<Qt4BuildConfiguration *>(activeBuildConfiguration())->qtVersionId() == 0)
|
||||
@@ -521,7 +526,7 @@ void Qt4Project::updateCodeModel()
|
||||
if (debug)
|
||||
qDebug()<<"Qt4Project::updateCodeModel()";
|
||||
|
||||
Qt4BuildConfiguration *activeQt4BuildConfiguration = static_cast<Qt4BuildConfiguration *>(activeBuildConfiguration());
|
||||
Qt4BuildConfiguration *activeBC = activeQt4BuildConfiguration();
|
||||
|
||||
CppTools::CppModelManagerInterface *modelmanager =
|
||||
ExtensionSystem::PluginManager::instance()
|
||||
@@ -534,7 +539,7 @@ void Qt4Project::updateCodeModel()
|
||||
QStringList predefinedFrameworkPaths;
|
||||
QByteArray predefinedMacros;
|
||||
|
||||
ToolChain *tc = activeQt4BuildConfiguration->toolChain();
|
||||
ToolChain *tc = activeBC->toolChain();
|
||||
QList<HeaderPath> allHeaderPaths;
|
||||
if (tc) {
|
||||
predefinedMacros = tc->predefinedMacros();
|
||||
@@ -553,7 +558,7 @@ void Qt4Project::updateCodeModel()
|
||||
predefinedIncludePaths.append(headerPath.path());
|
||||
}
|
||||
|
||||
const QHash<QString, QString> versionInfo = activeQt4BuildConfiguration->qtVersion()->versionInfo();
|
||||
const QHash<QString, QString> versionInfo = activeBC->qtVersion()->versionInfo();
|
||||
const QString newQtIncludePath = versionInfo.value(QLatin1String("QT_INSTALL_HEADERS"));
|
||||
|
||||
predefinedIncludePaths.append(newQtIncludePath);
|
||||
@@ -638,7 +643,7 @@ void Qt4Project::updateCodeModel()
|
||||
}
|
||||
|
||||
// Add mkspec directory
|
||||
info.includes.append(activeQt4BuildConfiguration->qtVersion()->mkspecPath());
|
||||
info.includes.append(activeBC->qtVersion()->mkspecPath());
|
||||
|
||||
info.frameworkPaths = allFrameworkPaths;
|
||||
|
||||
@@ -652,7 +657,7 @@ void Qt4Project::updateCodeModel()
|
||||
}
|
||||
|
||||
// Add mkspec directory
|
||||
allIncludePaths.append(activeQt4BuildConfiguration->qtVersion()->mkspecPath());
|
||||
allIncludePaths.append(activeBC->qtVersion()->mkspecPath());
|
||||
|
||||
// Dump things out
|
||||
// This is debugging output...
|
||||
|
@@ -158,6 +158,8 @@ public:
|
||||
explicit Qt4Project(Qt4Manager *manager, const QString &proFile);
|
||||
virtual ~Qt4Project();
|
||||
|
||||
Internal::Qt4BuildConfiguration *activeQt4BuildConfiguration() const;
|
||||
|
||||
QString name() const;
|
||||
Core::IFile *file() const;
|
||||
ProjectExplorer::IProjectManager *projectManager() const;
|
||||
|
@@ -221,7 +221,7 @@ void Qt4ProjectConfigWidget::shadowBuildCheckBoxClicked(bool checked)
|
||||
else
|
||||
m_buildConfiguration->setValue("buildDirectory", QVariant(QString::null));
|
||||
updateDetails();
|
||||
static_cast<Qt4Project *>(m_buildConfiguration->project())->invalidateCachedTargetInformation();
|
||||
m_buildConfiguration->qt4Project()->invalidateCachedTargetInformation();
|
||||
updateImportLabel();
|
||||
}
|
||||
|
||||
@@ -261,7 +261,7 @@ void Qt4ProjectConfigWidget::shadowBuildLineEditTextChanged()
|
||||
// offer to import it
|
||||
updateImportLabel();
|
||||
|
||||
static_cast<Qt4Project *>(m_buildConfiguration->project())->invalidateCachedTargetInformation();
|
||||
m_buildConfiguration->qt4Project()->invalidateCachedTargetInformation();
|
||||
updateDetails();
|
||||
}
|
||||
|
||||
@@ -339,7 +339,7 @@ void Qt4ProjectConfigWidget::qtVersionComboBoxCurrentIndexChanged(const QString
|
||||
if (newQtVersion != m_buildConfiguration->qtVersionId()) {
|
||||
m_buildConfiguration->setQtVersion(newQtVersion);
|
||||
updateToolChainCombo();
|
||||
static_cast<Qt4Project *>(m_buildConfiguration->project())->update();
|
||||
m_buildConfiguration->qt4Project()->update();
|
||||
}
|
||||
updateDetails();
|
||||
}
|
||||
@@ -359,7 +359,7 @@ void Qt4ProjectConfigWidget::updateToolChainCombo()
|
||||
void Qt4ProjectConfigWidget::selectToolChain(int index)
|
||||
{
|
||||
setToolChain(index);
|
||||
static_cast<Qt4Project *>(m_buildConfiguration->project())->update();
|
||||
m_buildConfiguration->qt4Project()->update();
|
||||
}
|
||||
|
||||
void Qt4ProjectConfigWidget::setToolChain(int index)
|
||||
|
@@ -89,6 +89,11 @@ Qt4RunConfiguration::~Qt4RunConfiguration()
|
||||
{
|
||||
}
|
||||
|
||||
Qt4Project *Qt4RunConfiguration::qt4Project() const
|
||||
{
|
||||
return static_cast<Qt4Project *>(project());
|
||||
}
|
||||
|
||||
QString Qt4RunConfiguration::type() const
|
||||
{
|
||||
return "Qt4ProjectManager.Qt4RunConfiguration";
|
||||
@@ -555,8 +560,8 @@ void Qt4RunConfiguration::updateTarget()
|
||||
if (m_cachedTargetInformationValid)
|
||||
return;
|
||||
//qDebug()<<"updateTarget";
|
||||
Qt4BuildConfiguration *qt4bc = static_cast<Qt4BuildConfiguration *>(project()->activeBuildConfiguration());
|
||||
Qt4PriFileNode * priFileNode = static_cast<Qt4Project *>(project())->rootProjectNode()->findProFileFor(m_proFilePath);
|
||||
Qt4BuildConfiguration *qt4bc = qt4Project()->activeQt4BuildConfiguration();
|
||||
Qt4PriFileNode * priFileNode = qt4Project()->rootProjectNode()->findProFileFor(m_proFilePath);
|
||||
if (!priFileNode) {
|
||||
m_workingDir = QString::null;
|
||||
m_executable = QString::null;
|
||||
@@ -654,8 +659,7 @@ void Qt4RunConfiguration::invalidateCachedTargetInformation()
|
||||
|
||||
QString Qt4RunConfiguration::dumperLibrary() const
|
||||
{
|
||||
Qt4BuildConfiguration *qt4bc = static_cast<Qt4BuildConfiguration *>(project()->activeBuildConfiguration());
|
||||
QtVersion *version = qt4bc->qtVersion();
|
||||
QtVersion *version = qt4Project()->activeQt4BuildConfiguration()->qtVersion();
|
||||
if (version)
|
||||
return version->debuggingHelperLibrary();
|
||||
else
|
||||
@@ -664,8 +668,7 @@ QString Qt4RunConfiguration::dumperLibrary() const
|
||||
|
||||
QStringList Qt4RunConfiguration::dumperLibraryLocations() const
|
||||
{
|
||||
Qt4BuildConfiguration *qt4bc = static_cast<Qt4BuildConfiguration *>(project()->activeBuildConfiguration());
|
||||
QtVersion *version = qt4bc->qtVersion();
|
||||
QtVersion *version = qt4Project()->activeQt4BuildConfiguration()->qtVersion();
|
||||
if (version)
|
||||
return version->debuggingHelperLibraryLocations();
|
||||
else
|
||||
@@ -686,7 +689,7 @@ Qt4RunConfiguration::BaseEnvironmentBase Qt4RunConfiguration::baseEnvironmentBas
|
||||
}
|
||||
ProjectExplorer::ToolChain::ToolChainType Qt4RunConfiguration::toolChainType() const
|
||||
{
|
||||
Qt4BuildConfiguration *qt4bc = static_cast<Qt4BuildConfiguration *>(project()->activeBuildConfiguration());
|
||||
Qt4BuildConfiguration *qt4bc = qt4Project()->activeQt4BuildConfiguration();
|
||||
return qt4bc->toolChainType();
|
||||
}
|
||||
|
||||
|
@@ -65,6 +65,8 @@ public:
|
||||
Qt4RunConfiguration(Qt4Project *pro, const QString &proFilePath);
|
||||
virtual ~Qt4RunConfiguration();
|
||||
|
||||
Qt4Project *qt4Project() const;
|
||||
|
||||
virtual QString type() const;
|
||||
virtual bool isEnabled(ProjectExplorer::BuildConfiguration *configuration) const;
|
||||
virtual QWidget *configurationWidget();
|
||||
|
@@ -89,7 +89,7 @@ void Qt4UiCodeModelSupport::setFileName(const QString &name)
|
||||
|
||||
bool Qt4UiCodeModelSupport::runUic(const QString &ui) const
|
||||
{
|
||||
Qt4BuildConfiguration *qt4bc = static_cast<Qt4BuildConfiguration *>(m_project->activeBuildConfiguration());
|
||||
Qt4BuildConfiguration *qt4bc = m_project->activeQt4BuildConfiguration();
|
||||
QProcess uic;
|
||||
uic.setEnvironment(m_project->activeBuildConfiguration()->environment().toStringList());
|
||||
uic.start(qt4bc->qtVersion()->uicCommand(), QStringList(), QIODevice::ReadWrite);
|
||||
|
Reference in New Issue
Block a user