forked from qt-creator/qt-creator
ProjectExplorer: Remove IDevice::terminalCommand
Since Terminals can now be started for device file paths, there is no need anymore for IDevice::terminalCommand. Change-Id: I01c831ea7ee29d53efa6880631e8c6d54a4316aa Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -8,6 +8,24 @@
|
||||
|
||||
namespace Utils::Terminal {
|
||||
|
||||
FilePath defaultShellForDevice(const FilePath &deviceRoot)
|
||||
{
|
||||
if (!deviceRoot.needsDevice())
|
||||
return {};
|
||||
|
||||
// TODO: Windows ?
|
||||
const Environment env = deviceRoot.deviceEnvironment();
|
||||
FilePath shell = FilePath::fromUserInput(env.value_or("SHELL", "/bin/sh"));
|
||||
|
||||
if (!shell.isAbsolutePath())
|
||||
shell = env.searchInPath(shell.nativePath());
|
||||
|
||||
if (shell.isEmpty())
|
||||
return shell;
|
||||
|
||||
return shell.onDevice(deviceRoot);
|
||||
}
|
||||
|
||||
struct HooksPrivate
|
||||
{
|
||||
HooksPrivate()
|
||||
|
Reference in New Issue
Block a user