QtSupport: FilePathify BaseQtVersion::qmlsceneCommand()

Change-Id: Ia0bc3fcb40bbda31cd114503ab599b65d7597e70
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-06-29 19:01:36 +02:00
parent c6dc02313d
commit b52f2d198a
3 changed files with 8 additions and 10 deletions

View File

@@ -176,7 +176,7 @@ FilePath QmlProjectRunConfiguration::qmlScenePath() const
if (deviceType == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) { if (deviceType == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) {
// If not given explicitly by Qt Version, try to pick it from $PATH. // If not given explicitly by Qt Version, try to pick it from $PATH.
const bool isDesktop = version->type() == QtSupport::Constants::DESKTOPQT; const bool isDesktop = version->type() == QtSupport::Constants::DESKTOPQT;
return FilePath::fromString(isDesktop ? version->qmlsceneCommand() : QString("qmlscene")); return isDesktop ? version->qmlsceneCommand() : FilePath::fromString("qmlscene");
} }
IDevice::ConstPtr dev = DeviceKitAspect::device(kit); IDevice::ConstPtr dev = DeviceKitAspect::device(kit);

View File

@@ -240,7 +240,7 @@ public:
QString m_designerCommand; QString m_designerCommand;
QString m_linguistCommand; QString m_linguistCommand;
QString m_qscxmlcCommand; QString m_qscxmlcCommand;
QString m_qmlsceneCommand; FilePath m_qmlsceneCommand;
QString m_qmlplugindumpCommand; QString m_qmlplugindumpCommand;
MacroExpanderWrapper m_expander; MacroExpanderWrapper m_expander;
@@ -1019,18 +1019,16 @@ QString BaseQtVersion::qscxmlcCommand() const
return d->m_qscxmlcCommand; return d->m_qscxmlcCommand;
} }
QString BaseQtVersion::qmlsceneCommand() const FilePath BaseQtVersion::qmlsceneCommand() const
{ {
if (!isValid()) if (!isValid())
return QString(); return {};
if (!d->m_qmlsceneCommand.isNull()) if (!d->m_qmlsceneCommand.isEmpty())
return d->m_qmlsceneCommand; return d->m_qmlsceneCommand;
const QString path const FilePath path = binPath() / HostOsInfo::withExecutableSuffix("qmlscene");
= binPath().pathAppended(HostOsInfo::withExecutableSuffix("qmlscene")).toString(); d->m_qmlsceneCommand = path.isExecutableFile() ? path : FilePath();
d->m_qmlsceneCommand = QFileInfo(path).isFile() ? path : QString();
return d->m_qmlsceneCommand; return d->m_qmlsceneCommand;
} }

View File

@@ -137,7 +137,7 @@ public:
QString designerCommand() const; QString designerCommand() const;
QString linguistCommand() const; QString linguistCommand() const;
QString qscxmlcCommand() const; QString qscxmlcCommand() const;
QString qmlsceneCommand() const; Utils::FilePath qmlsceneCommand() const;
QString qmlplugindumpCommand() const; QString qmlplugindumpCommand() const;
QString qtVersionString() const; QString qtVersionString() const;