forked from qt-creator/qt-creator
Maemo: Get rid of const_casts.
Reviewed-by: kh1
This commit is contained in:
@@ -385,17 +385,31 @@ const QString MaemoRunConfiguration::dumperLib() const
|
|||||||
|
|
||||||
QString MaemoRunConfiguration::executable() const
|
QString MaemoRunConfiguration::executable() const
|
||||||
{
|
{
|
||||||
const_cast<MaemoRunConfiguration*> (this)->updateTarget();
|
updateTarget();
|
||||||
return m_executable;
|
return m_executable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString MaemoRunConfiguration::simulatorSshPort() const
|
||||||
|
{
|
||||||
|
if (!m_cachedSimulatorInformationValid)
|
||||||
|
updateTarget();
|
||||||
|
return m_simulatorSshPort;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString MaemoRunConfiguration::simulatorGdbServerPort() const
|
||||||
|
{
|
||||||
|
if (!m_cachedSimulatorInformationValid)
|
||||||
|
updateTarget();
|
||||||
|
return m_simulatorGdbServerPort;
|
||||||
|
}
|
||||||
|
|
||||||
QString MaemoRunConfiguration::simulatorPath() const
|
QString MaemoRunConfiguration::simulatorPath() const
|
||||||
{
|
{
|
||||||
qDebug("MaemoRunConfiguration::simulatorPath() called, %s",
|
qDebug("MaemoRunConfiguration::simulatorPath() called, %s",
|
||||||
qPrintable(m_simulatorPath));
|
qPrintable(m_simulatorPath));
|
||||||
|
|
||||||
if (!m_cachedSimulatorInformationValid)
|
if (!m_cachedSimulatorInformationValid)
|
||||||
const_cast<MaemoRunConfiguration*> (this)->updateSimulatorInformation();
|
updateSimulatorInformation();
|
||||||
return m_simulatorPath;
|
return m_simulatorPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -405,7 +419,7 @@ QString MaemoRunConfiguration::visibleSimulatorParameter() const
|
|||||||
qPrintable(m_visibleSimulatorParameter));
|
qPrintable(m_visibleSimulatorParameter));
|
||||||
|
|
||||||
if (!m_cachedSimulatorInformationValid)
|
if (!m_cachedSimulatorInformationValid)
|
||||||
const_cast<MaemoRunConfiguration*> (this)->updateSimulatorInformation();
|
updateSimulatorInformation();
|
||||||
return m_visibleSimulatorParameter;
|
return m_visibleSimulatorParameter;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -415,7 +429,7 @@ QString MaemoRunConfiguration::simulator() const
|
|||||||
qPrintable(m_simulator));
|
qPrintable(m_simulator));
|
||||||
|
|
||||||
if (!m_cachedSimulatorInformationValid)
|
if (!m_cachedSimulatorInformationValid)
|
||||||
const_cast<MaemoRunConfiguration*> (this)->updateSimulatorInformation();
|
updateSimulatorInformation();
|
||||||
return m_simulator;
|
return m_simulator;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -425,7 +439,7 @@ QString MaemoRunConfiguration::simulatorArgs() const
|
|||||||
qPrintable(m_simulatorArgs));
|
qPrintable(m_simulatorArgs));
|
||||||
|
|
||||||
if (!m_cachedSimulatorInformationValid)
|
if (!m_cachedSimulatorInformationValid)
|
||||||
const_cast<MaemoRunConfiguration*> (this)->updateSimulatorInformation();
|
updateSimulatorInformation();
|
||||||
return m_simulatorArgs;
|
return m_simulatorArgs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -445,7 +459,7 @@ void MaemoRunConfiguration::invalidateCachedTargetInformation()
|
|||||||
emit targetInformationChanged();
|
emit targetInformationChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoRunConfiguration::updateTarget()
|
void MaemoRunConfiguration::updateTarget() const
|
||||||
{
|
{
|
||||||
if (m_cachedTargetInformationValid)
|
if (m_cachedTargetInformationValid)
|
||||||
return;
|
return;
|
||||||
@@ -472,7 +486,7 @@ void MaemoRunConfiguration::updateTarget()
|
|||||||
emit targetInformationChanged();
|
emit targetInformationChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoRunConfiguration::updateSimulatorInformation()
|
void MaemoRunConfiguration::updateSimulatorInformation() const
|
||||||
{
|
{
|
||||||
if (m_cachedSimulatorInformationValid)
|
if (m_cachedSimulatorInformationValid)
|
||||||
return;
|
return;
|
||||||
@@ -481,6 +495,9 @@ void MaemoRunConfiguration::updateSimulatorInformation()
|
|||||||
m_simulatorPath.clear();
|
m_simulatorPath.clear();
|
||||||
m_simulatorArgs.clear();
|
m_simulatorArgs.clear();
|
||||||
m_visibleSimulatorParameter.clear();
|
m_visibleSimulatorParameter.clear();
|
||||||
|
m_simulatorLibPath.clear();
|
||||||
|
m_simulatorSshPort.clear();
|
||||||
|
m_simulatorGdbServerPort.clear();
|
||||||
m_cachedSimulatorInformationValid = true;
|
m_cachedSimulatorInformationValid = true;
|
||||||
|
|
||||||
if (const MaemoToolChain *tc = toolchain())
|
if (const MaemoToolChain *tc = toolchain())
|
||||||
|
|||||||
@@ -94,8 +94,8 @@ public:
|
|||||||
QString simulator() const;
|
QString simulator() const;
|
||||||
QString simulatorArgs() const;
|
QString simulatorArgs() const;
|
||||||
QString simulatorPath() const;
|
QString simulatorPath() const;
|
||||||
QString simulatorSshPort() const { return m_simulatorSshPort; }
|
QString simulatorSshPort() const;
|
||||||
QString simulatorGdbServerPort() const { return m_simulatorGdbServerPort; }
|
QString simulatorGdbServerPort() const;
|
||||||
QString visibleSimulatorParameter() const;
|
QString visibleSimulatorParameter() const;
|
||||||
|
|
||||||
const QString sshCmd() const;
|
const QString sshCmd() const;
|
||||||
@@ -109,8 +109,8 @@ public:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void deviceConfigurationsUpdated();
|
void deviceConfigurationsUpdated();
|
||||||
void targetInformationChanged();
|
void targetInformationChanged() const;
|
||||||
void cachedSimulatorInformationChanged();
|
void cachedSimulatorInformationChanged() const;
|
||||||
void qemuProcessStatus(bool running);
|
void qemuProcessStatus(bool running);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -130,24 +130,24 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void init();
|
void init();
|
||||||
void updateTarget();
|
void updateTarget() const;
|
||||||
void updateSimulatorInformation();
|
void updateSimulatorInformation() const;
|
||||||
const QString cmd(const QString &cmdName) const;
|
const QString cmd(const QString &cmdName) const;
|
||||||
const MaemoToolChain *toolchain() const;
|
const MaemoToolChain *toolchain() const;
|
||||||
bool fileNeedsDeployment(const QString &path, const QDateTime &lastDeployed) const;
|
bool fileNeedsDeployment(const QString &path, const QDateTime &lastDeployed) const;
|
||||||
|
|
||||||
QString m_executable;
|
mutable QString m_executable;
|
||||||
QString m_proFilePath;
|
QString m_proFilePath;
|
||||||
bool m_cachedTargetInformationValid;
|
mutable bool m_cachedTargetInformationValid;
|
||||||
|
|
||||||
QString m_simulator;
|
mutable QString m_simulator;
|
||||||
QString m_simulatorArgs;
|
mutable QString m_simulatorArgs;
|
||||||
QString m_simulatorPath;
|
mutable QString m_simulatorPath;
|
||||||
QString m_visibleSimulatorParameter;
|
mutable QString m_visibleSimulatorParameter;
|
||||||
QString m_simulatorLibPath;
|
mutable QString m_simulatorLibPath;
|
||||||
QString m_simulatorSshPort;
|
mutable QString m_simulatorSshPort;
|
||||||
QString m_simulatorGdbServerPort;
|
mutable QString m_simulatorGdbServerPort;
|
||||||
bool m_cachedSimulatorInformationValid;
|
mutable bool m_cachedSimulatorInformationValid;
|
||||||
|
|
||||||
QString m_gdbPath;
|
QString m_gdbPath;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user