forked from qt-creator/qt-creator
No need to have a function if we can call connect inside the class ctor.
This commit is contained in:
@@ -107,6 +107,11 @@ void MaemoRunConfiguration::init()
|
|||||||
qemu = new QProcess(this);
|
qemu = new QProcess(this);
|
||||||
connect(qemu, SIGNAL(finished(int, QProcess::ExitStatus)), this,
|
connect(qemu, SIGNAL(finished(int, QProcess::ExitStatus)), this,
|
||||||
SLOT(qemuProcessFinished()));
|
SLOT(qemuProcessFinished()));
|
||||||
|
|
||||||
|
connect(&MaemoManager::instance(), SIGNAL(startStopQemu()), this,
|
||||||
|
SLOT(startStopQemu()));
|
||||||
|
connect(this, SIGNAL(qemuProcessStatus(bool)), &MaemoManager::instance(),
|
||||||
|
SLOT(updateQemuSimulatorStarter(bool)));
|
||||||
}
|
}
|
||||||
|
|
||||||
MaemoRunConfiguration::~MaemoRunConfiguration()
|
MaemoRunConfiguration::~MaemoRunConfiguration()
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ QStringList MaemoRunConfigurationFactory::availableCreationIds(Target *parent) c
|
|||||||
|
|
||||||
QString MaemoRunConfigurationFactory::displayNameForId(const QString &id) const
|
QString MaemoRunConfigurationFactory::displayNameForId(const QString &id) const
|
||||||
{
|
{
|
||||||
QString target(targetFromId(id));
|
const QString &target = targetFromId(id);
|
||||||
if (target.isEmpty())
|
if (target.isEmpty())
|
||||||
return QString();
|
return QString();
|
||||||
return tr("%1 on Maemo Device").arg(QFileInfo(target).completeBaseName());
|
return tr("%1 on Maemo Device").arg(QFileInfo(target).completeBaseName());
|
||||||
@@ -125,10 +125,7 @@ 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,
|
return new MaemoRunConfiguration(pqt4parent, targetFromId(id));
|
||||||
targetFromId(id));
|
|
||||||
setupRunConfiguration(rc);
|
|
||||||
return rc;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,14 +134,13 @@ RunConfiguration *MaemoRunConfigurationFactory::restore(Target *parent,
|
|||||||
{
|
{
|
||||||
if (!canRestore(parent, map))
|
if (!canRestore(parent, map))
|
||||||
return 0;
|
return 0;
|
||||||
Qt4Target *t = static_cast<Qt4Target *>(parent);
|
Qt4Target *target = static_cast<Qt4Target *>(parent);
|
||||||
MaemoRunConfiguration *rc = new MaemoRunConfiguration(t, QString());
|
MaemoRunConfiguration *rc = new MaemoRunConfiguration(target, QString());
|
||||||
if (!rc->fromMap(map)) {
|
if (rc->fromMap(map))
|
||||||
|
return rc;
|
||||||
|
|
||||||
delete rc;
|
delete rc;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
setupRunConfiguration(rc);
|
|
||||||
return rc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RunConfiguration *MaemoRunConfigurationFactory::clone(Target *parent,
|
RunConfiguration *MaemoRunConfigurationFactory::clone(Target *parent,
|
||||||
@@ -152,23 +148,9 @@ RunConfiguration *MaemoRunConfigurationFactory::clone(Target *parent,
|
|||||||
{
|
{
|
||||||
if (!canClone(parent, source))
|
if (!canClone(parent, source))
|
||||||
return 0;
|
return 0;
|
||||||
Qt4Target *t = static_cast<Qt4Target *>(parent);
|
|
||||||
MaemoRunConfiguration *old = static_cast<MaemoRunConfiguration *>(source);
|
MaemoRunConfiguration *old = static_cast<MaemoRunConfiguration *>(source);
|
||||||
MaemoRunConfiguration *rc = new MaemoRunConfiguration(t, old);
|
return new MaemoRunConfiguration(static_cast<Qt4Target *>(parent), old);
|
||||||
|
|
||||||
setupRunConfiguration(rc);
|
|
||||||
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MaemoRunConfigurationFactory::setupRunConfiguration(MaemoRunConfiguration *rc)
|
|
||||||
{
|
|
||||||
if (rc) {
|
|
||||||
connect(&MaemoManager::instance(), SIGNAL(startStopQemu()), rc,
|
|
||||||
SLOT(startStopQemu()));
|
|
||||||
connect(rc, SIGNAL(qemuProcessStatus(bool)), &MaemoManager::instance(),
|
|
||||||
SLOT(updateQemuSimulatorStarter(bool)));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoRunConfigurationFactory::projectAdded(
|
void MaemoRunConfigurationFactory::projectAdded(
|
||||||
|
|||||||
@@ -70,9 +70,6 @@ private slots:
|
|||||||
void targetRemoved(ProjectExplorer::Target *target);
|
void targetRemoved(ProjectExplorer::Target *target);
|
||||||
|
|
||||||
void currentProjectChanged(ProjectExplorer::Project *project);
|
void currentProjectChanged(ProjectExplorer::Project *project);
|
||||||
|
|
||||||
private:
|
|
||||||
void setupRunConfiguration(MaemoRunConfiguration *rc);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class MaemoRunControlFactory : public IRunControlFactory
|
class MaemoRunControlFactory : public IRunControlFactory
|
||||||
|
|||||||
Reference in New Issue
Block a user