Commit 67438b57 authored by con's avatar con
Browse files

Delete toolchain in more intelligent way.

Create a new one and check if it's the same as the old one,
has the advantage that cached data doesn't need to be retrieved again.
It was that way before tool chain was moved to Qt4Project.
parent d0627b1b
......@@ -13,9 +13,6 @@
* must probably be compiled for different toolchains
* Tool chains
* delete toolchain in more intelligent way (create a new one and
check if it's the same as the old one, has the advantage that
cached data doesn't need to be retrieved again)
* Qt4Project::setQtVersion should think about tool chains,
might be better to remove the magic in toolChainType method
* should the default make target be defined by the project
......@@ -26,6 +23,7 @@
* handling of active run config getting disabled not optimal yet
* might be better from a user perspective if the run configuration
defines possible tool chains
* auto-create run configurations the first time s60 qt is selected.
* Run on device
* makesis, signsis and applicationinstaller don't report errors back
......
......@@ -274,8 +274,7 @@ void Qt4Project::qtVersionsChanged()
m_rootProjectNode->update();
}
}
delete m_toolChain;
m_toolChain = 0;
updateToolChain(activeBuildConfiguration());
}
void Qt4Project::updateFileList()
......@@ -388,16 +387,29 @@ void Qt4Project::scheduleUpdateCodeModel(Qt4ProjectManager::Internal::Qt4ProFile
ProjectExplorer::ToolChain *Qt4Project::toolChain(const QString &buildConfiguration) const
{
if (!m_toolChain) {
m_toolChain = qtVersion(buildConfiguration)->createToolChain(toolChainType(buildConfiguration));
#ifdef QTCREATOR_WITH_S60
if (m_toolChain->type() == ToolChain::GCCE) {
static_cast<GCCEToolChain *>(m_toolChain)->setProject(this);
}
#endif
updateToolChain(buildConfiguration);
}
return m_toolChain;
}
void Qt4Project::updateToolChain(const QString &buildConfiguration) const
{
ProjectExplorer::ToolChain *tempToolChain;
tempToolChain = qtVersion(buildConfiguration)->createToolChain(toolChainType(buildConfiguration));
if (!ProjectExplorer::ToolChain::equals(m_toolChain, tempToolChain)) {
if (m_toolChain)
delete m_toolChain;
m_toolChain = tempToolChain;
} else {
delete tempToolChain;
}
#ifdef QTCREATOR_WITH_S60
if (m_toolChain && m_toolChain->type() == ToolChain::GCCE) {
static_cast<GCCEToolChain *>(m_toolChain)->setProject(this);
}
#endif
}
QString Qt4Project::makeCommand(const QString &buildConfiguration) const
{
ToolChain *tc = toolChain(buildConfiguration);
......@@ -847,8 +859,7 @@ void Qt4Project::setQtVersion(const QString &buildConfiguration, int id)
void Qt4Project::setToolChainType(const QString &buildConfiguration, ProjectExplorer::ToolChain::ToolChainType type)
{
setValue(buildConfiguration, "ToolChain", (int)type);
delete m_toolChain;
m_toolChain = 0;
updateToolChain(buildConfiguration);
updateActiveRunConfiguration();
}
......
......@@ -234,6 +234,7 @@ private:
static QString qmakeVarName(ProjectExplorer::FileType type);
void updateActiveRunConfiguration();
void updateToolChain(const QString &buildConfiguration) const;
Qt4Manager *m_manager;
Internal::Qt4ProFileNode *m_rootProjectNode;
......
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