forked from qt-creator/qt-creator
Fix potential crash in updateSimulatorInformation.
This commit is contained in:
@@ -492,19 +492,23 @@ const MaemoToolChain *MaemoRunConfiguration::toolchain() const
|
|||||||
|
|
||||||
const QString MaemoRunConfiguration::gdbCmd() const
|
const QString MaemoRunConfiguration::gdbCmd() const
|
||||||
{
|
{
|
||||||
return toolchain() != 0
|
if (const MaemoToolChain *tc = toolchain())
|
||||||
? toolchain()->targetRoot() + "/bin/gdb"
|
return tc->targetRoot() + "/bin/gdb";
|
||||||
: QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MaemoRunConfiguration::maddeRoot() const
|
QString MaemoRunConfiguration::maddeRoot() const
|
||||||
{
|
{
|
||||||
return toolchain() != 0 ? toolchain()->maddeRoot() : QString();
|
if (const MaemoToolChain *tc = toolchain())
|
||||||
|
tc->maddeRoot();
|
||||||
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString MaemoRunConfiguration::sysRoot() const
|
const QString MaemoRunConfiguration::sysRoot() const
|
||||||
{
|
{
|
||||||
return toolchain() != 0 ? toolchain()->sysrootRoot() : QString();
|
if (const MaemoToolChain *tc = toolchain())
|
||||||
|
return toolchain()->sysrootRoot();
|
||||||
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
const QStringList MaemoRunConfiguration::arguments() const
|
const QStringList MaemoRunConfiguration::arguments() const
|
||||||
@@ -764,8 +768,10 @@ void MaemoRunConfiguration::updateSimulatorInformation()
|
|||||||
m_visibleSimulatorParameter = tr("Could not autodetect target simulator, "
|
m_visibleSimulatorParameter = tr("Could not autodetect target simulator, "
|
||||||
"please choose one on your own.");
|
"please choose one on your own.");
|
||||||
|
|
||||||
if (!m_isUserSetSimulator)
|
if (!m_isUserSetSimulator) {
|
||||||
m_simulatorPath = QDir::toNativeSeparators(toolchain()->simulatorRoot());
|
if (const MaemoToolChain *tc = toolchain())
|
||||||
|
m_simulatorPath = QDir::toNativeSeparators(tc->simulatorRoot());
|
||||||
|
}
|
||||||
|
|
||||||
if (!m_simulatorPath.isEmpty()) {
|
if (!m_simulatorPath.isEmpty()) {
|
||||||
m_visibleSimulatorParameter = tr("'%1' is not a valid Maemo simulator.")
|
m_visibleSimulatorParameter = tr("'%1' is not a valid Maemo simulator.")
|
||||||
|
Reference in New Issue
Block a user