forked from qt-creator/qt-creator
ProjectExplorer: Allow a device to declare that empty commands are fine
Docker allows to run a container "by itself", not needing an explicit command line. Change-Id: I4f3992410f7f7bbcce1897a7400628ef9354043d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -419,7 +419,7 @@ void ApplicationLauncherPrivate::start(const Runnable &runnable, const IDevice::
|
||||
return;
|
||||
}
|
||||
|
||||
if (runnable.executable.isEmpty()) {
|
||||
if (!device->isEmptyCommandAllowed() && runnable.executable.isEmpty()) {
|
||||
doReportError(ApplicationLauncher::tr("Cannot run: No command given."));
|
||||
setFinished();
|
||||
return;
|
||||
|
@@ -152,6 +152,7 @@ public:
|
||||
Utils::PortList freePorts;
|
||||
QString debugServerPath;
|
||||
QString qmlsceneCommand;
|
||||
bool emptyCommandAllowed = false;
|
||||
|
||||
QList<Utils::Icon> deviceIcons;
|
||||
QList<IDevice::DeviceAction> deviceActions;
|
||||
@@ -189,6 +190,16 @@ void IDevice::openTerminal(const Utils::Environment &env, const QString &working
|
||||
d->openTerminal(env, workingDir);
|
||||
}
|
||||
|
||||
bool IDevice::isEmptyCommandAllowed() const
|
||||
{
|
||||
return d->emptyCommandAllowed;
|
||||
}
|
||||
|
||||
void IDevice::setAllowEmptyCommand(bool allow)
|
||||
{
|
||||
d->emptyCommandAllowed = allow;
|
||||
}
|
||||
|
||||
IDevice::~IDevice() = default;
|
||||
|
||||
/*!
|
||||
|
@@ -221,6 +221,9 @@ public:
|
||||
bool canOpenTerminal() const;
|
||||
void openTerminal(const Utils::Environment &env, const QString &workingDir) const;
|
||||
|
||||
bool isEmptyCommandAllowed() const;
|
||||
void setAllowEmptyCommand(bool allow);
|
||||
|
||||
protected:
|
||||
IDevice();
|
||||
|
||||
|
Reference in New Issue
Block a user