Commit a61d3f90 authored by con's avatar con
Browse files

A bit refactoring and make S60 Qt detection more flexible.

parent 1420cd17
......@@ -20,6 +20,7 @@
tool chain?
* seems that the make for building for device doesn't return useful exit code,
so a run is started even if the build has errors
* gcce error parser (gcc seems not to be enough sometimes, and the make tool does not return valid exit codes
* Run Configurations
* handling of active run config getting disabled not optimal yet
......@@ -32,8 +33,8 @@
* time stamp of copied sisx is ridiculous
* don't copy the sisx all the time
* don't hardcode copy destination
* Add compile output parser winscw at least
* be able to cancel the copy & install process
* isRunning is wrong
* WINSCW tool chain:
* predefined macros
......@@ -495,10 +495,8 @@ void S60DeviceRunControl::start()
emit addToOutputWindow(this, tr("Creating %1.sisx ...").arg(QDir::toNativeSeparators(m_baseFileName)));
Q_ASSERT(project);
m_toolsDirectory = S60Manager::instance()->devices()->deviceForId(
S60Manager::instance()->deviceIdFromDetectionSource(
project->qtVersion(project->activeBuildConfiguration())
->autodetectionSource())).epocRoot
m_toolsDirectory = S60Manager::instance()->deviceForQtVersion(
project->qtVersion(project->activeBuildConfiguration())).toolsRoot
+ "/epoc32/tools";
QString makesisTool = m_toolsDirectory + "/makesis.exe";
QString packageFile = QFileInfo(m_baseFileName + ".pkg").fileName();
......
......@@ -143,8 +143,7 @@ void S60EmulatorRunConfiguration::updateTarget()
return;
}
QString baseDir = S60Manager::instance()->devices()->deviceForId(
S60Manager::instance()->deviceIdFromDetectionSource(qtVersion->autodetectionSource())).epocRoot;
QString baseDir = S60Manager::instance()->deviceForQtVersion(qtVersion).epocRoot;
QString qmakeBuildConfig = "urel";
if (projectBuildConfiguration & QtVersion::DebugBuild)
qmakeBuildConfig = "udeb";
......
......@@ -148,12 +148,32 @@ void S60Manager::updateQtVersions()
ProjectExplorer::ToolChain *S60Manager::createWINSCWToolChain(const Qt4ProjectManager::QtVersion *version) const
{
QString id = version->autodetectionSource().mid(QString(S60_AUTODETECTION_SOURCE).length()+1);
return new WINSCWToolChain(m_devices->deviceForId(id), version->mwcDirectory());
return new WINSCWToolChain(deviceForQtVersion(version), version->mwcDirectory());
}
ProjectExplorer::ToolChain *S60Manager::createGCCEToolChain(const Qt4ProjectManager::QtVersion *version) const
{
QString id = version->autodetectionSource().mid(QString(S60_AUTODETECTION_SOURCE).length()+1);
return new GCCEToolChain(m_devices->deviceForId(id));
return new GCCEToolChain(deviceForQtVersion(version));
}
S60Devices::Device S60Manager::deviceForQtVersion(const Qt4ProjectManager::QtVersion *version) const
{
S60Devices::Device device;
QString deviceId;
if (version->isAutodetected())
deviceId = deviceIdFromDetectionSource(version->autodetectionSource());
if (deviceId.isEmpty()) { // it's not an s60 autodetected version
// have a look if we find the device root anyhow
if (QFile::exists(QString::fromLatin1("%1/epoc32").arg(version->path()))) {
device.epocRoot = version->path();
device.toolsRoot = device.epocRoot;
device.qt = device.epocRoot;
device.isDefault = false;
device.name = QString::fromLatin1("SDK");
device.id = QString::fromLatin1("SDK");
}
} else {
device = m_devices->deviceForId(deviceId);
}
return device;
}
......@@ -32,6 +32,7 @@
#include "qtversionmanager.h"
#include "serialdevicelister.h"
#include "s60devices.h"
#include <extensionsystem/iplugin.h>
#include <projectexplorer/toolchain.h>
......@@ -41,7 +42,6 @@
namespace Qt4ProjectManager {
namespace Internal {
class S60Devices;
class S60DevicesPreferencePane;
class S60EmulatorRunConfigurationFactory;
class S60EmulatorRunConfigurationRunner;
......@@ -60,6 +60,7 @@ public:
ProjectExplorer::ToolChain *createGCCEToolChain(const Qt4ProjectManager::QtVersion *version) const;
S60Devices *devices() const { return m_devices; }
S60Devices::Device deviceForQtVersion(const Qt4ProjectManager::QtVersion *version) const;
QString deviceIdFromDetectionSource(const QString &autoDetectionSource) const;
SerialDeviceLister *serialDeviceLister() const { return m_serialDeviceLister; }
......
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