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