Commit 1430358d authored by ck's avatar ck
Browse files

Maemo: Give meaningful names to run configurations.

Reviewed-by: kh1
parent d5932f0c
......@@ -74,7 +74,7 @@ MaemoRunConfiguration::MaemoRunConfiguration(Qt4Target *parent,
void MaemoRunConfiguration::init()
{
setDisplayName(tr("New Maemo Run Configuration"));
setDisplayName(QFileInfo(m_proFilePath).completeBaseName());
updateDeviceConfigurations();
connect(&MaemoDeviceConfigurations::instance(), SIGNAL(updated()), this,
......
......@@ -49,7 +49,7 @@ using namespace ProjectExplorer;
namespace {
QString targetFromId(const QString &id)
QString pathFromId(const QString &id)
{
if (!id.startsWith(MAEMO_RC_ID_PREFIX))
return QString();
......@@ -75,7 +75,7 @@ bool MaemoRunConfigurationFactory::canCreate(Target *parent,
|| target->id() != QLatin1String(Constants::MAEMO_DEVICE_TARGET_ID)) {
return false;
}
return id == MAEMO_RC_ID || id.startsWith(MAEMO_RC_ID_PREFIX);
return target->qt4Project()->hasApplicationProFile(pathFromId(id));
}
bool MaemoRunConfigurationFactory::canRestore(Target *parent,
......@@ -103,8 +103,7 @@ QStringList MaemoRunConfigurationFactory::availableCreationIds(Target *parent) c
QString MaemoRunConfigurationFactory::displayNameForId(const QString &id) const
{
Q_UNUSED(id)
return tr("New Maemo Run Configuration");
return QFileInfo(pathFromId(id)).completeBaseName();
}
RunConfiguration *MaemoRunConfigurationFactory::create(Target *parent,
......@@ -113,7 +112,7 @@ RunConfiguration *MaemoRunConfigurationFactory::create(Target *parent,
if (!canCreate(parent, id))
return 0;
Qt4Target *pqt4parent = static_cast<Qt4Target *>(parent);
return new MaemoRunConfiguration(pqt4parent, targetFromId(id));
return new MaemoRunConfiguration(pqt4parent, pathFromId(id));
}
......
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