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