Commit 920ed114 authored by Tommi Asp's avatar Tommi Asp Committed by Tobias Hunger

Better deploy configuration handling for S60 target

Allows creating custom DeployConfigurationFactories for S60 target
Related to QTCREATORBUG-5535

Change-Id: I2a38ad11e0102eaae3e0a67af2a0750b4b3512a5
Reviewed-by: default avatarTommi Asp <tommi@mowhi.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent c3a62f9c
......@@ -230,7 +230,7 @@ ProjectExplorer::Target *Qt4SymbianTargetFactory::create(ProjectExplorer::Projec
info.version, info.buildConfig,
info.additionalArguments, info.directory, info.importing);
t->addDeployConfiguration(t->createDeployConfiguration(QLatin1String(Qt4ProjectManager::Constants::S60_DEVICE_TARGET_ID)));
t->addDeployConfiguration(t->createDeployConfiguration(QLatin1String(S60_DEPLOYCONFIGURATION_ID)));
t->createApplicationProFiles();
......
......@@ -57,7 +57,6 @@ using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;
namespace {
const char S60_DC_ID[] = "Qt4ProjectManager.S60DeployConfiguration";
const char S60_DC_PREFIX[] = "Qt4ProjectManager.S60DeployConfiguration.";
const char SERIAL_PORT_NAME_KEY[] = "Qt4ProjectManager.S60DeployConfiguration.SerialPortName";
......@@ -81,7 +80,7 @@ QString pathFromId(const QString &id)
// ======== S60DeployConfiguration
S60DeployConfiguration::S60DeployConfiguration(Target *parent) :
DeployConfiguration(parent, QLatin1String(S60_DC_ID)),
DeployConfiguration(parent, QLatin1String(S60_DEPLOYCONFIGURATION_ID)),
m_activeBuildConfiguration(0),
#ifdef Q_OS_WIN
m_serialPortName(QLatin1String("COM5")),
......@@ -479,18 +478,18 @@ DeployConfiguration *S60DeployConfigurationFactory::create(Target *parent, const
return dc;
}
bool S60DeployConfigurationFactory::canCreate(Target *parent, const QString& /*id*/) const
bool S60DeployConfigurationFactory::canCreate(Target *parent, const QString& id) const
{
Qt4SymbianTarget * t = qobject_cast<Qt4SymbianTarget *>(parent);
if (!t || t->id() != QLatin1String(Constants::S60_DEVICE_TARGET_ID))
if (!t || t->id() != QLatin1String(Constants::S60_DEVICE_TARGET_ID)
|| !id.startsWith(QLatin1String(S60_DEPLOYCONFIGURATION_ID)))
return false;
return true;
}
bool S60DeployConfigurationFactory::canRestore(Target *parent, const QVariantMap& /*map*/) const
bool S60DeployConfigurationFactory::canRestore(Target *parent, const QVariantMap& map) const
{
Qt4SymbianTarget * t = qobject_cast<Qt4SymbianTarget *>(parent);
return t && t->id() == QLatin1String(Constants::S60_DEVICE_TARGET_ID);
return canCreate(parent, idFromMap(map));
}
DeployConfiguration *S60DeployConfigurationFactory::restore(Target *parent, const QVariantMap &map)
......@@ -510,7 +509,7 @@ bool S60DeployConfigurationFactory::canClone(Target *parent, DeployConfiguration
{
if (!qobject_cast<Qt4SymbianTarget *>(parent))
return false;
return source->id() == QLatin1String(S60_DC_ID);
return source->id() == QLatin1String(S60_DEPLOYCONFIGURATION_ID);
}
DeployConfiguration *S60DeployConfigurationFactory::clone(Target *parent, DeployConfiguration *source)
......
......@@ -52,6 +52,8 @@ class S60DeployConfigurationFactory;
namespace Internal {
class Qt4SymbianTarget;
const char S60_DEPLOYCONFIGURATION_ID[] = "Qt4ProjectManager.S60DeployConfiguration";
}
class QT4PROJECTMANAGER_EXPORT S60DeployConfiguration : public ProjectExplorer::DeployConfiguration
......
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