Style cleanup, no functional change.

This commit is contained in:
kh1
2010-02-22 15:56:08 +01:00
parent 6bee68dcff
commit 48abff252f

View File

@@ -169,16 +169,17 @@ void MaemoRunConfiguration::init()
setDisplayName(tr("MaemoRunConfiguration")); setDisplayName(tr("MaemoRunConfiguration"));
} }
connect(&MaemoDeviceConfigurations::instance(), SIGNAL(updated()), connect(&MaemoDeviceConfigurations::instance(), SIGNAL(updated()), this,
this, SLOT(updateDeviceConfigurations())); SLOT(updateDeviceConfigurations()));
connect(qt4Target(), SIGNAL(targetInformationChanged()), connect(qt4Target(), SIGNAL(targetInformationChanged()), this,
this, SLOT(invalidateCachedTargetInformation())); SLOT(invalidateCachedTargetInformation()));
connect(qt4Target(), SIGNAL(targetInformationChanged()), connect(qt4Target(), SIGNAL(targetInformationChanged()), this,
this, SLOT(enabledStateChanged())); SLOT(enabledStateChanged()));
connect(qt4Target()->qt4Project(), SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)), connect(qt4Target()->qt4Project(),
SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
this, SLOT(proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode*))); this, SLOT(proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode*)));
qemu = new QProcess(this); qemu = new QProcess(this);
@@ -239,7 +240,8 @@ QVariantMap MaemoRunConfiguration::toMap() const
map.insert(SimulatorPathKey, m_simulatorPath); map.insert(SimulatorPathKey, m_simulatorPath);
const QDir &dir = QFileInfo(qt4Target()->qt4Project()->file()->fileName()).absoluteDir(); const QDir &dir = QFileInfo(qt4Target()->qt4Project()->file()->fileName())
.absoluteDir();
map.insert(ProFileKey, dir.relativeFilePath(m_proFilePath)); map.insert(ProFileKey, dir.relativeFilePath(m_proFilePath));
return map; return map;
@@ -260,7 +262,8 @@ bool MaemoRunConfiguration::fromMap(const QVariantMap &map)
m_simulatorPath = map.value(SimulatorPathKey).toString(); m_simulatorPath = map.value(SimulatorPathKey).toString();
const QDir &dir = QFileInfo(qt4Target()->qt4Project()->file()->fileName()).absoluteDir(); const QDir &dir = QFileInfo(qt4Target()->qt4Project()->file()->fileName())
.absoluteDir();
m_proFilePath = dir.filePath(map.value(ProFileKey).toString()); m_proFilePath = dir.filePath(map.value(ProFileKey).toString());
return true; return true;
@@ -438,7 +441,8 @@ void MaemoRunConfiguration::updateTarget() const
m_executable.clear(); m_executable.clear();
m_cachedTargetInformationValid = true; m_cachedTargetInformationValid = true;
Qt4TargetInformation info = qt4Target()->targetInformation(activeQt4BuildConfiguration(), Qt4TargetInformation info =
qt4Target()->targetInformation(activeQt4BuildConfiguration(),
m_proFilePath); m_proFilePath);
if (info.error != Qt4TargetInformation::NoError) { if (info.error != Qt4TargetInformation::NoError) {
if (info.error == Qt4TargetInformation::ProParserError) { if (info.error == Qt4TargetInformation::ProParserError) {
@@ -581,10 +585,12 @@ void MaemoRunConfiguration::updateDeviceConfigurations()
emit deviceConfigurationsUpdated(); emit deviceConfigurationsUpdated();
} }
// #pragma mark -- MaemoRunConfigurationFactory // #pragma mark -- MaemoRunConfigurationFactory
MaemoRunConfigurationFactory::MaemoRunConfigurationFactory(QObject *parent) :
IRunConfigurationFactory(parent) MaemoRunConfigurationFactory::MaemoRunConfigurationFactory(QObject *parent)
: IRunConfigurationFactory(parent)
{ {
ProjectExplorerPlugin *explorer = ProjectExplorerPlugin::instance(); ProjectExplorerPlugin *explorer = ProjectExplorerPlugin::instance();
connect(explorer->session(), SIGNAL(projectAdded(ProjectExplorer::Project*)), connect(explorer->session(), SIGNAL(projectAdded(ProjectExplorer::Project*)),
@@ -602,37 +608,37 @@ MaemoRunConfigurationFactory::~MaemoRunConfigurationFactory()
bool MaemoRunConfigurationFactory::canCreate(Target *parent, bool MaemoRunConfigurationFactory::canCreate(Target *parent,
const QString &id) const const QString &id) const
{ {
Qt4Target * t = qobject_cast<Qt4Target *>(parent); Qt4Target *target = qobject_cast<Qt4Target *>(parent);
if (!t || if (!target
(t->id() != QLatin1String(MAEMO_DEVICE_TARGET_ID) && || (target->id() != QLatin1String(MAEMO_DEVICE_TARGET_ID)
t->id() != QLatin1String(MAEMO_EMULATOR_TARGET_ID))) && target->id() != QLatin1String(MAEMO_EMULATOR_TARGET_ID))) {
return false; return false;
}
return id == QLatin1String(MAEMO_RC_ID); return id == QLatin1String(MAEMO_RC_ID);
} }
bool MaemoRunConfigurationFactory::canRestore(Target *parent, bool MaemoRunConfigurationFactory::canRestore(Target *parent,
const QVariantMap &map) const const QVariantMap &map) const
{ {
QString id(ProjectExplorer::idFromMap(map)); return canCreate(parent, ProjectExplorer::idFromMap(map));
return canCreate(parent, id);
} }
bool MaemoRunConfigurationFactory::canClone(Target *parent, bool MaemoRunConfigurationFactory::canClone(Target *parent,
RunConfiguration *source) const RunConfiguration *source) const
{ {
QString id(source->id()); return canCreate(parent, source->id());
return canCreate(parent, id);
} }
QStringList MaemoRunConfigurationFactory::availableCreationIds(Target *parent) const QStringList MaemoRunConfigurationFactory::availableCreationIds(Target *parent) const
{ {
Qt4Target *t = qobject_cast<Qt4Target *>(parent); if (Qt4Target *t = qobject_cast<Qt4Target *>(parent)) {
if (!t || if (t->id() == QLatin1String(MAEMO_DEVICE_TARGET_ID)
(t->id() != QLatin1String(MAEMO_DEVICE_TARGET_ID) && || t->id() == QLatin1String(MAEMO_EMULATOR_TARGET_ID)) {
t->id() != QLatin1String(MAEMO_EMULATOR_TARGET_ID))) return t->qt4Project()->
applicationProFilePathes(QLatin1String(MAEMO_RC_ID_PREFIX));
}
}
return QStringList(); return QStringList();
return t->qt4Project()->applicationProFilePathes(QLatin1String(MAEMO_RC_ID_PREFIX));
} }
QString MaemoRunConfigurationFactory::displayNameForId(const QString &id) const QString MaemoRunConfigurationFactory::displayNameForId(const QString &id) const
@@ -649,7 +655,8 @@ RunConfiguration *MaemoRunConfigurationFactory::create(Target *parent,
if (!canCreate(parent, id)) if (!canCreate(parent, id))
return 0; return 0;
Qt4Target *pqt4parent = static_cast<Qt4Target *>(parent); Qt4Target *pqt4parent = static_cast<Qt4Target *>(parent);
MaemoRunConfiguration *rc = new MaemoRunConfiguration(pqt4parent, targetFromId(id)); MaemoRunConfiguration *rc = new MaemoRunConfiguration(pqt4parent,
targetFromId(id));
setupRunConfiguration(rc); setupRunConfiguration(rc);
return rc; return rc;
@@ -686,22 +693,21 @@ RunConfiguration *MaemoRunConfigurationFactory::clone(Target *parent,
void MaemoRunConfigurationFactory::setupRunConfiguration(MaemoRunConfiguration *rc) void MaemoRunConfigurationFactory::setupRunConfiguration(MaemoRunConfiguration *rc)
{ {
if (!rc) if (rc) {
return; connect(MaemoManager::instance(), SIGNAL(startStopQemu()), rc,
SLOT(startStopQemu()));
connect(MaemoManager::instance(), SIGNAL(startStopQemu()), connect(rc, SIGNAL(qemuProcessStatus(bool)), MaemoManager::instance(),
rc, SLOT(startStopQemu())); SLOT(updateQemuSimulatorStarter(bool)));
connect(rc, SIGNAL(qemuProcessStatus(bool)), }
MaemoManager::instance(), SLOT(updateQemuSimulatorStarter(bool)));
} }
void MaemoRunConfigurationFactory::projectAdded( void MaemoRunConfigurationFactory::projectAdded(
ProjectExplorer::Project *project) ProjectExplorer::Project *project)
{ {
disconnect(project, SIGNAL(addedTarget(ProjectExplorer::Target*)), disconnect(project, SIGNAL(addedTarget(ProjectExplorer::Target*)), this,
this, SLOT(targetAdded(ProjectExplorer::Target*))); SLOT(targetAdded(ProjectExplorer::Target*)));
disconnect(project, SIGNAL(removedTarget(ProjectExplorer::Target*)), disconnect(project, SIGNAL(removedTarget(ProjectExplorer::Target*)), this,
this, SLOT(targetRemoved(ProjectExplorer::Target*))); SLOT(targetRemoved(ProjectExplorer::Target*)));
foreach (Target *target, project->targets()) foreach (Target *target, project->targets())
targetAdded(target); targetAdded(target);
@@ -710,10 +716,10 @@ void MaemoRunConfigurationFactory::projectAdded(
void MaemoRunConfigurationFactory::projectRemoved( void MaemoRunConfigurationFactory::projectRemoved(
ProjectExplorer::Project *project) ProjectExplorer::Project *project)
{ {
connect(project, SIGNAL(addedTarget(ProjectExplorer::Target*)), connect(project, SIGNAL(addedTarget(ProjectExplorer::Target*)), this,
this, SLOT(targetAdded(ProjectExplorer::Target*))); SLOT(targetAdded(ProjectExplorer::Target*)));
connect(project, SIGNAL(removedTarget(ProjectExplorer::Target*)), connect(project, SIGNAL(removedTarget(ProjectExplorer::Target*)), this,
this, SLOT(targetRemoved(ProjectExplorer::Target*))); SLOT(targetRemoved(ProjectExplorer::Target*)));
foreach (Target *target, project->targets()) foreach (Target *target, project->targets())
targetRemoved(target); targetRemoved(target);
@@ -721,8 +727,8 @@ void MaemoRunConfigurationFactory::projectRemoved(
void MaemoRunConfigurationFactory::targetAdded(ProjectExplorer::Target *target) void MaemoRunConfigurationFactory::targetAdded(ProjectExplorer::Target *target)
{ {
if (target->id() != QLatin1String(MAEMO_EMULATOR_TARGET_ID) && if (target->id() != QLatin1String(MAEMO_EMULATOR_TARGET_ID)
target->id() != QLatin1String(MAEMO_DEVICE_TARGET_ID)) && target->id() != QLatin1String(MAEMO_DEVICE_TARGET_ID))
return; return;
MaemoManager::instance()->addQemuSimulatorStarter(target->project()); MaemoManager::instance()->addQemuSimulatorStarter(target->project());
@@ -730,8 +736,8 @@ void MaemoRunConfigurationFactory::targetAdded(ProjectExplorer::Target *target)
void MaemoRunConfigurationFactory::targetRemoved(ProjectExplorer::Target *target) void MaemoRunConfigurationFactory::targetRemoved(ProjectExplorer::Target *target)
{ {
if (target->id() != QLatin1String(MAEMO_EMULATOR_TARGET_ID) && if (target->id() != QLatin1String(MAEMO_EMULATOR_TARGET_ID)
target->id() != QLatin1String(MAEMO_DEVICE_TARGET_ID)) && target->id() != QLatin1String(MAEMO_DEVICE_TARGET_ID))
return; return;
MaemoManager::instance()->removeQemuSimulatorStarter(target->project()); MaemoManager::instance()->removeQemuSimulatorStarter(target->project());
@@ -746,13 +752,14 @@ void MaemoRunConfigurationFactory::currentProjectChanged(
Target *maemoTarget(project->target(QLatin1String(MAEMO_EMULATOR_TARGET_ID))); Target *maemoTarget(project->target(QLatin1String(MAEMO_EMULATOR_TARGET_ID)));
if (!maemoTarget) if (!maemoTarget)
maemoTarget = project->target(QLatin1String(MAEMO_DEVICE_TARGET_ID)); maemoTarget = project->target(QLatin1String(MAEMO_DEVICE_TARGET_ID));
MaemoManager::instance()->setQemuSimulatorStarterEnabled(maemoTarget); MaemoManager::instance()->setQemuSimulatorStarterEnabled(maemoTarget != 0);
bool isRunning(false); bool isRunning = false;
if (maemoTarget && if (maemoTarget
project->activeTarget() == maemoTarget && && project->activeTarget() == maemoTarget
maemoTarget->activeRunConfiguration()) { && maemoTarget->activeRunConfiguration()) {
MaemoRunConfiguration *mrc = qobject_cast<MaemoRunConfiguration *>(maemoTarget->activeRunConfiguration()); MaemoRunConfiguration *mrc = qobject_cast<MaemoRunConfiguration *>
(maemoTarget->activeRunConfiguration());
if (mrc) if (mrc)
isRunning = mrc->isQemuRunning(); isRunning = mrc->isQemuRunning();
} }