Qt4projectManager: Refactor Qt4Target, split up in per target classes

Almost(*) all of the symbian and maemo specific code is now theoretically
moveable to a separate plugin. Thus making it possible to implement
new targets in a plugin.

(*) Noteable missing is the qtversion, which needs to be split up
per target too.

Also fixes
Task-Nr: QTCREATORBUG-2440

Reviewed-By: hunger
Reviewed-By: ck
This commit is contained in:
dt
2010-12-10 19:02:19 +01:00
parent 77bf0c17c5
commit 67cfb7e078
81 changed files with 2407 additions and 1013 deletions

View File

@@ -40,6 +40,8 @@
#include "maemoremotemountsmodel.h"
#include "maemorunconfiguration.h"
#include "maemoruncontrol.h"
#include "maemotoolchain.h"
#include "qt4maemotarget.h"
#include <projectexplorer/projectexplorerconstants.h>
#include <debugger/debuggerconstants.h>
@@ -74,7 +76,7 @@ MaemoRunConfigurationFactory::~MaemoRunConfigurationFactory()
bool MaemoRunConfigurationFactory::canCreate(Target *parent,
const QString &id) const
{
Qt4Target *target = qobject_cast<Qt4Target *>(parent);
Qt4MaemoTarget *target = qobject_cast<Qt4MaemoTarget *>(parent);
if (!target
|| target->id() != QLatin1String(Constants::MAEMO_DEVICE_TARGET_ID)) {
return false;
@@ -85,7 +87,7 @@ bool MaemoRunConfigurationFactory::canCreate(Target *parent,
bool MaemoRunConfigurationFactory::canRestore(Target *parent,
const QVariantMap &map) const
{
if (!qobject_cast<Qt4Target *>(parent))
if (!qobject_cast<Qt4MaemoTarget *>(parent))
return false;
return ProjectExplorer::idFromMap(map)
.startsWith(QLatin1String(MAEMO_RC_ID));
@@ -99,7 +101,7 @@ bool MaemoRunConfigurationFactory::canClone(Target *parent,
QStringList MaemoRunConfigurationFactory::availableCreationIds(Target *parent) const
{
if (Qt4Target *t = qobject_cast<Qt4Target *>(parent)) {
if (Qt4MaemoTarget *t = qobject_cast<Qt4MaemoTarget *>(parent)) {
if (t->id() == QLatin1String(Constants::MAEMO_DEVICE_TARGET_ID)) {
return t->qt4Project()->
applicationProFilePathes(QLatin1String(MAEMO_RC_ID_PREFIX));
@@ -118,7 +120,7 @@ RunConfiguration *MaemoRunConfigurationFactory::create(Target *parent,
{
if (!canCreate(parent, id))
return 0;
Qt4Target *pqt4parent = static_cast<Qt4Target *>(parent);
Qt4MaemoTarget *pqt4parent = static_cast<Qt4MaemoTarget *>(parent);
return new MaemoRunConfiguration(pqt4parent, pathFromId(id));
}
@@ -128,7 +130,7 @@ RunConfiguration *MaemoRunConfigurationFactory::restore(Target *parent,
{
if (!canRestore(parent, map))
return 0;
Qt4Target *target = static_cast<Qt4Target *>(parent);
Qt4MaemoTarget *target = static_cast<Qt4MaemoTarget *>(parent);
MaemoRunConfiguration *rc = new MaemoRunConfiguration(target, QString());
if (rc->fromMap(map))
return rc;
@@ -144,7 +146,7 @@ RunConfiguration *MaemoRunConfigurationFactory::clone(Target *parent,
return 0;
MaemoRunConfiguration *old = static_cast<MaemoRunConfiguration *>(source);
return new MaemoRunConfiguration(static_cast<Qt4Target *>(parent), old);
return new MaemoRunConfiguration(static_cast<Qt4MaemoTarget *>(parent), old);
}
// #pragma mark -- MaemoRunControlFactory