forked from qt-creator/qt-creator
Android: Remove outdated condition
Before e57ed31c33
the path was retrieved from
the root project node. In that commit this was changed and it is now read
from the Id.
Remove the argument and always read the path from id.
Also de-duplicate pathFromId.
Change-Id: I6aeef1106bc101ecb130f2c2ccb7226bfc7d0903
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
98862af779
commit
fb39de6a78
@@ -49,19 +49,19 @@ namespace Internal {
|
||||
|
||||
static const char ANDROID_RC_ID_PREFIX[] = "Qt4ProjectManager.AndroidRunConfiguration:";
|
||||
|
||||
static QString pathFromId(const Core::Id id)
|
||||
static Utils::FileName pathFromId(const Core::Id id)
|
||||
{
|
||||
return id.suffixAfter(ANDROID_RC_ID_PREFIX);
|
||||
return Utils::FileName::fromString(id.suffixAfter(ANDROID_RC_ID_PREFIX));
|
||||
}
|
||||
|
||||
QmakeAndroidRunConfiguration::QmakeAndroidRunConfiguration(Target *target)
|
||||
: AndroidRunConfiguration(target)
|
||||
{}
|
||||
|
||||
void QmakeAndroidRunConfiguration::initialize(Core::Id id, const Utils::FileName &path)
|
||||
void QmakeAndroidRunConfiguration::initialize(Core::Id id)
|
||||
{
|
||||
AndroidRunConfiguration::initialize(id);
|
||||
m_proFilePath = path;
|
||||
m_proFilePath = pathFromId(id);
|
||||
|
||||
ctor();
|
||||
}
|
||||
@@ -110,7 +110,7 @@ QString QmakeAndroidRunConfiguration::defaultDisplayName()
|
||||
return node->displayName();
|
||||
}
|
||||
|
||||
return QFileInfo(pathFromId(id())).completeBaseName();
|
||||
return displayNameForId(id());
|
||||
}
|
||||
|
||||
QString QmakeAndroidRunConfiguration::disabledReason() const
|
||||
@@ -129,6 +129,11 @@ QString QmakeAndroidRunConfiguration::buildSystemTarget() const
|
||||
return qmakeProject()->mapProFilePathToTarget(m_proFilePath);
|
||||
}
|
||||
|
||||
QString QmakeAndroidRunConfiguration::displayNameForId(Core::Id id)
|
||||
{
|
||||
return pathFromId(id).toFileInfo().completeBaseName();
|
||||
}
|
||||
|
||||
QmakeProject *QmakeAndroidRunConfiguration::qmakeProject() const
|
||||
{
|
||||
Target *t = target();
|
||||
|
@@ -50,9 +50,11 @@ public:
|
||||
|
||||
QString buildSystemTarget() const final;
|
||||
|
||||
static QString displayNameForId(Core::Id id);
|
||||
|
||||
private:
|
||||
friend class ProjectExplorer::IRunConfigurationFactory;
|
||||
void initialize(Core::Id id, const Utils::FileName &path = Utils::FileName());
|
||||
void initialize(Core::Id id);
|
||||
void copyFrom(const QmakeAndroidRunConfiguration *source);
|
||||
|
||||
bool fromMap(const QVariantMap &map) override;
|
||||
|
@@ -46,11 +46,6 @@ namespace Internal {
|
||||
|
||||
static const char ANDROID_RC_ID_PREFIX[] = "Qt4ProjectManager.AndroidRunConfiguration:";
|
||||
|
||||
static Utils::FileName pathFromId(const Core::Id id)
|
||||
{
|
||||
return Utils::FileName::fromString(id.suffixAfter(ANDROID_RC_ID_PREFIX));
|
||||
}
|
||||
|
||||
QmakeAndroidRunConfigurationFactory::QmakeAndroidRunConfigurationFactory(QObject *parent)
|
||||
: IRunConfigurationFactory(parent)
|
||||
{
|
||||
@@ -58,7 +53,7 @@ QmakeAndroidRunConfigurationFactory::QmakeAndroidRunConfigurationFactory(QObject
|
||||
|
||||
QString QmakeAndroidRunConfigurationFactory::displayNameForId(Core::Id id) const
|
||||
{
|
||||
return pathFromId(id).toFileInfo().completeBaseName();
|
||||
return QmakeAndroidRunConfiguration::displayNameForId(id);
|
||||
}
|
||||
|
||||
bool QmakeAndroidRunConfigurationFactory::canCreate(Target *parent, Core::Id id) const
|
||||
@@ -92,8 +87,6 @@ QList<Core::Id> QmakeAndroidRunConfigurationFactory::availableCreationIds(Target
|
||||
|
||||
RunConfiguration *QmakeAndroidRunConfigurationFactory::doCreate(Target *parent, Core::Id id)
|
||||
{
|
||||
if (parent->project()->rootProjectNode())
|
||||
return createHelper<QmakeAndroidRunConfiguration>(parent, id, pathFromId(id));
|
||||
return createHelper<QmakeAndroidRunConfiguration>(parent, id);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user