Commit d3942a50 authored by BogDan Vatra's avatar BogDan Vatra

Show project name.

Task-number: QTCREATORBUG-12877
Change-Id: I6126903f82e3cfa1dd2669a9f7333410e99e1aee
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 8872ef1b
...@@ -46,18 +46,11 @@ namespace Android { ...@@ -46,18 +46,11 @@ namespace Android {
AndroidRunConfiguration::AndroidRunConfiguration(Target *parent, Core::Id id) AndroidRunConfiguration::AndroidRunConfiguration(Target *parent, Core::Id id)
: RunConfiguration(parent, id) : RunConfiguration(parent, id)
{ {
init();
} }
AndroidRunConfiguration::AndroidRunConfiguration(Target *parent, AndroidRunConfiguration *source) AndroidRunConfiguration::AndroidRunConfiguration(Target *parent, AndroidRunConfiguration *source)
: RunConfiguration(parent, source) : RunConfiguration(parent, source)
{ {
init();
}
void AndroidRunConfiguration::init()
{
setDefaultDisplayName(defaultDisplayName());
} }
QWidget *AndroidRunConfiguration::createConfigurationWidget() QWidget *AndroidRunConfiguration::createConfigurationWidget()
...@@ -70,11 +63,6 @@ Utils::OutputFormatter *AndroidRunConfiguration::createOutputFormatter() const ...@@ -70,11 +63,6 @@ Utils::OutputFormatter *AndroidRunConfiguration::createOutputFormatter() const
return new QtSupport::QtOutputFormatter(target()->project()); return new QtSupport::QtOutputFormatter(target()->project());
} }
QString AndroidRunConfiguration::defaultDisplayName()
{
return tr("Run on Android device");
}
const QString AndroidRunConfiguration::remoteChannel() const const QString AndroidRunConfiguration::remoteChannel() const
{ {
return QLatin1String(":5039"); return QLatin1String(":5039");
......
...@@ -50,10 +50,6 @@ public: ...@@ -50,10 +50,6 @@ public:
protected: protected:
AndroidRunConfiguration(ProjectExplorer::Target *parent, AndroidRunConfiguration *source); AndroidRunConfiguration(ProjectExplorer::Target *parent, AndroidRunConfiguration *source);
QString defaultDisplayName();
private:
void init();
}; };
} // namespace Android } // namespace Android
......
...@@ -48,6 +48,13 @@ using QmakeProjectManager::QmakeProject; ...@@ -48,6 +48,13 @@ using QmakeProjectManager::QmakeProject;
namespace QmakeAndroidSupport { namespace QmakeAndroidSupport {
namespace Internal { namespace Internal {
static const char ANDROID_RC_ID_PREFIX[] = "Qt4ProjectManager.AndroidRunConfiguration:";
static QString pathFromId(const Core::Id id)
{
return id.suffixAfter(ANDROID_RC_ID_PREFIX);
}
QmakeAndroidRunConfiguration::QmakeAndroidRunConfiguration(Target *parent, Core::Id id, const QString &path) QmakeAndroidRunConfiguration::QmakeAndroidRunConfiguration(Target *parent, Core::Id id, const QString &path)
: AndroidRunConfiguration(parent, id) : AndroidRunConfiguration(parent, id)
, m_proFilePath(path) , m_proFilePath(path)
...@@ -69,6 +76,7 @@ QmakeAndroidRunConfiguration::QmakeAndroidRunConfiguration(Target *parent, Qmake ...@@ -69,6 +76,7 @@ QmakeAndroidRunConfiguration::QmakeAndroidRunConfiguration(Target *parent, Qmake
void QmakeAndroidRunConfiguration::init() void QmakeAndroidRunConfiguration::init()
{ {
setDefaultDisplayName(defaultDisplayName());
connect(target()->project(), SIGNAL(proFileUpdated(QmakeProjectManager::QmakeProFileNode*,bool,bool)), connect(target()->project(), SIGNAL(proFileUpdated(QmakeProjectManager::QmakeProFileNode*,bool,bool)),
this, SLOT(proFileUpdated(QmakeProjectManager::QmakeProFileNode*,bool,bool))); this, SLOT(proFileUpdated(QmakeProjectManager::QmakeProFileNode*,bool,bool)));
} }
...@@ -97,6 +105,11 @@ QVariantMap QmakeAndroidRunConfiguration::toMap() const ...@@ -97,6 +105,11 @@ QVariantMap QmakeAndroidRunConfiguration::toMap() const
return map; return map;
} }
QString QmakeAndroidRunConfiguration::defaultDisplayName()
{
return QFileInfo(pathFromId(id())).completeBaseName();
}
bool QmakeAndroidRunConfiguration::isEnabled() const bool QmakeAndroidRunConfiguration::isEnabled() const
{ {
return m_parseSuccess && !m_parseInProgress; return m_parseSuccess && !m_parseInProgress;
......
...@@ -55,6 +55,7 @@ protected: ...@@ -55,6 +55,7 @@ protected:
bool fromMap(const QVariantMap &map); bool fromMap(const QVariantMap &map);
QVariantMap toMap() const; QVariantMap toMap() const;
QString defaultDisplayName();
private slots: private slots:
void proFileUpdated(QmakeProjectManager::QmakeProFileNode *pro, bool success, bool parseInProgress); void proFileUpdated(QmakeProjectManager::QmakeProFileNode *pro, bool success, bool parseInProgress);
......
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