Commit 158fe472 authored by ck's avatar ck
Browse files

Maemo: Missed some const_casts the last time.

parent 50f5f91b
......@@ -97,7 +97,7 @@ bool MaemoToolChain::equals(ToolChain *other) const
QString MaemoToolChain::maddeRoot() const
{
if (!m_maddeInitialized)
(const_cast<MaemoToolChain*> (this))->setMaddeRoot();
setMaddeRoot();
return m_maddeRoot;
}
......@@ -109,25 +109,25 @@ QString MaemoToolChain::targetRoot() const
QString MaemoToolChain::sysrootRoot() const
{
if (!m_sysrootInitialized)
(const_cast<MaemoToolChain*> (this))->setSysrootAndToolchain();
setSysrootAndToolchain();
return m_sysrootRoot;
}
QString MaemoToolChain::simulatorRoot() const
{
if (!m_simulatorInitialized)
(const_cast<MaemoToolChain*> (this))->setSimulatorRoot();
setSimulatorRoot();
return m_simulatorRoot;
}
QString MaemoToolChain::toolchainRoot() const
{
if (!m_toolchainInitialized)
(const_cast<MaemoToolChain*> (this))->setSysrootAndToolchain();
setSysrootAndToolchain();
return m_toolchainRoot;
}
void MaemoToolChain::setMaddeRoot()
void MaemoToolChain::setMaddeRoot() const
{
QDir dir(targetRoot());
dir.cdUp(); dir.cdUp();
......@@ -136,7 +136,7 @@ void MaemoToolChain::setMaddeRoot()
m_maddeRoot = dir.absolutePath();
}
void MaemoToolChain::setSimulatorRoot()
void MaemoToolChain::setSimulatorRoot() const
{
QString target = QDir::cleanPath(targetRoot());
target = target.mid(target.lastIndexOf(QLatin1Char('/')) + 1);
......@@ -171,7 +171,7 @@ void MaemoToolChain::setSimulatorRoot()
m_simulatorInitialized = true;
}
void MaemoToolChain::setSysrootAndToolchain()
void MaemoToolChain::setSysrootAndToolchain() const
{
QFile file(QDir::cleanPath(targetRoot()) + QLatin1String("/information"));
if (file.exists() && file.open(QIODevice::ReadOnly | QIODevice::Text)) {
......
......@@ -63,24 +63,24 @@ protected:
bool equals(ToolChain *other) const;
private:
void setMaddeRoot();
void setSimulatorRoot();
void setSysrootAndToolchain();
void setMaddeRoot() const;
void setSimulatorRoot() const;
void setSysrootAndToolchain() const;
private:
QString m_maddeRoot;
bool m_maddeInitialized;
mutable QString m_maddeRoot;
mutable bool m_maddeInitialized;
QString m_sysrootRoot;
bool m_sysrootInitialized;
mutable QString m_sysrootRoot;
mutable bool m_sysrootInitialized;
QString m_simulatorRoot;
bool m_simulatorInitialized;
mutable QString m_simulatorRoot;
mutable bool m_simulatorInitialized;
QString m_targetRoot;
QString m_toolchainRoot;
bool m_toolchainInitialized;
mutable QString m_toolchainRoot;
mutable bool m_toolchainInitialized;
};
} // namespace Internal
......
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