forked from qt-creator/qt-creator
Maemo: Fix misdetection of maemo tool chains
Task-number: QTCREATORBUG-6876 Change-Id: I6410a9894c2482d2b6ea7f2fba9b67f7fdb4fff6 Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
@@ -61,12 +61,15 @@ static const char *const MAEMO_QT_VERSION_KEY = "Qt4ProjectManager.Maemo.QtVersi
|
|||||||
MaemoToolChain::MaemoToolChain(bool autodetected) :
|
MaemoToolChain::MaemoToolChain(bool autodetected) :
|
||||||
ProjectExplorer::GccToolChain(QLatin1String(Constants::MAEMO_TOOLCHAIN_ID), autodetected),
|
ProjectExplorer::GccToolChain(QLatin1String(Constants::MAEMO_TOOLCHAIN_ID), autodetected),
|
||||||
m_qtVersionId(-1)
|
m_qtVersionId(-1)
|
||||||
{ }
|
{
|
||||||
|
setQtVersionId(-1);
|
||||||
|
}
|
||||||
|
|
||||||
MaemoToolChain::MaemoToolChain(const MaemoToolChain &tc) :
|
MaemoToolChain::MaemoToolChain(const MaemoToolChain &tc) :
|
||||||
ProjectExplorer::GccToolChain(tc),
|
ProjectExplorer::GccToolChain(tc)
|
||||||
m_qtVersionId(tc.m_qtVersionId)
|
{
|
||||||
{ }
|
setQtVersionId(tc.m_qtVersionId);
|
||||||
|
}
|
||||||
|
|
||||||
MaemoToolChain::~MaemoToolChain()
|
MaemoToolChain::~MaemoToolChain()
|
||||||
{ }
|
{ }
|
||||||
@@ -169,6 +172,19 @@ QString MaemoToolChain::legacyId() const
|
|||||||
.arg(debuggerCommand().toString());
|
.arg(debuggerCommand().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QList<ProjectExplorer::Abi> MaemoToolChain::findAbiForCompilerPath(const QString &path)
|
||||||
|
{
|
||||||
|
Q_UNUSED(path);
|
||||||
|
if (m_qtVersionId < 0)
|
||||||
|
return QList<ProjectExplorer::Abi>();
|
||||||
|
|
||||||
|
MaemoQtVersion *mqv = dynamic_cast<MaemoQtVersion *>(QtSupport::QtVersionManager::instance()->version(m_qtVersionId));
|
||||||
|
if (!mqv)
|
||||||
|
return QList<ProjectExplorer::Abi>();
|
||||||
|
|
||||||
|
return mqv->qtAbis();
|
||||||
|
}
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
// MaemoToolChainConfigWidget
|
// MaemoToolChainConfigWidget
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
@@ -280,7 +296,7 @@ QList<ProjectExplorer::ToolChain *> MaemoToolChainFactory::createToolChainList(c
|
|||||||
tcm->deregisterToolChain(tc);
|
tcm->deregisterToolChain(tc);
|
||||||
|
|
||||||
const MaemoQtVersion * const mqv = dynamic_cast<MaemoQtVersion *>(v);
|
const MaemoQtVersion * const mqv = dynamic_cast<MaemoQtVersion *>(v);
|
||||||
if (!mqv || !mqv->isValid())
|
if (!mqv || !mqv->isValid() || mqv->qtAbis().isEmpty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// (Re-)add toolchain:
|
// (Re-)add toolchain:
|
||||||
|
@@ -68,6 +68,9 @@ public:
|
|||||||
|
|
||||||
QString legacyId() const;
|
QString legacyId() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QList<ProjectExplorer::Abi> findAbiForCompilerPath(const QString &path);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit MaemoToolChain(bool);
|
explicit MaemoToolChain(bool);
|
||||||
MaemoToolChain(const MaemoToolChain &);
|
MaemoToolChain(const MaemoToolChain &);
|
||||||
|
@@ -292,12 +292,14 @@ GccToolChain::GccToolChain(const QString &id, bool autodetect) :
|
|||||||
|
|
||||||
GccToolChain::GccToolChain(const GccToolChain &tc) :
|
GccToolChain::GccToolChain(const GccToolChain &tc) :
|
||||||
ToolChain(tc),
|
ToolChain(tc),
|
||||||
|
m_predefinedMacros(tc.predefinedMacros()),
|
||||||
m_compilerPath(tc.compilerPath()),
|
m_compilerPath(tc.compilerPath()),
|
||||||
m_debuggerCommand(tc.debuggerCommand()),
|
m_debuggerCommand(tc.debuggerCommand()),
|
||||||
m_targetAbi(tc.m_targetAbi)
|
m_targetAbi(tc.m_targetAbi),
|
||||||
{
|
m_supportedAbis(tc.m_supportedAbis),
|
||||||
setCompilerPath(tc.m_compilerPath);
|
m_headerPathes(tc.m_headerPathes),
|
||||||
}
|
m_version(tc.m_version)
|
||||||
|
{ }
|
||||||
|
|
||||||
QString GccToolChain::defaultDisplayName() const
|
QString GccToolChain::defaultDisplayName() const
|
||||||
{
|
{
|
||||||
@@ -308,6 +310,14 @@ QString GccToolChain::defaultDisplayName() const
|
|||||||
ProjectExplorer::Abi::toString(m_targetAbi.wordWidth()));
|
ProjectExplorer::Abi::toString(m_targetAbi.wordWidth()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QList<Abi> GccToolChain::findAbiForCompilerPath(const QString &path)
|
||||||
|
{
|
||||||
|
if (path.isEmpty())
|
||||||
|
return QList<Abi>();
|
||||||
|
|
||||||
|
return detectSupportedAbis();
|
||||||
|
}
|
||||||
|
|
||||||
QString GccToolChain::legacyId() const
|
QString GccToolChain::legacyId() const
|
||||||
{
|
{
|
||||||
QString i = id();
|
QString i = id();
|
||||||
@@ -339,14 +349,12 @@ void GccToolChain::setTargetAbi(const Abi &abi)
|
|||||||
if (abi == m_targetAbi)
|
if (abi == m_targetAbi)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
updateSupportedAbis();
|
|
||||||
m_targetAbi = abi;
|
m_targetAbi = abi;
|
||||||
toolChainUpdated();
|
toolChainUpdated();
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<Abi> GccToolChain::supportedAbis() const
|
QList<Abi> GccToolChain::supportedAbis() const
|
||||||
{
|
{
|
||||||
updateSupportedAbis();
|
|
||||||
return m_supportedAbis;
|
return m_supportedAbis;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -450,13 +458,11 @@ void GccToolChain::setCompilerPath(const QString &path)
|
|||||||
bool resetDisplayName = displayName() == defaultDisplayName();
|
bool resetDisplayName = displayName() == defaultDisplayName();
|
||||||
|
|
||||||
m_compilerPath = path;
|
m_compilerPath = path;
|
||||||
m_supportedAbis.clear();
|
|
||||||
|
|
||||||
Abi currentAbi = m_targetAbi;
|
Abi currentAbi = m_targetAbi;
|
||||||
|
m_supportedAbis = findAbiForCompilerPath(m_compilerPath);
|
||||||
|
|
||||||
m_targetAbi = Abi();
|
m_targetAbi = Abi();
|
||||||
if (!m_compilerPath.isEmpty()) {
|
|
||||||
updateSupportedAbis();
|
|
||||||
if (!m_supportedAbis.isEmpty()) {
|
if (!m_supportedAbis.isEmpty()) {
|
||||||
if (m_supportedAbis.contains(currentAbi))
|
if (m_supportedAbis.contains(currentAbi))
|
||||||
m_targetAbi = currentAbi;
|
m_targetAbi = currentAbi;
|
||||||
@@ -465,8 +471,8 @@ void GccToolChain::setCompilerPath(const QString &path)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (resetDisplayName)
|
if (resetDisplayName)
|
||||||
setDisplayName(defaultDisplayName());
|
setDisplayName(defaultDisplayName()); // calls toolChainUpdated()!
|
||||||
}
|
else
|
||||||
toolChainUpdated();
|
toolChainUpdated();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -80,7 +80,7 @@ public:
|
|||||||
|
|
||||||
bool operator ==(const ToolChain &) const;
|
bool operator ==(const ToolChain &) const;
|
||||||
|
|
||||||
virtual void setCompilerPath(const QString &);
|
void setCompilerPath(const QString &);
|
||||||
QString compilerPath() const;
|
QString compilerPath() const;
|
||||||
|
|
||||||
ToolChain *clone() const;
|
ToolChain *clone() const;
|
||||||
@@ -89,7 +89,8 @@ protected:
|
|||||||
GccToolChain(const QString &id, bool autodetect);
|
GccToolChain(const QString &id, bool autodetect);
|
||||||
GccToolChain(const GccToolChain &);
|
GccToolChain(const GccToolChain &);
|
||||||
|
|
||||||
QString defaultDisplayName() const;
|
virtual QString defaultDisplayName() const;
|
||||||
|
virtual QList<Abi> findAbiForCompilerPath(const QString &path);
|
||||||
|
|
||||||
virtual QList<Abi> detectSupportedAbis() const;
|
virtual QList<Abi> detectSupportedAbis() const;
|
||||||
virtual QString detectVersion() const;
|
virtual QString detectVersion() const;
|
||||||
|
Reference in New Issue
Block a user