forked from qt-creator/qt-creator
ProjectExplorer: Use FileName for Node::path
Change-Id: I4a41cfb629be8bb06b4b0616cd4475525e617a51 Reviewed-by: BogDan Vatra <bogdan@kde.org> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
033a628cdc
commit
88e7f935f4
@@ -85,7 +85,7 @@ private:
|
||||
QStandardItemModel m_deviceTypeModel;
|
||||
};
|
||||
|
||||
IosRunConfiguration::IosRunConfiguration(Target *parent, Core::Id id, const QString &path)
|
||||
IosRunConfiguration::IosRunConfiguration(Target *parent, Core::Id id, const FileName &path)
|
||||
: RunConfiguration(parent, id)
|
||||
, m_profilePath(path)
|
||||
{
|
||||
@@ -190,7 +190,7 @@ IosDeployStep *IosRunConfiguration::deployStep() const
|
||||
return step;
|
||||
}
|
||||
|
||||
QString IosRunConfiguration::profilePath() const
|
||||
FileName IosRunConfiguration::profilePath() const
|
||||
{
|
||||
return m_profilePath;
|
||||
}
|
||||
@@ -302,8 +302,7 @@ bool IosRunConfiguration::isEnabled() const
|
||||
QString IosRunConfiguration::disabledReason() const
|
||||
{
|
||||
if (m_parseInProgress)
|
||||
return tr("The .pro file \"%1\" is currently being parsed.")
|
||||
.arg(FileName::fromString(m_profilePath).fileName());
|
||||
return tr("The .pro file \"%1\" is currently being parsed.").arg(m_profilePath.fileName());
|
||||
if (!m_parseSuccess)
|
||||
return static_cast<QmakeProject *>(target()->project())
|
||||
->disabledReasonForRunConfiguration(m_profilePath);
|
||||
|
||||
@@ -54,14 +54,14 @@ class IosRunConfiguration : public ProjectExplorer::RunConfiguration
|
||||
friend class IosRunConfigurationFactory;
|
||||
|
||||
public:
|
||||
IosRunConfiguration(ProjectExplorer::Target *parent, Core::Id id, const QString &path);
|
||||
IosRunConfiguration(ProjectExplorer::Target *parent, Core::Id id, const Utils::FileName &path);
|
||||
|
||||
QWidget *createConfigurationWidget() Q_DECL_OVERRIDE;
|
||||
Utils::OutputFormatter *createOutputFormatter() const Q_DECL_OVERRIDE;
|
||||
IosDeployStep *deployStep() const;
|
||||
|
||||
QStringList commandLineArguments();
|
||||
QString profilePath() const;
|
||||
Utils::FileName profilePath() const;
|
||||
QString applicationName() const;
|
||||
Utils::FileName bundleDirectory() const;
|
||||
Utils::FileName localExecutable() const;
|
||||
@@ -87,7 +87,7 @@ private:
|
||||
friend class IosRunConfigurationWidget;
|
||||
void updateDisplayNames();
|
||||
|
||||
QString m_profilePath;
|
||||
Utils::FileName m_profilePath;
|
||||
QStringList m_arguments;
|
||||
QString m_lastDisabledReason;
|
||||
bool m_lastIsEnabled;
|
||||
|
||||
@@ -58,13 +58,13 @@ namespace Internal {
|
||||
#define IOS_PREFIX "Qt4ProjectManager.IosRunConfiguration"
|
||||
#define IOS_RC_ID_PREFIX IOS_PREFIX ":"
|
||||
|
||||
static QString pathFromId(Core::Id id)
|
||||
static Utils::FileName pathFromId(Core::Id id)
|
||||
{
|
||||
QString pathStr = id.toString();
|
||||
const QString prefix = QLatin1String(IOS_RC_ID_PREFIX);
|
||||
if (!pathStr.startsWith(prefix))
|
||||
return QString();
|
||||
return pathStr.mid(prefix.size());
|
||||
return Utils::FileName();
|
||||
return Utils::FileName::fromString(pathStr.mid(prefix.size()));
|
||||
}
|
||||
|
||||
IosRunConfigurationFactory::IosRunConfigurationFactory(QObject *parent)
|
||||
@@ -111,7 +111,7 @@ QList<Core::Id> IosRunConfigurationFactory::availableCreationIds(Target *parent,
|
||||
|
||||
QString IosRunConfigurationFactory::displayNameForId(Core::Id id) const
|
||||
{
|
||||
return QFileInfo(pathFromId(id)).completeBaseName();
|
||||
return pathFromId(id).toFileInfo().completeBaseName();
|
||||
}
|
||||
|
||||
RunConfiguration *IosRunConfigurationFactory::clone(Target *parent, RunConfiguration *source)
|
||||
@@ -133,10 +133,12 @@ bool IosRunConfigurationFactory::canHandle(Target *t) const
|
||||
QList<RunConfiguration *> IosRunConfigurationFactory::runConfigurationsForNode(Target *t, const Node *n)
|
||||
{
|
||||
QList<RunConfiguration *> result;
|
||||
foreach (RunConfiguration *rc, t->runConfigurations())
|
||||
if (IosRunConfiguration *qt4c = qobject_cast<IosRunConfiguration *>(rc))
|
||||
if (qt4c->profilePath() == n->path())
|
||||
result << rc;
|
||||
foreach (RunConfiguration *rc, t->runConfigurations()) {
|
||||
if (IosRunConfiguration *qt4c = qobject_cast<IosRunConfiguration *>(rc)) {
|
||||
if (qt4c->profilePath() == n->path())
|
||||
result << rc;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user