forked from qt-creator/qt-creator
Fix update from GCCE and WINSCW set in Qt version
Fix the upgrade from GCCE and WINSCW from Qt version to tool chain. Task-number: QTCREATORBUG-4204 Reviewed-by: dt
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
|
||||
#include "gccetoolchain.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "qtversionmanager.h"
|
||||
|
||||
#include <utils/environment.h>
|
||||
#include <utils/synchronousprocess.h>
|
||||
@@ -149,6 +150,21 @@ QList<ProjectExplorer::ToolChain *> GcceToolChainFactory::autoDetect()
|
||||
{
|
||||
QList<ProjectExplorer::ToolChain *> result;
|
||||
|
||||
// Compatibility to pre-2.2:
|
||||
while (true) {
|
||||
const QString path = QtVersionManager::instance()->popPendingGcceUpdate();
|
||||
if (path.isNull())
|
||||
break;
|
||||
|
||||
QFileInfo fi(path + QLatin1String("/bin/arm-none-symbianelf-g++.exe"));
|
||||
if (fi.exists() && fi.isExecutable()) {
|
||||
GcceToolChain *tc = new GcceToolChain(false);
|
||||
tc->setCompilerPath(fi.absoluteFilePath());
|
||||
tc->setDisplayName(tr("GCCE from Qt version"));
|
||||
result.append(tc);
|
||||
}
|
||||
}
|
||||
|
||||
QString fullPath = Utils::Environment::systemEnvironment().searchInPath(QLatin1String("arm-none-symbianelf-gcc"));
|
||||
if (!fullPath.isEmpty()) {
|
||||
GcceToolChain *tc = new GcceToolChain(true);
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "winscwtoolchain.h"
|
||||
|
||||
#include "qt4projectmanager/qt4projectmanagerconstants.h"
|
||||
#include "qtversionmanager.h"
|
||||
|
||||
#include "ui_winscwtoolchainconfigwidget.h"
|
||||
#include "winscwparser.h"
|
||||
@@ -44,6 +45,7 @@
|
||||
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QStringList>
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
namespace Internal {
|
||||
@@ -377,6 +379,22 @@ QString WinscwToolChainFactory::id() const
|
||||
QList<ProjectExplorer::ToolChain *> WinscwToolChainFactory::autoDetect()
|
||||
{
|
||||
QList<ProjectExplorer::ToolChain *> result;
|
||||
|
||||
// Compatibility to pre-2.2:
|
||||
while (true) {
|
||||
const QString path = QtVersionManager::instance()->popPendingMwcUpdate();
|
||||
if (path.isNull())
|
||||
break;
|
||||
|
||||
QFileInfo fi(path + QLatin1String("/x86Build/Symbian_Tools/Command_Line_Tools/mwwinrc.exe"));
|
||||
if (fi.exists() && fi.isExecutable()) {
|
||||
WinscwToolChain *tc = new WinscwToolChain(false);
|
||||
tc->setCompilerPath(fi.absoluteFilePath());
|
||||
tc->setDisplayName(tr("WINSCW from Qt version"));
|
||||
result.append(tc);
|
||||
}
|
||||
}
|
||||
|
||||
QString cc = Utils::Environment::systemEnvironment().searchInPath(QLatin1String("mwwinrc"));
|
||||
if (!cc.isEmpty()) {
|
||||
WinscwToolChain *tc = new WinscwToolChain(true);
|
||||
|
||||
@@ -176,8 +176,8 @@ QtVersionManager::QtVersionManager()
|
||||
version->setSystemRoot(s->value("S60SDKDirectory").toString());
|
||||
version->setSbsV2Directory(s->value(QLatin1String("SBSv2Directory")).toString());
|
||||
|
||||
// Update from 2.1 or earlier:
|
||||
QString mingwDir = s->value(QLatin1String("MingwDirectory")).toString();
|
||||
// Update from pre-2.2:
|
||||
const QString mingwDir = s->value(QLatin1String("MingwDirectory")).toString();
|
||||
if (!mingwDir.isEmpty()) {
|
||||
QFileInfo fi(mingwDir + QLatin1String("/bin/g++.exe"));
|
||||
if (fi.exists() && fi.isExecutable()) {
|
||||
@@ -189,30 +189,12 @@ QtVersionManager::QtVersionManager()
|
||||
}
|
||||
}
|
||||
}
|
||||
QString mwcDir = s->value(QLatin1String("MwcDirectory")).toString();
|
||||
if (!mwcDir.isEmpty()) {
|
||||
QFileInfo fi(mwcDir + QLatin1String("/x86Build/Symbian_Tools/Command_Line_Tools/mwwinrc.exe"));
|
||||
if (fi.exists() && fi.isExecutable()) {
|
||||
WinscwToolChain *tc = createToolChain<WinscwToolChain>(Constants::WINSCW_TOOLCHAIN_ID);
|
||||
if (tc) {
|
||||
tc->setCompilerPath(fi.absoluteFilePath());
|
||||
tc->setDisplayName(tr("WINSCW from %1").arg(version->displayName()));
|
||||
ProjectExplorer::ToolChainManager::instance()->registerToolChain(tc);
|
||||
}
|
||||
}
|
||||
}
|
||||
QString gcceDir = s->value(QLatin1String("GcceDirectory")).toString();
|
||||
if (!gcceDir.isEmpty()) {
|
||||
QFileInfo fi(gcceDir + QLatin1String("/bin/arm-none-symbianelf-g++.exe"));
|
||||
if (fi.exists() && fi.isExecutable()) {
|
||||
GcceToolChain *tc = createToolChain<GcceToolChain>(Constants::GCCE_TOOLCHAIN_ID);
|
||||
if (tc) {
|
||||
tc->setCompilerPath(fi.absoluteFilePath());
|
||||
tc->setDisplayName(tr("GCCE from %1").arg(version->displayName()));
|
||||
ProjectExplorer::ToolChainManager::instance()->registerToolChain(tc);
|
||||
}
|
||||
}
|
||||
}
|
||||
const QString mwcDir = s->value(QLatin1String("MwcDirectory")).toString();
|
||||
if (!mwcDir.isEmpty())
|
||||
m_pendingMwcUpdates.append(mwcDir);
|
||||
const QString gcceDir = s->value(QLatin1String("GcceDirectory")).toString();
|
||||
if (!gcceDir.isEmpty())
|
||||
m_pendingGcceUpdates.append(gcceDir);
|
||||
|
||||
m_versions.insert(version->uniqueId(), version);
|
||||
}
|
||||
@@ -413,6 +395,20 @@ bool QtVersionManager::isValidId(int id) const
|
||||
return m_versions.contains(id);
|
||||
}
|
||||
|
||||
QString QtVersionManager::popPendingMwcUpdate()
|
||||
{
|
||||
if (m_pendingMwcUpdates.isEmpty())
|
||||
return QString();
|
||||
return m_pendingMwcUpdates.takeFirst();
|
||||
}
|
||||
|
||||
QString QtVersionManager::popPendingGcceUpdate()
|
||||
{
|
||||
if (m_pendingGcceUpdates.isEmpty())
|
||||
return QString();
|
||||
return m_pendingGcceUpdates.takeFirst();
|
||||
}
|
||||
|
||||
QtVersion *QtVersionManager::version(int id) const
|
||||
{
|
||||
QMap<int, QtVersion *>::const_iterator it = m_versions.find(id);
|
||||
|
||||
@@ -294,6 +294,10 @@ public:
|
||||
static QString findQMakeBinaryFromMakefile(const QString &directory);
|
||||
bool isValidId(int id) const;
|
||||
|
||||
// Compatibility with pre-2.2:
|
||||
QString popPendingMwcUpdate();
|
||||
QString popPendingGcceUpdate();
|
||||
|
||||
signals:
|
||||
void qtVersionsChanged(const QList<int> &uniqueIds);
|
||||
void updateExamples(QString, QString, QString);
|
||||
@@ -328,6 +332,10 @@ private:
|
||||
int m_idcount;
|
||||
// managed by QtProjectManagerPlugin
|
||||
static QtVersionManager *m_self;
|
||||
|
||||
// Compatibility with pre-2.2:
|
||||
QStringList m_pendingMwcUpdates;
|
||||
QStringList m_pendingGcceUpdates;
|
||||
};
|
||||
|
||||
} // namespace Qt4ProjectManager
|
||||
|
||||
Reference in New Issue
Block a user