Commit fed63463 authored by kh1's avatar kh1

No need to cache the Qt version for this simple task.

Might fix some sporadic crashes that can be seen on first creator run.
parent 615105cc
......@@ -51,10 +51,10 @@ MaemoToolChain::MaemoToolChain(const Qt4ProjectManager::QtVersion *version)
, m_maddeInitialized(false)
, m_sysrootInitialized(false)
, m_simulatorInitialized(false)
, m_targetInitialized(false)
, m_toolchainInitialized(false)
, m_version(version)
{
QString qmake = QDir::cleanPath(version->qmakeCommand());
m_targetRoot = qmake.remove(QLatin1String("/bin/qmake" EXEC_SUFFIX));
}
MaemoToolChain::~MaemoToolChain()
......@@ -79,18 +79,16 @@ QList<HeaderPath> MaemoToolChain::systemHeaderPaths()
void MaemoToolChain::addToEnvironment(ProjectExplorer::Environment &env)
{
if (m_version) {
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/bin")
.arg(maddeRoot())));
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/bin")
.arg(targetRoot())));
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/bin")
.arg(toolchainRoot())));
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/bin")
.arg(maddeRoot())));
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/bin")
.arg(targetRoot())));
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/bin")
.arg(toolchainRoot())));
#ifdef Q_OS_WIN
env.set("HOME", QDir::toNativeSeparators(maddeRoot()
+ QLatin1String("/home/") + QDir::home().dirName()));
env.set("HOME", QDir::toNativeSeparators(maddeRoot()
+ QLatin1String("/home/") + QDir::home().dirName()));
#endif
}
}
QString MaemoToolChain::makeCommand() const
......@@ -117,8 +115,6 @@ QString MaemoToolChain::maddeRoot() const
QString MaemoToolChain::targetRoot() const
{
if (!m_targetInitialized)
(const_cast<MaemoToolChain*> (this))->setTargetRoot();
return m_targetRoot;
}
......@@ -143,13 +139,6 @@ QString MaemoToolChain::toolchainRoot() const
return m_toolchainRoot;
}
void MaemoToolChain::setTargetRoot()
{
m_targetInitialized = true;
QString qmake = QDir::cleanPath(m_version->qmakeCommand());
m_targetRoot = qmake.remove(QLatin1String("/bin/qmake" EXEC_SUFFIX));
}
void MaemoToolChain::setMaddeRoot()
{
QDir dir(targetRoot());
......
......@@ -58,7 +58,6 @@ protected:
private:
void setMaddeRoot();
void setTargetRoot();
void setSimulatorRoot();
void setSysrootAndToolchain();
......@@ -73,12 +72,9 @@ private:
bool m_simulatorInitialized;
QString m_targetRoot;
bool m_targetInitialized;
QString m_toolchainRoot;
bool m_toolchainInitialized;
const Qt4ProjectManager::QtVersion *m_version;
};
} // 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